gpt4 book ai didi

php - 从 DoExpressCheckoutPayment 回复中获取 transactionId

转载 作者:太空宇宙 更新时间:2023-11-03 16:19:58 25 4
gpt4 key购买 nike

我无法从 doexpresscheckoutpayment 的回复中获取交易 ID 和其他信息,我花了几个晚上阅读,但我要么不明白发生了什么,要么我在某些地方出错了

这里是一些代码

    function ConfirmPayment( $FinalPaymentAmt )
{

//Format the other parameters that were stored in the session from the previous calls
$token = urlencode($_SESSION['TOKEN']);
$paymentType = urlencode($_SESSION['PaymentType']);
$currencyCodeType = urlencode($_SESSION['currencyCodeType']);
$payerID = urlencode($_SESSION['payer_id']);

$serverName = urlencode($_SERVER['SERVER_NAME']);

$nvpstr = '&TOKEN=' . $token . '&PAYERID=' . $payerID . '&PAYMENTREQUEST_0_PAYMENTACTION=' . $paymentType . '&PAYMENTREQUEST_0_AMT=' . $FinalPaymentAmt;
$nvpstr .= '&PAYMENTREQUEST_0_CURRENCYCODE=' . $currencyCodeType . '&IPADDRESS=' . $serverName;

/* Make the call to PayPal to finalize payment
If an error occured, show the resulting errors
*/
$resArray=hash_call("DoExpressCheckoutPayment",$nvpstr);

/* Display the API response back to the browser.
If the response from PayPal was a success, display the response parameters'
If the response was an error, display the errors received using APIError.php.
*/
$ack = strtoupper($resArray["ACK"]);

return $resArray;
}

然后

$resArray = ConfirmPayment($finalPaymentAmount);
$ack = strtoupper($resArray["ACK"]);
if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {

$transactionId = $resArray["TRANSACTIONID"]; // ' Unique transaction ID of the payment. Note: If the PaymentAction of the request was Authorization or Order, this value is your AuthorizationID for use with the Authorization & Capture APIs.
$transactionType = $resArray["TRANSACTIONTYPE"]; //' The type of transaction Possible values: l cart l express-checkout
$paymentType = $resArray["PAYMENTTYPE"]; //' Indicates whether the payment is instant or delayed. Possible values: l none l echeck l instant
$orderTime = $resArray["ORDERTIME"]; //' Time/date stamp of payment

等等等等

doexprescheoutpayment 的工作方式与完成 paypal 付款一样,只是 $transactionID 和其他总是空的,我想记录这些

有人能给我指出正确的方向吗

谢谢克雷格

最佳答案

根据 PayPal's DoExpressCheckoutPayment API操作文档:

TRANSACTIONID is deprecated since version 63.0. Use PAYMENTINFO_n_TRANSACTIONID instead.

同样,PAYMENTTYPETRANSACTIONTYPEORDERTIME 已弃用。检查响应消息中提供的更新变量名称链接。

关于php - 从 DoExpressCheckoutPayment 回复中获取 transactionId,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12808889/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com