Setup In Developer Console
Make sure that you downloaded additional Amazon Billing package in your project.
In-App Purchasing handles the details of purchase flow, payment processing, receipts, and rights management for the purchasable content. Now with unique receipt identifiers, you can easily ensure that customers receive purchased in-app items quickly, as well as track transactions and fulfillment.
Create new account at Amazon Developer Console if you have not registered previously.
To implement in-apps in your application you should create new amazon application in https://developer.amazon.com/myapps.html and pass some info to the plugin. See instructions below how to set up and run billing example scene.
How to add new application.
Create new Application in Amazon Developer Console. You need to choose Android platform:
Then fill all fields when creating an application. After these manipulations we have an existing application.
You need to fill in all tabs in your application, so that it satisfies all requirements of Amazon's Developer Console:
7. Now go directly to a tab In-App Items and create products of any type you need by pressing respectively:
Add a Consumable
Add an Entitlement
How to find InApp purchases.
Setting Up for Test Purchases
To test your In-app Billing implementation with actual in-app purchases, you will need to click to download the JSON Data File, there by obtaining the file amazon.sdktester for conducting TEST PURCHASES and then copy this file to your device.
The App Tester is a developer tool that allows users of the Amazon Mobile App SDK to test their implementation in a production-like environment before submitting it to Amazon for publication. This will allow developers to construct test cases that cover all responses generated by the Amazon Mobile App SDK APIs, and give them confidence their apps will be published and run correctly.
In a live environment, your app makes API calls to the Amazon Mobile App SDK libraries. These libraries, in turn, make IPC calls to the Amazon Appstore on the device. The Amazon Appstore then communicates with the Amazon services to fulfill requests such as the purchase of a consumable item, or a subscription to a magazine.
Only apps that have been approved and published through the Amazon Apps & Games Developer Portal can communicate with the Amazon Appstore. This is a problem for developers who want to see how their apps run in a live environment before it is submitted for publication. The App Tester was created to solve this problem.
This document will describe the use of the App Tester to test apps using the Amazon In-App Purchasing APIs (IAP APIs). This is the mechanism of shopping at amazon API:
Note: If a purchase was made with the SDK tester active, then a new build of the same app is run, the new build will never see the old purchase record.
The API libraries will detect whether your app has been published through the Amazon Apps & Games Developer Portal. If it has, the API will exchange data with the Amazon Appstore. If the API detects that the app has not been published through the portal, the API will exchange data with App Tester. This ensures that you will be able to use the same codebase for testing that you intend to submit for publication.
Since your app's interface with the Amazon Appstore is isolated to the API libraries, your app will not know that it is talking with App Tester. Because you have control over the responses given by the App Tester, you can test your app's behavior under any response condition.
Before using the App Tester, developers should be familiar with the IAP APIs as described in the documentation available within the Amazon Apps & Games Developer Portal. Testing an app using the App Tester requires:
An Android Development Environment that allows logging via ADB (Logcat)
An Android device supporting minimum SDK version 10
An Android app that uses the Amazon In-App Purchasing APIs
The Amazon App Tester
A JSON data file (amazon.sdktester.json) that contains IAP item information
It is assumed that the developer has an environment that supports ADB and can capture logging information from the device under test via Logcat.
For help developing an application that uses the IAP APIs, you can see detailed documentation and sample code on the Amazon Apps & Games Developer Portal.
The following section will describe how to create a JSON data file that can be used with the App Tester, followed by instructions for configuring and using the App Tester as part of your test procedures.
Using App Tester
Once you have loaded the app under test, the App Tester , and the JSON data file onto the device, you are ready to start testing the IAP API portions of your application. This section will walk you through each of the screens and explain their use during the test cycle.
Signing and Uploading apk with Unity
To be able to create in-app purchases you should upload your apk file to the developer console. Apk must be signed with your private key.
Next step is app configuration.
You have to choose your bundle Id.
A bundle Id otherwise known as a package_name in Android is the unique identifier for all Android apps. It needs to be unique as when you upload it on Amazon Store.
Here is an example - com.example.testapp.
Where example is generally the company/publishers name, and testapp is the app name.
You will not be able to upload an APK to the store which has the same package as another app already in the store.
When you bundle Id is ready, you need to add it to Unity Application settings.
You can build your signed apk file now. Then press build button.
Note: You should have latest android SDK on your computer, to make Unity able build apk file.
After signed apk is created you can upload it to the Amazon App Dev Console.
Choose Binary files than upload your apk.