Gracias por tu visita. Esta página solo está disponible en inglés.

Step 5: Validate the billing agreement

Authorizing determines if the payment instrument is valid, so if you plan to authorize the payment, you can skip this step.

As an optional step, you can validate the payment method chosen by the buyer and the status of the billing agreement by calling the ValidateBillingAgreement operation before you show the thank-you page to the buyer. Doing this ensures that the payment method that the buyer chose is valid at that time and will reduce the likelihood of payment failure when you try to charge the buyer at a later point in time.

The following example shows how to call the ValidateBillingAgreement operation: 

The ValidateBillingAgreement operation returns a Success or Failure value as a part of the ValidationResult parameter. If Failure is returned, you also receive a reason code. Here are suggestions to handle the various reason codes:

  • InvalidPaymentMethod indicates that the payment method that the buyer chose is not valid (for example, it has expired, has an invalid billing address, and so on). In this case, the Billing Agreement object also moves to the Suspended state and any AuthorizeOnBillingAgreement operation is declined. You should ask the buyer to update the payment method associated with the BillingAgreement object by following the same process as described in Step 7: Prepare to handle declined authorizations.
  • ValidationTimedOut indicates that Amazon Pay cannot validate the billing agreement within a few seconds and you will receive the Failure ValidationResult. We suggest that you retry this request after some time. If the request is unsuccessful after a few retries, it is likely that there is an issue with the buyer's payment method. Ask the buyer to update the payment method from the Amazon Pay website or your website and then retry the request.