This is a simple Java code sample to create a dynamic Amazon Payments 'Subscription' widget
Prerequisites
- You must have an Amazon Payments Sandbox Business Account.
- You must have an Amazon Web Services developer account.
- You must use the same email address and password for your Amazon Payments Business Account and your Amazon Web Services developer account.
- You must have Java version 1.5 or later installed
Using the Sample
- Sign into your Amazon Web Services developer account and retrieve your Access Key ID and Secret Access Key from here.
- Replace the value of the accessKey constant in the code sample with your Access Key ID
- Replace the value of the secretKey constant in the code sample with your Secret Access Key
- Copy commons-codec-1.3.jar (provided in the thirdparty folder) to a folder (say JARS-FOLDER).
- Compile & Run the code sample as:
- For Linux Users:
- $javac -cp .:<JARS-FOLDER>/commons-codec-1.3.jar SubscriptionWidgetUtils.java
- $java -cp .:<JARS-FOLDER>/commons-codec-1.3.jar SubscriptionWidgetUtils
- For Windows Users:
- $javac -cp .;<JARS-FOLDER>/commons-codec-1.3.jar SubscriptionWidgetUtils.java
- $java -cp .;<JARS-FOLDER>/commons-codec-1.3.jar SubscriptionWidgetUtils
- The code sample will output the HTML for the 'Subscription' widget to the Console
- You can now integrate this code into your website
- Note: You cannot use your Amazon Payments Business Account as a buyer while testing your 'Subscription' Widgets. You should create a new Amazon Payments account which you can use as a buyer.