我的结帐流程需要多个授权和捕获,如https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECRelatedAPIOps/#authorization-payment-action-for-express-checkout中所述
我需要进行单独的身份验证和捕获,因为订单包含可能单独发货的多个项目。
首先,我SetExpressCheckout
使用Authorization
.
cancelUrl=xxxxxxx&
PAYMENTREQUEST_0_PAYMENTACTION=Authorization&
PAYMENTREQUEST_0_CURRENCYCODE=USD&
L_BILLINGAGREEMENTDESCRIPTION0=ClubUsage&
VERSION=204&
PAYMENTREQUEST_0_AMT=30.00&
L_BILLINGTYPE0=MerchantInitiatedBilling&
METHOD=SetExpressCheckout&
USER=xxxxxxx&
PWD=xxxxxxx&
returnUrl=xxxxxxx&
SIGNATURE=xxxxxxx
我收到带有令牌的响应;
TOKEN=EC-2EP3671xxxxxxxx&
TIMESTAMP=xxxxxxx&
CORRELATIONID=xxxxxxx&
ACK=Success&
VERSION=204&
BUILD=xxxxxxx
接下来,我将用户重定向到贝宝登录并同意。当他们回来时,我打电话来创建一个计费协议,因为我将在以后进行参考交易。这工作正常。接下来我进行第一次身份验证调用;
PAYMENTREQUEST_0_PAYMENTACTION=Authorization&
PAYMENTREQUEST_0_PAYMENTREQUESTID=200001&
PAYERID=xxxxxxx&
VERSION=204&
PAYMENTREQUEST_0_AMT=25.00&
METHOD=DoExpressCheckoutPayment&
USER=xxxxxxx&
PWD=xxxxxxx&
SIGNATURE=xxxxxxx&
TOKEN=EC-2EP3671xxxxxxx
我得到了成功的回应;
TOKEN=EC-2EP3671xxxxxxx&
SUCCESSPAGEREDIRECTREQUESTED=false&
TIMESTAMP=xxxxxxx&
CORRELATIONID=xxxxxxx&
ACK=Success&
VERSION=204&
BUILD=26126731&
INSURANCEOPTIONSELECTED=false&
SHIPPINGOPTIONISDEFAULT=false&
PAYMENTINFO_0_TRANSACTIONID=0J23486xxxxxxx&
PAYMENTINFO_0_TRANSACTIONTYPE=expresscheckout&
PAYMENTINFO_0_PAYMENTTYPE=instant&
PAYMENTINFO_0_ORDERTIME=xxxxxxx&
PAYMENTINFO_0_AMT=25.00&
PAYMENTINFO_0_TAXAMT=0.00&
PAYMENTINFO_0_CURRENCYCODE=USD&
PAYMENTINFO_0_PAYMENTSTATUS=Pending&
PAYMENTINFO_0_PENDINGREASON=authorization&
PAYMENTINFO_0_REASONCODE=None&
PAYMENTINFO_0_PROTECTIONELIGIBILITY=Eligible&
PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE=ItemNotReceivedEligible,UnauthorizedPaymentEligible&
PAYMENTINFO_0_SELLERPAYPALACCOUNTID=xxxxxxx&
PAYMENTINFO_0_SECUREMERCHANTACCOUNTID=xxxxxxx&
PAYMENTINFO_0_PAYMENTREQUESTID=200001&
PAYMENTINFO_0_ERRORCODE=0&
PAYMENTINFO_0_ACK=Success
到目前为止一切都很好。但我现在需要进行第二次身份验证;
PAYMENTREQUEST_0_PAYMENTACTION=Authorization&
PAYMENTREQUEST_0_PAYMENTREQUESTID=200002&
PAYERID=xxxxxxx&
VERSION=204&
PAYMENTREQUEST_0_AMT=5.00&
METHOD=DoExpressCheckoutPayment&
USER=xxxxxxx&
PWD=xxxxxxx&
SIGNATURE=xxxxxxx&
TOKEN=EC-2EP3671xxxxxxx
..但不是执行身份验证,PayPal 似乎认为它是第一个身份验证的副本;
TOKEN=EC-2EP3671xxxxxxx&
SUCCESSPAGEREDIRECTREQUESTED=false&
TIMESTAMP=xxxxxxx&
CORRELATIONID=xxxxxxx&
ACK=SuccessWithWarning&
VERSION=204&
BUILD=26126731&
L_ERRORCODE0=11607&
L_SHORTMESSAGE0=Duplicate Request&
L_LONGMESSAGE0=A successful transaction has already been completed for this token.&
L_SEVERITYCODE0=Warning&
INSURANCEOPTIONSELECTED=false&
SHIPPINGOPTIONISDEFAULT=false&
PAYMENTINFO_0_TRANSACTIONID=0J23486xxxxxxx&
PAYMENTINFO_0_TRANSACTIONTYPE=expresscheckout&
PAYMENTINFO_0_PAYMENTTYPE=instant&
PAYMENTINFO_0_ORDERTIME=xxxxxxx&
PAYMENTINFO_0_AMT=25.00&
PAYMENTINFO_0_TAXAMT=0.00&
PAYMENTINFO_0_CURRENCYCODE=USD&
PAYMENTINFO_0_PAYMENTSTATUS=Pending&
PAYMENTINFO_0_PENDINGREASON=authorization&
PAYMENTINFO_0_REASONCODE=None&
PAYMENTINFO_0_PROTECTIONELIGIBILITY=Eligible&
PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE=ItemNotReceivedEligible,UnauthorizedPaymentEligible&
PAYMENTINFO_0_SELLERPAYPALACCOUNTID=xxxxxxx&
PAYMENTINFO_0_SECUREMERCHANTACCOUNTID=xxxxxxx&
PAYMENTINFO_0_PAYMENTREQUESTID=200001&
PAYMENTINFO_0_ERRORCODE=0&
PAYMENTINFO_0_ACK=Success
交易 id 和金额与对第一个身份验证的响应中的相同。我如何在没有 PayPal 认为它们重复相同的情况下进行多次授权?我对流程的理解不正确吗?如果是这样,什么是必要的流程?