Working with Amazon Simple Pay Buttons

This section provides task-oriented descriptions of how to create Amazon Simple Pay buttons, and how to use and implement Amazon Flexible Payments Service (FPS) actions. For a description of Amazon FPS actions that are appropriate to use with Amazon Simple Pay, see the API Reference.

Common Amazon Simple Pay Tasks

The following table explains how you can find the information you need in this guide.

If you want to... Relevant Sections

Learn the basics of Amazon Simple Pay

Overview

Key concepts

Amazon Simple Pay Getting Started Guide

Learn how to create a signed button of any typeCreating Button Forms Dynamically
Modify the sample code to create a standard, donation, marketplace, or subscription buttonUnderstanding the Amazon Simple Pay Button Samples

Use the response and transaction content returned by your buttons and by Amazon Payments

Handling Return Content

Validate responses for the Return URL and Instant Payment Notification

Verifying the ReturnURL and IPN Notifications

Understanding the IPNAndReturnURLValidation Sample

Understand subscription button particulars

Working with Subscription Buttons

Use Amazon Flexible Payments Service actions available with Amazon Simple Pay

API Reference

Use Instant Payment Notification (IPN)

Using Instant Payment Notification, How to Verify the IPN Signature and Verifying the IPN

Settle or refund money

How to Settle and Refund Transactions Programmatically

Work with signatures

Creating Button Forms Dynamically, How to Generate a Signature, and About Signature Version 2.

Get sample code for signing buttons, verifying return data, and generating a button request

Appendix: Sample Code

Testing Your Applications in the Amazon Payments Sandbox

The Amazon Simple Pay Getting Started Guide describes accessing the Amazon Payments business account sandbox and provides an overview of its features. For more information about the sandbox, go to https://payments-sandbox.amazon.com.

Amazon Payments Sandbox

With the Amazon Payments developer sandbox you can test the more advanced features of your button applications.

[Note]Note

You cannot port the code for the buttons you create in the sandbox to the production environment. When you are satisfied that your button works correctly in the sandbox, make careful notes and recreate it in the production environment. For best results, test the button again in the production environment.

The Amazon Payments developer sandbox enables you to try the following:

  • Use credit cards and bank accounts in your test transactions without any prior verification and without incurring charges.

  • Simulate certain errors, such as temporary declines, that could appear in a real transaction. This simulation can help you test the error handling capabilities in your application.

You can test the following user experiences in the sandbox:

  • View changes to the test account balance from test button operations you generate

  • View the transaction activity updates from test button operations you generate

The Amazon Simple Pay Getting Started Guide has instructions on testing basic button features using the Amazon Payments business sandbox.

Testing Button Signatures

You can easily test your signature creation code using any of the examples in Amazon Simple Pay Button Input Reference. Each example contains a signature calculated from the values in the rest of the example.

To test a signature

  1. Copy any one of the HTML examples in Amazon Simple Pay Button Input Reference.

  2. Remove the enclosing FORM element from your copy.

  3. Remove the Signature field and the HTML comments from your copy.

  4. Create a signature using the instructions in How to Generate a Signature

  5. Compare the output from your signature creation code with the value you removed from the HTML example. They should be identical.

Creating a Test Account Balance

When using the Amazon Payments developer sandbox, you can use a test account for payment simulations.

To create a test account balance

  1. Log in to payments-sandbox.amazon.com with your username and password.

  2. On the Your Account tab, click Add a Bank Account in the Enhance your account area.

  3. Provide following test information

    • Routing#: 123456789

    • Account#: 11122233344

    • Driver license: 123; WA

  4. Add the bank account

  5. On the Deposit tab, use the deposit form to add money to your account.

  6. Click the Your Account tab. Your balance will be displayed.

Forcing Error Conditions

In the Amazon Payments developer sandbox, you can force an error by placing certain decimal values in the amount. The following table details the values.

Force ConditionError ForcedSimulation
The amount includes a decimal value between .60 and .69Temporary DeclineOccurs when a downstream process is not available.
The amount includes a decimal value between .70 and .89.Payment ErrorInsufficient funds

[Note]Note

If you want your test transaction to be a success, avoid using amount values which contain decimal values between .60 and .89. For example, the following amounts all force errors: 0.61, 123.6522, 1.79. The following amounts do not force an error: 0.16, 123.56, 8.97.