简体   繁体   中英

In-App payment in 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 mi 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>

在此输入图像描述

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 im wrong ... the click number is shown 5 but when i click it is not deducted why? any help will be appricated .... Thanks

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.

在此输入图像描述

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.

Even i had faced the same issue:

Here's how I got the In App purchases to work on Kindle Fire (after several hrs of struggle...)

1.adb install AmazonSDKTester.apk (Install SDKTester on Kindle Fire)

2.Create a file amazon.sdktester.json in the SDCARD directory (The connected KF shows up as SDCARD in Finder on ur Mac)

3.Contents of amazon.sdktester.json - { "com.yourcompany.yourpkgname.200_coins" : { "itemType": "CONSUMABLE", "price": 0.99, "title": "200 COINS", "description": "2 COINS", "smallIconUrl": " http://www.yourcompany.com/icon.png " } }

4.Press the power button on KF & press "Disconnect" button - Now KF is no longer a mounted drive on ur Mac.

5.Run the AmazonSDKTester app on KF.

6.Run your app from Eclipse. Make sure the package name in the JSON matches the In App Item package name on Amazon's website & in the PurchasingManager.initiatePurchaseRequest("com.yourcompany.yourpkgname.200_coins");

7.Now you should see the In App interstitials showing up.

8.Still doesn't work - Force Close both ur app & AmazonSDKTester on KF; Hard Reset KF ; Restart Eclipse & Restart from Step 1

If you also want a video link you can follow this:

VIDEO LINK

Finally its very well explained in Developer website Amazon Developer Link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM