3

Amazonペイメントで注文を承認する際、顧客がAmazonペイメントにログインして支払い方法を変更する必要がある場合、理由Declinedとして承認ステータスが戻る場合があります。InvalidPaymentMethod

InvalidPaymentMethodテストのためにAmazonにこのケースを再現させるにはどうすればよいですか?

4

1 に答える 1

4

ああ、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
        ]])
    ]);
}
于 2015-04-22T10:16:21.460 に答える