Paypal GetExpressCheckoutDetails 缺少 PAYERID
Posted
技术标签:
【中文标题】Paypal GetExpressCheckoutDetails 缺少 PAYERID【英文标题】:Paypal GetExpressCheckoutDetails missing PAYERID 【发布时间】:2014-02-07 08:55:04 【问题描述】:(见https://developer.paypal.com/docs/integration/direct/identity/seamless-checkout/)
-
我们通过 OpenID(使用 PayPal 登录)登录用户并接收访问令牌。
我们调用 SetExpressCheckout 提供 IDENTITYACCESSTOKEN
我们调用 GetExpressCheckoutDetails 并期望填充 PAYERID。它在响应中不存在。
如果没有 PAYERID,我无法调用 DoExpressCheckoutPayment。
我在下面附上了请求/响应数据。 请注意,GetExpressCheckoutDetails 不包含 PAYERID。 为什么会发生这种情况?
谢谢!
SetExpressCheckout Request:
array (size=23)
'METHOD' => string 'SetExpressCheckout' (length=18)
'PAYMENTREQUEST_0_ITEMAMT' => string '329.00' (length=6)
'PAYMENTREQUEST_0_AMT' => string '329.00' (length=6)
'PAYMENTREQUEST_0_TAXAMT' => string '0.00' (length=4)
'PAYMENTREQUEST_0_SHIPPINGAMT' => string '0.00' (length=4)
'PAYMENTREQUEST_0_CURRENCYCODE' => string 'USD' (length=3)
'RETURNURL' => string 'https://some.url/' (length=39)
'CANCELURL' => string 'https://some.url/' (length=25)
'VERSION' => string '106.0' (length=5)
'USER' => string 'secure-paypal_api1.somedomain.com' (length=30)
'PWD' => string 'XXXXXXXXXXXXXXXXX' (length=16)
'SIGNATURE' => string 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' (length=56)
'NOSHIPPING' => string '1' (length=1)
'PAYMENTREQUEST_0_PAYMENTACTION' => string 'Sale' (length=4)
'HDRIMG' => string 'https://www.some.url/.jpg' (length=70)
'EMAIL' => string 'foo@foo.com' (length=23)
'CUSTOMERSERVICENUMBER' => string '1-111-111-1111' (length=14)
'ALLOWNOTE' => string '0' (length=1)
'IDENTITYACCESSTOKEN' => string '2nd3CS9HG1EWzTQGy6l.4n7CsilVWgkqn20bTuUfSXX' (length=43)
'L_PAYMENTREQUEST_0_NAME0' => string 'or3333' (length=6)
'L_PAYMENTREQUEST_0_AMT0' => string '329.00' (length=6)
'L_PAYMENTREQUEST_0_DESC0' => string 'Product name foobar' (length=31)
'L_PAYMENTREQUEST_0_QTY0' => string '1' (length=1)
SetExpressCheckout Response:
array (size=6)
'TOKEN' => string 'EC-4W147554UR614711B' (length=20)
'TIMESTAMP' => string '2014-01-17T20:41:50Z' (length=20)
'CORRELATIONID' => string '4ef48694990' (length=11)
'ACK' => string 'Success' (length=7)
'VERSION' => string '106.0' (length=5)
'BUILD' => string '9285531' (length=7)
GetExpressCheckoutDetails Request:
array (size=6)
'METHOD' => string 'GetExpressCheckoutDetails' (length=25)
'TOKEN' => string 'EC-4W147554UR614711B' (length=20)
'VERSION' => string '106.0' (length=5)
'USER' => string 'secure-paypal_api1.sylvane.com' (length=30)
'PWD' => string 'XXXXXXXXXXXXXXXX' (length=16)
'SIGNATURE' => string 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' (length=56)
GetExpressCheckoutDetails Response:
array (size=44)
'TOKEN' => string 'EC-4W147554UR614711B' (length=20)
'CHECKOUTSTATUS' => string 'PaymentActionNotInitiated' (length=25)
'TIMESTAMP' => string '2014-01-17T20:41:50Z' (length=20)
'CORRELATIONID' => string '605766387f780' (length=13)
'ACK' => string 'Success' (length=7)
'VERSION' => string '106.0' (length=5)
'BUILD' => string '9285531' (length=7)
'CURRENCYCODE' => string 'USD' (length=3)
'AMT' => string '329.00' (length=6)
'ITEMAMT' => string '329.00' (length=6)
'SHIPPINGAMT' => string '0.00' (length=4)
'HANDLINGAMT' => string '0.00' (length=4)
'TAXAMT' => string '0.00' (length=4)
'INSURANCEAMT' => string '0.00' (length=4)
'SHIPDISCAMT' => string '0.00' (length=4)
'L_NAME0' => string 'or2395' (length=6)
'L_QTY0' => string '1' (length=1)
'L_TAXAMT0' => string '0.00' (length=4)
'L_AMT0' => string '329.00' (length=6)
'L_DESC0' => string 'Product name foobar' (length=31)
'L_ITEMWEIGHTVALUE0' => string ' 0.00000' (length=10)
'L_ITEMLENGTHVALUE0' => string ' 0.00000' (length=10)
'L_ITEMWIDTHVALUE0' => string ' 0.00000' (length=10)
'L_ITEMHEIGHTVALUE0' => string ' 0.00000' (length=10)
'PAYMENTREQUEST_0_CURRENCYCODE' => string 'USD' (length=3)
'PAYMENTREQUEST_0_AMT' => string '329.00' (length=6)
'PAYMENTREQUEST_0_ITEMAMT' => string '329.00' (length=6)
'PAYMENTREQUEST_0_SHIPPINGAMT' => string '0.00' (length=4)
'PAYMENTREQUEST_0_HANDLINGAMT' => string '0.00' (length=4)
'PAYMENTREQUEST_0_TAXAMT' => string '0.00' (length=4)
'PAYMENTREQUEST_0_INSURANCEAMT' => string '0.00' (length=4)
'PAYMENTREQUEST_0_SHIPDISCAMT' => string '0.00' (length=4)
'PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED' => string 'false' (length=5)
'PAYMENTREQUEST_0_ADDRESSNORMALIZATIONSTATUS' => string 'None' (length=4)
'L_PAYMENTREQUEST_0_NAME0' => string 'or3333' (length=6)
'L_PAYMENTREQUEST_0_QTY0' => string '1' (length=1)
'L_PAYMENTREQUEST_0_TAXAMT0' => string '0.00' (length=4)
'L_PAYMENTREQUEST_0_AMT0' => string '329.00' (length=6)
'L_PAYMENTREQUEST_0_DESC0' => string 'Product name foobar' (length=31)
'L_PAYMENTREQUEST_0_ITEMWEIGHTVALUE0' => string ' 0.00000' (length=10)
'L_PAYMENTREQUEST_0_ITEMLENGTHVALUE0' => string ' 0.00000' (length=10)
'L_PAYMENTREQUEST_0_ITEMWIDTHVALUE0' => string ' 0.00000' (length=10)
'L_PAYMENTREQUEST_0_ITEMHEIGHTVALUE0' => string ' 0.00000' (length=10)
'PAYMENTREQUESTINFO_0_ERRORCODE' => string '0' (length=1)
【问题讨论】:
【参考方案1】:即使您在 SetExpressCheckout 调用中传递了IDENTITYACCESSTOKEN
,您仍然需要将买家重定向到 PayPal,以便他们可以批准付款。设置IDENTITYACCESSTOKEN
允许买家跳过登录页面,使他们的流程更快,但他们仍然需要前往 PayPal 批准付款。进行 SetExpressCheckout 调用后,将它们重定向到 https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=token
(其中 token
是来自 SetExpressCheckout 响应的 TOKEN
的值)。
【讨论】:
以上是关于Paypal GetExpressCheckoutDetails 缺少 PAYERID的主要内容,如果未能解决你的问题,请参考以下文章