哦,RTM……我在集成指南中找到了答案。当您拨打 Authorize 电话时,您必须指定 SellerAuthorizationNote:
{"SandboxSimulation": {
"State":"Declined",
"ReasonCode":"InvalidPaymentMethod",
"PaymentMethodUpdateTimeInMins":5}}
在这里为集成此付款方式的开发人员留下问题。
这是最终方法的样子:
/**
* @param string $orderReferenceId
* @param string $authorizationReferenceId
* @param float $amount
* @param string $currencyCode
* @return \OffAmazonPaymentsService_Model_AuthorizeResponse
*/
private function authorizeOrder($orderReferenceId, $authorizationReferenceId, $amount, $currencyCode)
{
return $this->getClient()->authorize([
'SellerId' => $this->serviceCrendentials['merchantId'],
'AmazonOrderReferenceId' => $orderReferenceId,
'AuthorizationReferenceId' => $authorizationReferenceId,
'AuthorizationAmount' => [
'Amount' => $amount,
'CurrencyCode' => $currencyCode
],
// Delete it, it's just for sandbox testing
'SellerAuthorizationNote' => json_encode(['SandboxSimulation' => [
'State' => 'Declined',
'ReasonCode' => 'InvalidPaymentMethod',
'PaymentMethodUpdateTimeInMins' => 5
]])
]);
}