0

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は、ペイパルの支払いを完了するのと同じように機能します。$transactionIDとその他は常に空であり、これらを記録したいと思います。

some1は私を正しい方向に向けることができます

ありがとうクレイグ

4

1 に答える 1

2

PayPal のDoExpressCheckoutPaymentAPI操作ドキュメントによると:

TRANSACTIONID はバージョン 63.0 以降非推奨です。代わりに PAYMENTINFO_n_TRANSACTIONID を使用してください。

同様に、PAYMENTTYPETRANSACTIONTYPE、およびORDERTIMEは非推奨です。応答メッセージ内の更新された変数名については、提供されたリンクを確認してください。

于 2012-10-09T22:01:01.883 に答える