微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

php – PayPal CreateRecurringPaymentProfile错误11502 – 无效令牌

我正在使用PayPal的API设置定期付款.首先,我将以下参数发送到SetExpressCheckout:

Array
(
    [METHOD] => SetExpressCheckout
    [USER] => XXX
    [PWD] => XXX
    [SIGNATURE] => XXX
    [VERSION] => 98.0
    [AMT] => 0
    [MAXAMT] => 99.00
    [RETURNURL] => http://google.com
    [CANCELURL] => http://google.com
    [L_BILLINGTYPE0] => RecurringPayments
    [L_BILLINGAGREEMENTDESCRIPTION0] => 99.00 per month till stopped
)

这会生成如下响应:

Array
(
    [TOKEN] => EC-90P39652RF345525U
    [TIMESTAMP] => 2013-02-08T17:09:24Z
    [ACK] => Success
    [VERSION] => 98.0
)

使用创建的计费协议中的描述和令牌,我将以下参数发送到CreateRecurringPaymentsProfile:

Array
    (
    [METHOD] => CreateRecurringPaymentsProfile
    [USER] => XXX
    [PWD] => XXX
    [SIGNATURE] => XXX
    [TOKEN] => EC-90P39652RF345525U
    [PROFILESTARTDATE] => Feb 22 2013 17:09:24
    [DESC] => 99.00 per month till stopped
    [BILLINGPERIOD] => Month
    [BILLINGFREQUENCY] => 12
    [AMT] => 99.00
    [CURRENTCYCODE] => USD
    [CREDITCARDTYPE] => VISA
    [ACCT] => 1234123412341234
    [EXPDATE] => 012014
    [CVV2] => 123
    [EMAIL] => fake@example.com
    [STREET] => 123 Main St
    [CITY] => New York City
    [STATE] => NY
    [COUNTRYCODE] => US
    [ZIP] => 12345
)

一切看起来都很好,但它失败了:

Array
(
    [TIMESTAMP] => 2013-02-08T17:09:24Z
    [ACK] => Failure
    [VERSION] => 98.0
    [L_ERRORCODE0] => 11502
    [L_SHORTMESSAGE0] => Invalid Token
    [L_LONGMESSAGE0] => The token is invalid
    [L_SEVERITYCODE0] => Error
)

任何帮助是极大的赞赏!

解决方法:

调用CreateRecurringPaymentsProfile之前,您需要将买方重定向到PayPal以批准定期付款.两个API响应的时间戳都是相同的,这告诉我,一旦您收到SetExpressCheckout的响应,就会调用CreateRecurringPaymentsProfile.从SetExpressCheckout收到回复后,您需要将买家重定向到PayPal.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐