Amazon Simple Pay
Getting Started Guide (API Version 2010-08-28)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

Creating a Standard Button

Amazon Simple Pay standard buttons can be used to sell physical goods, digital content, or services for immediate payment.

In this section you learn how to create an Amazon Simple Pay standard button and insert it on your web page.

How to Generate the HTML for a Standard Button

The following procedure guides you through generating the HTML for a standard button.

[Important]Important

We strongly recommend that you create and test all of your requests in the sandbox before exposing them on your website. For more information, see Testing Your Simple Pay Buttons

[Note]Note

You can set several of the fields in the form to default values using your seller preferences. For more information, see Configuring Default Button Values.

To generate the HTML for a standard button

  1. Go to http://payments.amazon.com and log into your Amazon Payments Business Account. For more information on your Amazon Payments Business Account, see Before You Begin.

  2. From here, go to https://payments.amazon.com/sdui/sdui/standardbutton to show the Amazon Simple Pay > Standard page, which contains the following form for you to fill in.

    [Note]Note

    To create a button in the sandbox, go to https://payments-sandbox.amazon.com/sdui/sdui/standardbutton instead.

  3. Use the following table to fill in the entry fields that are shown in the figure.

    [Tip]Tip

    You can also hold the mouse pointer over most fields of the online form to display usage tips in the right side of the form.

    FieldAction
    Amount

    Enter the amount you want to collect for the item.

    Corresponds to the amount field in the button html.

    Description

    Enter a description of the item.

    Corresponds to the description field in the button html.

    Reference

    Optionally enter an ID that uniquely identifies this transaction for your records.

    Corresponds to the referenceId field in the button html.

    Return URL

    Optionally enter the URL where buyers should be redirected after they complete the transaction.

    This field overrides the setting in Your Account > Edit My Account Settings > Manage Developer and Seller Preferences, as described in How to Configure Default Button Values..

    Corresponds to the returnUrl field in the button html.

    User Abandon URL

    Optionally, enter the URL where senders should be redirected if they cancel their transaction.

    Corresponds to the abandonUrl field in the button html.

    URL for Instant Payment Notification (IPN)

    Optionally, type the URL of your host page to which Amazon Payments should send the IPN transaction information. This is an advanced feature. For more information, see Using Instant Payment Notification.

    This field overrides the setting in Your Account > Edit My Account Settings > Manage Developer and Seller Preferences, as described in How to Configure Default Button Values..

    Corresponds to the ipnUrl field in the button html.

    Immediate Return

    Optionally, if you want to skip the final status page in Amazon Payments, select this check box. This is an advanced feature. If you select this option, you can parse the return values and display a final status page to the user yourself. For more information, see Using Immediate Return.

    Corresponds to the immediateReturn field in the button html.

    Collect the shipping address?

    If you want Amazon Payments to return the buyer's shipping address as part of the transaction information, select this check box.

    Corresponds to the collectShippingAddress field in the button html.

    Do you want to settle immediately?

    This is an advanced feature. For more information, see Settling Immediately.

    Corresponds to the processImmediate field in the button html.

    Your website background

    Select the type of button background you need. The white option sets a white background. The color option produces a button with a transparent background (that is, your website theme colors will show).

    Button Type

    Select the button image that you want to appear on your website.

    Corresponds to the src attribute for the image in the button html.

  4. Click Generate HTML. Amazon Payments produces the application-specific HTML form for the standard button, and displays it in the text area underneath the Generate HTML button. Typical HTML for a standard button is shown in Standard Button HTML Components

    Copy the HTML and paste it in the appropriate page on your website. It will be displayed on the web page as a Pay Now button.

  5. When you have finished copying the generated HTML, you can clear the Amazon Simple Pay Standard Creation Page user interface by clicking the Create Another Widget button. The form clears, and you can create another standard button.

    [Note]Note

    You can continue to create as many standard buttons as you need using this procedure. However, if you plan to add more than one button to a single web page, there are implementation issues for you to consider. For more information, see Creating More than One Button per Page.

    [Important]Important

    You are notified each time a buyer starts a payment request. For more information, see Getting Notification about Your Payments.

You can begin using your new button immediately. However, Amazon recommends you test every button before deploying it to production. A testing environment, the Amazon Payments sandbox, is provided for you to test any of the button types. To learn how to test your buttons, see Testing Your Simple Pay Buttons

Standard Button HTML Components

Here is a sample of an HTML form generated for a standard button.

<form 
  action ="https://authorize.payments.amazon.com/pba/paypipeline"
  method ="POST">
  <input type ="hidden" name ="immediateReturn"
    value ="1">
  <input type ="hidden" name ="collectShippingAddress"
    value ="0">
  <input type ="hidden" name ="accessKey"
    value ="YourAccessKeyId">
  <input type ="hidden" name ="referenceId"
    value ="MyTransaction-001">
  <input type ="hidden" name ="amount"
    value ="USD 10">
  <input type ="hidden" name ="signature"
    value ="K2ryWe7s/0AHI0/PbuAveuUPksTefhmNCzDTold2VYA=">
  <input type ="hidden" name ="description"
    value ="pay for dinner">
  <input type ="hidden" name ="ipnUrl"
    value ="http://yourwebsite.com/instantpaymentnotification">
  <input type ="hidden" name ="returnUrl"
    value ="http://yourwebsite.com/success">
  <input type ="hidden" name ="processImmediate"
    value ="1">
  <input type ="hidden" name ="cobrandingStyle"
    value ="logo">
  <input type ="hidden" name ="abandonUrl"
    value ="http://yourwebsite.com/abandon">
  <input type ="image" 
    src ="https://authorize.payments.amazon.com/pba/images/SLPayNowWithLogo.png"
    border ="0">
  <input type ="hidden" name ="signatureVersion"
    value ="2">
  <input type ="hidden" name ="signatureMethod"
    value ="HmacSHA256">
</form>

Test Your Simple Pay Standard Button

Amazon Simple Pay provides a testing environment, the Amazon Payments Sandbox, for testing the buttons you create. Using the sandbox you can try out your applications without incurring charges or making purchases. We strongly recommend that you create and test all of your requests in the sandbox before exposing them on your website.

All the simple pay buttons are tested in the same way, and you can test a button whether you plan to use it in your website or not. To learn how to all test Amazon Simple Pay buttons, see Testing Your Simple Pay Buttons

Advanced Standard Button Features

Within this section, we present the following advanced topics in passing which are not required to implement basic features. Please refer to the sections following for detailed information.

In preceding procedure you worked with the features of the standard button that are quickest to build. There are many other features of Amazon Simple Pay and the Amazon Flexible Payments Service that can make your website more sophisticated and usable. Some of the topics which may be of interest to you are:

  • Customizing Amazon Simple Pay Buttons

  • Simulating Amazon Simple Pay Button Errors

  • Adding Amazon Simple Pay as an Additional Payment Option

  • Programmatic APIs for canceling, settling, and refunding transactions, as well as getting a transaction status, and verifying signatures in Return URL and IPN notifications.

  • Configuring Instant Payment Notification and Handling Instant Payment Notifications

  • Using Amazon Simple Pay Actions

To learn how to do some of these tasks, see the Amazon Simple Pay Advanced User Guide, For complete details on the capabilities of Amazon Simple Pay, please see the suggested documentation listed in Amazon Simple Pay Resources