3

When authorizing an order on Amazon Payments, the authorization status may come back as Declined with InvalidPaymentMethod as the reason, if the customer has to login to Amazon Payments and change payment method.

How to force Amazon to reproduce this InvalidPaymentMethod case for testing?

Sheepy
  • 17,324
  • 4
  • 45
  • 69
Michael Czolko
  • 2,698
  • 2
  • 15
  • 25
  • I think you're gonna have to add a little more detail to your question, perhaps include some code of where you will need said function? – Epodax Apr 22 '15 at 10:09
  • Kindly get in contact with Amazon Payments for this and sort it out with them. There are certain attributes in PCI compliance, etc for which they may send data or may not – Preeti Maurya Apr 22 '15 at 10:10
  • Sorry, I've found answer already – Michael Czolko Apr 22 '15 at 10:16
  • Please keep the question simple and try to write in third person to focus on the issue. Spiting it into context and problem may helps. – Sheepy Apr 22 '15 at 11:20

1 Answers1

4

Oh, RTM... I found the answer in the Integration Guide. When you make the Authorize call, you have to specify SellerAuthorizationNote:

{"SandboxSimulation": {
     "State":"Declined",
     "ReasonCode":"InvalidPaymentMethod",
     "PaymentMethodUpdateTimeInMins":5}}

Leaving question here for developers integrating this payment method.

This is what the final method looks like:

/**
 * @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
        ]])
    ]);
}
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
Michael Czolko
  • 2,698
  • 2
  • 15
  • 25