我正在尝试使用Paypal Expresscheckout结算协议ID测试参考交易。但我根本没有获得BAID。 以下是我正在制作的电话:
第1步:setExpresschecout调用:
Request
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp
HTTP method: POST
------------------------------------------------------------
POST data:
USER=insert_merchant_user_name_here
&PWD=insert_merchant_password_here
&SIGNATURE=insert_merchant_signature_value_here
&METHOD=SetExpressCheckout
&VERSION=93
&PAYMENTACTION=SALE # type of payment
&AMT=19.95 # amount of transaction
&CURRENCYCODE=USD # currency of transaction
&RETURNURL=<return_url> # URL of your payment confirmation page
&CANCELURL= <cancel_url> # URL redirect if customer cancels payment
&L_BILLINGTYPE0=MerchantInitiatedBilling
-------------------
Response
----------------------
token=EC-7NH28597U8423791A
-----------------------
它将我转到Paypal进行登录,点击“同意并付款”按钮后,使用令牌和付款人ID将我重定向回我的网站。由于我不需要存储客户详细信息,我正在跳过GetExpresschecout调用并直接使用令牌和PayedID调用doExpressCheckoutPayment。
STEP2:doExpresschecoutpayment
USER=insert_merchant_user_name_here
&PWD=insert_merchant_password_here
&SIGNATURE=insert_merchant_signature_value_here
&METHOD=DoExpressCheckoutPayment
&VERSION=93
&PAYMENTACTION=SALE # type of payment
&AMT=19.95 # amount of transaction
&CURRENCYCODE=USD # currency of transaction
&TOKEN=token_value
&PAYERID=payer_id_received
以下是回复。但它没有BILLING协议ID。
{"map":{"PAYMENTINFO_0_REASONCODE":"None","PAYMENTINFO_0_TAXAMT":"0.00","PAYMENTINFO_0_SECUREMERCHANTACCOUNTID":"KLQ6JKXB6DPZ6","TRANSACTIONID":"96C270379E2177052","PAYMENTINFO_0_TRANSACTIONTYPE":"expresscheckout","AMT":"11.20","PAYMENTINFO_0_FEEAMT":"0.62","CORRELATIONID":"fa14c423b7813","SUCCESSPAGEREDIRECTREQUESTED":"false","TAXAMT":"0.00","PAYMENTINFO_0_CURRENCYCODE":"USD","PAYMENTINFO_0_TRANSACTIONID":"96C270379E2177052","PENDINGREASON":"None","PAYMENTINFO_0_PAYMENTTYPE":"instant","VERSION":"98.0","PAYMENTINFO_0_PENDINGREASON":"None","FEEAMT":"0.62","ACK":"Success","TRANSACTIONTYPE":"expresscheckout","TOKEN":"EC-7NH28597U8423791A","PAYMENTINFO_0_ERRORCODE":"0","BUILD":"5956203","PAYMENTINFO_0_ORDERTIME":"2013-05-12T12:55:48Z","PAYMENTINFO_0_PROTECTIONELIGIBILITY":"Eligible","INSURANCEOPTIONSELECTED":"false","ORDERTIME":"2013-05-12T12:55:48Z","PAYMENTSTATUS":"Completed","PAYMENTINFO_0_AMT":"11.20","PAYMENTINFO_0_PAYMENTSTATUS":"Completed","REASONCODE":"None","PAYMENTTYPE":"instant","PAYMENTINFO_0_ACK":"Success","PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE":"ItemNotReceivedEligible,UnauthorizedPaymentEligible","SHIPPINGOPTIONISDEFAULT":"false","TIMESTAMP":"2013-05-12T12:55:48Z","PROTECTIONELIGIBILITY":"Eligible","CURRENCYCODE":"USD"}}
FYI..paymentaction设置为SALE,因为我需要获取付款。
关于出了什么问题的任何建议?
谢谢, Punya
答案 0 :(得分:2)
您需要运行CreateBillingAgreement API才能获得BAID。 这应该在您从SetExpressCheckout API获得EC令牌后完成。
应在您的帐户中启用P.S参考交易。
答案 1 :(得分:1)
您需要使用“GetExpressCheckout”来查看他们是否接受了结算协议。
您还需要联系PayPal,并特别要求为您的商家帐户启用“结算协议”和随后的“参考交易”。