Order & payment workflow

The Login and Pay with Amazon extension follows the standard Magento order and payment workflow, and thus processing Pay with Amazon payments doesn’t differ significantly from other payment methods available in Magento, making it easy to handle. The most important difference, comparing to the standard Magento orders, is delayed access to the billing address, which is backfilled later in the synchronization process after the successful authorization.

All Amazon payment objects (OrderReference, Authorize, Capture and Refund) are reflected in corresponding payment transactions in Magento, which are connected with appropriate document entities provided by the Magento, (invoices for captures, credit memos for refunds).

Pay with Amazon button

The Pay with Amazon button appears in several places in the shop:

  • on the shopping cart page,
  • in the 1st step of the default One Page Checkout,
  • in the sidebar cart widget.

You can also place the Pay with Amazon button in any place you like by including following statement in the template file:

<?php echo Mage::helper('amazonpayments')->getPayWithAmazonButton(); ?>

Pressing the Pay with Amazon button launches the Amazon Payments authentication window, where the customer is asked for his Amazon account e-mail address and password. After a successful login the customer is redirected to the Amazon checkout page in your shop.


Placing an order

The Pay with Amazon checkout form consists of 4 steps arranged within a single page (unlike Magento default checkout, which uses accordion for showing and hiding particular steps of the checkout). These steps are: shipping address (handled by Amazon’s address book widget), payment method (handled by Amazon’s wallet widget), shipping method and order review (handled by default Magento checkout templates). All fields in the form (shipping address, payment method and shipping method) are pre-filled, which means that in very basic scenario customer can finish the checkout with just one click. Unfortunately, pre-filling doesn’t apply to the terms and conditions checkbox (if used at all) and can raise the number of required clicks, which, however, doesn’t affect the easiness and user-friendliness of the Pay with Amazon payment method.


The value selected in each checkout step is saved in a separate AJAX call. When the checkout form shows up for the first time, depending on the internet connection speed and the web-server’s response time, it may take up to few seconds until Place order button will be active and can be clicked by the customer.

After selecting the desired shipping address, payment method, shipping method and pressing Place order button (preceded by accepting terms and conditions if needed), the customer is redirected to the success page. Pay with Amazon uses the default Magento success page, which means there’s no need to add any tracking scripts or additional page layout elements that you use in default Magento checkout and want also use in Amazon checkout, all features implemented additionally on the Magento success page shall also appear on Amazon checkout success page.


The created order will be transferred to Amazon and will appear in your Magento admin in Pending state.


You may notice in the Magento admin that the billing address may be incorrect at this point (as mentioned in the introduction to this chapter). That’s true if the billing differs from the shipping data. The only available payment object at the time of placing order is the OrderReference, which, unfortunately, doesn’t provide billing data and thus shipping address must be used to meet Magento requirements concerning order data. The billing address will be updated as soon as authorization is confirmed by Amazon Payments. Keep also in mind that the billing address is available only for the sellers that provided a valid VAT number in Amazon Seller Central.

Payment authorization

An authorization can be requested after the order data is successfully transferred to Amazon. Depending on the value you’ve selected for Payment Action option it can be processed in several ways. For Authorize and Authorize & capture actions it will be requested automatically as soon as order is placed in your shop and successfully transferred to Amazon. The requested authorization will be therefore either confirmed or declined by Amazon either via IPN message or via data polling, see Synchronizing order data to get more details. The order, for which a payment authorization has been confirmed changes its state to Processing, an order email confirmation is sent to the customer (if not disabled in the extension settings, see Send order confirmation) and you can start the fulfilment process.


Never dispatch ordered items before the authorization is confirmed. Only the confirmed authorization guarantees that you will be able to capture the order amount (if you capture within 7 days).

Manual authorization

In case you ship ordered items after 30 days or more you have to select Manual authorization as a payment action. It will stop Magento from requesting an authorization automatically and let you make an authorization request manually from the Magento admin at any suitable time. To manually invoke an authorization, login to the Magento admin, open the order you want authorize payment for and click the Authorize payment button placed in the top buttons rows.


Next post-request processing (authorization confirmation or decline) is processed in the same way as in automatic authorization (through polling or IPN).

Declined authorizations

If the authorization is declined by Amazon due to problem with the payment method selected, your customer will be informed about this case via e-mail and requested to visit the Amazon Payments web site. The customer can on this page update the payment method by following the instructions on the web page. The e-mail sent to the customer can be adjusted according to the Email templates section. After the successful payment method update, Amazon will notify Magento about the new authorization status and payment will get back on the track (via polling or IPN).

In case the authorization has been declined due to any other reason then problems with the selected payment method, the notification email will be sent to shop administrator and appropriate action must be undertaken according to the Amazon Payments Integration Guide.

Capturing the payment amount

After a successful authorization, you can capture funds against the authorization. The capture, similar to the authorization, can be requested in two modes: manual and automatic. By default you should capture the order amount at the moment you ship the ordered items by creating an invoice. You are only allowed to enable automatic capture if you sell digital goods or you ship items the same day they are ordered. Moreover you have to be white-listed by Amazon Payments. Contact Amazon Payments if you want to use this option.

Payment Action option in the extension settings allows to switch between manual and automatic capture mode. For Manual authorization & Authorization actions the capture is triggerd by creating manually an invoice for the order in the Magento admin. For Authorize & capture action, the capture is requested automatically as soon as authorization is confirmed by Amazon Payments.

Manual capture

To capture the order amount, you must create an invoice first. To create an invoice, login to the Magento admin, open the order for which you want to capture the amount and click the Invoice button located in the top buttons rows. Please make sure that the order you want to process has been successfully authorized, which basically means that it is in Processing state.


After clicking the Invoice button, a new invoice form will appear with most of the crucial data (like products quantity) already filled in. You can adjust some invoice fields if needed. At this point you can create a shipment as well, by checking Create Shipment checkbox and adding a tracking number if needed. Before submitting the form, please make absolutely sure that Amount selectbox is set to Capture online and press Submit Invoice button. A new invoice and a new shipment (if checked Create Shipment checkbox) will be created for the order and the capture request is sent to Amazon Payments.



To collect the funds that were authorized, you must capture the amount within 30 days of a successful authorization (two days in Sandbox mode). We strongly recommend that you capture funds within seven days of authorization to reduce the likelihood of declines (within 7 days the a successful captures is guaranteed). In case your fulfilment process exceeds 30 days, consider using the Manual authorization as payment action in the configuration and authorize the payment later in any suitable time (typically in the week before the shipping) before the shipping.


Partial captures are not supported by the extension at this moment.

The capture status, similar to authorizations, will be updated either via IPN message or via data polling, see Synchronizing order data for more details.

Automatic capture

In this mode the capture is requested automatically after the successful authorization. Also the invoice that covers all ordered items is created automatically. Post-request processing (capture status synchronization) is carried the same way as in capture invoked manually from Magento backend.

Refunding order items

The order, which payment has been captured for, can be refunded either fully or partially. Refunds are made against the invoices and thus having a paid invoice assigned to the order is a necessary condition that has to be met to refund any order item. Refunds in Magento are recorded as credit memos, so for requesting a refund with Amazon Payments you should create a credit memo first. To create a credit memo login to the Magento admin, open the order you want refund, click Invoices tab on the right, select an invoice you want to refund and click on it.


A preview of the selected invoice will appear. Make sure that you are on the single invoice preview page and click the Credit Memo button.


A new credit memo form will appear with most of the crucial data (like products quantity to be refunded) already filled in. If you want to refund the invoice partially (i.e. only a part of the invoiced items) adjust the product quantities to be refunded (set 0 for items that shall not be refunded) and click Update Qty’s button to update refund totals. You can also set the refunded items back to stock by checking Return to Stock checkbox. Next choose if you want to refund shipping costs or apply any refunds adjustment and fill in the appropriate fields. Next before submitting the credit memo form, double check that you have Refund button available and click it. A credit memo will be created and a refund will be requested with Amazon Payments. Its status will be updated either via IPN or data polling, depending on the update method selected in the extension settings.



For the successful refund (recorded in Magento and requested (!) with Amazon Payments) always use Refund button available on the new credit memo form invoked from the single invoice preview page. If you click Credit Memo button directly on the order page you will be redirected to the new credit memo form with Refund offline button only, which admittedly will record credit memo in Magento, but surely won’t call refund request at Amazon Payments gateway. If in any case you will get a credit memo with Refund offline button only then surely something had to go wrong and you should stop the refund process immediately and start it from the beginning following the above guideline.

Cancelling an order

For a variety of reasons it sometimes becomes necessary to cancel an order. To cancel an order and notify Amazon about the payment cancellation:

  • Please make sure the amount of the order you want to cancel hasn’t been captured yet,
  • Go to Sales ‣ Orders and select the order that you would like to cancel by clicking the Edit button on its respective row,
  • Click Cancel in order page to remove this order.

Synchronizing order data