当我默认设置预批准详细信息(使用 SDK)时,它会将现在的日期作为开始日期,结束日期 + 10 天。
一旦我收到 PA Key,我就确认付款,并尝试执行 PAY Api。
但随后我得到以下响应:
[message] => The preapproval key can't be used before the start date or after the end date
这很奇怪,因为今天是 2012-11-09。机器正在使用 UTC 时间。
当我使用昨天的开始日期时,付款工作正常,尽管 DOCS 声明我不能那样使用它:
startingDate -
First date for which the preapproval is valid. It cannot be before today’s date or after the ending date.
附加信息:
PA 请求:
requestEnvelope.errorLanguage=en_US&cancelUrl=http://example.com/cancel&Preapproval.php¤cyCode=USD&endingDate=2012-11-19&maxNumberOfPayments=10&maxTotalAmountOfAllPayments=50.0&returnUrl=http://example.com/done&startingDate=2012-11-09&feesPayer=SENDER
PA 回复:
responseEnvelope.timestamp=2012-11-08T18%3A17%3A02.047-08%3A00&responseEnvelope.ack=Success&responseEnvelope.correlationId=a63f86411f2ba&responseEnvelope.build=4110101&preapprovalKey=PA-1AH67555CK6636515
最佳答案
哦,我认为这是因为您没有在开始/结束日期中设置时区。因此,如果我没记错的话——我认为默认情况下它使用太平洋时区(加利福尼亚)。
您可以使用 Zulu 或 GMT 偏移格式设置开始日期和结束日期。如以下各个示例所示: 2010-09-10Z 2010-09-10T17:24:03.874-07:00
关于 Paypal 预批日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13301230/