【问题标题】:10002 Security header is not valid error when calling DoCapture in live mode10002 在实时模式下调用 DoCapture 时,安全标头无效错误
【发布时间】:2014-03-19 12:33:26
【问题描述】:

我需要一些有关 Paypal 快速结帐的帮助。这是我的情况 - 我可以做到:SetExpressCheckout,DoExpressCheckout 成功 - 但我无法通过 DoCapture 捕获授权金额。这是错误“10002 安全标头无效”。请注意,这只发生在实时模式下,它在沙盒模式下运行良好。

请帮忙。谢谢陈

【问题讨论】:

  • 应该是因为沙箱遗漏了API凭证或者API凭证不正确
  • 感谢您的回答,但在发布问题之前我已经搜索过这个问题。它可以毫无问题地执行 SetExpressCheckout、DoExpressCheckout,但在 DoCapture 时不行。还有其他想法吗?
  • 你能给我带有贝宝电子邮件地址的快速结帐令牌吗?
  • 我可以给你交易ID吗?如果是,这里是一个 7X304177H9196134E。感谢您的支持
  • 这里的一切看起来都不错。 Doexpresscehckout 已成功完成。你能再试一次吗?如果你可以分享你的代码,可能会?

标签: paypal


【解决方案1】:

做完DoExpressCheckoutPayment获取授权ID并在DoCapture中使用

Endpoint URL: https://api-3t.sandbox.paypal.com/nvp
HTTP method: POST
POST data:
USER=merchant_user_name
&PWD=merchant_password
&SIGNATURE=merchant_signature
&METHOD=DoExpressCheckoutPayment
&VERSION=95
&TOKEN=EC-470284976K7901234    #Token from the SetExpressCheckout response
&PAYERID=3TXTXECKFU1234    #Customer account ID, from the GetExpressCheckoutDetails response
&PAYMENTREQUEST_0_PAYMENTACTION=Authorization    #Enables you to collect payment in the future
&PAYMENTREQUEST_0_AMT=1
&PAYMENTREQUEST_0_CURRENCYCODE=USD

回应

--------
TOKEN=EC%2d470284976K7901234
&ACK=Success
&VERSION=95
&PAYMENTINFO_0_TRANSACTIONID=20K92515TX2901234    #Use this value as the authorization ID in a DoCapture request
&PAYMENTINFO_0_SECUREMERCHANTACCOUNTID=QJSRDC4JW1234
&PAYMENTINFO_0_ACK=Success

...

DoCapture调用

请求

Endpoint URL: https://api-3t.sandbox.paypal.com/nvp
HTTP method: POST
POST data:
USER=merchant_user_name
&PWD=merchant_password
&SIGNATURE=merchant_signature
&METHOD=DoCapture
&VERSION=95
&AUTHORIZATIONID=20K92515TX2901234    #Authorization ID. Specify the value of PAYMENTINFO_0_TRANSACTIONID from the DoExpressCheckoutPayment response)
&AMT=1    #The amount of the payment
&CURRENCYCODE=USD
&COMPLETETYPE=Complete    #Indicates that for the authorization specified, this is the last payment capture 

响应

AUTHORIZATIONID=20K92515TX2901234
&ACK=Success
&TRANSACTIONID=2KF46316MJ7751234    #New transaction ID for this payment
&PARENTTRANSACTIONID=20K92515TX2901234    #Same as the ID of the original authorization
&TRANSACTIONTYPE=expresscheckout
&PAYMENTTYPE=instant
&AMT=1%2e00
&FEEAMT=0%2e33
&TAXAMT=0%2e00
&CURRENCYCODE=USD
&PAYMENTSTATUS=Completed
...

参考https://developer.paypal.com/docs/classic/express-checkout/ht_ec-singleAuthPayment-curl-etc/

【讨论】:

    猜你喜欢
    • 2014-04-05
    • 2015-07-01
    • 2014-06-09
    • 2013-10-23
    • 1970-01-01
    • 2016-07-15
    • 2017-08-23
    • 2018-05-14
    • 2014-06-15
    相关资源
    最近更新 更多