Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In-App payment in amazon

Tags:

android

amazon

I have followed the following steps As shown in image ..steps in In AppPayment amazon but the problem is when i run the code provided in sdk as shown in image 4 when i click the button the number of clicks should be deducted but it is not. I have place the follwing values in string.xml m i right in theses steps?

  <string name="app_name">amazoncheckout</string>
 <string name="nothing"></string>
<string name="consumable_sku">com.amazon.checkout</string>
<string name="entitlement_sku_purple">com.amazoncheckoutconsumable</string>
<string name="entitlement_sku_green">com.amazoncheckoutentitlementn</string>
<string name="entitlement_sku_blue">com.amazon.buttonclicker.blue_button</string>
<string name="parent_subscription_sku">com.amazoncheckoutsubscription</string>
<string  name="child_subscription_sku_monthly">com.amazoncheckoutsubscriptionmonthly</string>

enter image description here

The above sku is generated by me and i also want to know the the json file shown in image three , i have downloaded that and placed in assert folder .. what is this json file for ? kind provide comment on my steps where i m wrong ... the click number is shown 5 but when i click it is not deducted why? any help will be appricated .... Thanks

like image 410
Venkat Avatar asked Apr 22 '13 08:04

Venkat


1 Answers

I'm going to try to explain how can you have the demo working, because, I think, that's your question, sorry if I'm wrong...

  1. Install the AmazonSDKTester.apk in your device and open it. It's inside tools folder in the SDK package. For install it you can use in terminal:

    adb install AmazonSDKTester.apk

  2. Next add your project to Eclipse:

    File > New > Project...>Android Project from Existing Code , browse the Button Clicker Demo Project in the SDK folder and Finish.

  3. Copy the amazon.sdktester.json file to SD memory. In the ButtonClicker project folder, go to assets folder and add the amazon.sdktester.json file to the SD memory. An easy way it's dragging the file to the SD folder using DDMS file explorer. Your SD folder may be different depends on device, in my Nexus S is like you can see in the image.

enter image description here

And that's it, you must have Button Clicker Demo sample fully working. When you make a purchase you can go to the AmazonSDKTester and see all your purchases. Hope it helps you and solves your problem.

UPDATE:

I'm going to copy & paste some text from developer docs (please read this doc because it explains everything great) and I hope this helps you:

The SDK 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.

That means, you must use the AmazonSDKTester.apk for test in a production-like environment, once it works you can submit your app for publication.

The SDK Tester Uses a JavaScript Object Notation (JSON) text file to contain the IAP item information used to respond to IAP API calls. This file resides on the device containing the app under test and the SDK Tester. Once created, the file needs to reside on the device's file system under the path: /mnt/sdcard/amazon.sdktester.json

The click number doesn't decrease because when is clicked the button a SKU INVALID message is returned ( Look at the logcat ) due to no .json file is found in the sd card path.

like image 171
gergonzalez Avatar answered Oct 18 '22 11:10

gergonzalez