简体   繁体   English

亚马逊的应用内付款

[英]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. 我已按照以下步骤操作如图所示。在AppPayment亚马逊中的步骤但问题是当我运行sdk中提供的代码时,如图4所示,当我点击按钮时应扣除点击次数但不是。 I have place the follwing values in string.xml mi right in theses steps? 我已经将这些后面的值放在string.xml中了吗?

  <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 ? 上面的sku是由我生成的,我也想知道图像三中显示的json文件,我已下载并置于assert文件夹中..这个json文件是什么用的? kind provide comment on my steps where im wrong ... the click number is shown 5 but when i click it is not deducted why? 我提供评论我的步骤,我错了...点击数字显示5但当我点击它不扣除为什么? 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 . 在您的设备中安装AmazonSDKTester.apk并将其打开 It's inside tools folder in the SDK package. 它位于SDK包中的tools文件夹中。 For install it you can use in terminal: 安装它你可以在终端使用:

    adb install AmazonSDKTester.apk

  2. Next add your project to Eclipse : 接下来将项目添加到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 . 将amazon.sdktester.json文件复制到SD内存 In the ButtonClicker project folder, go to assets folder and add the amazon.sdktester.json file to the SD memory. 在ButtonClicker项目文件夹中,转到assets文件夹并将amazon.sdktester.json文件添加到SD内存中。 An easy way it's dragging the file to the SD folder using DDMS file explorer. 使用DDMS文件资源管理器将文件拖动到SD文件夹的简单方法。 Your SD folder may be different depends on device, in my Nexus S is like you can see in the image. 您的SD文件夹可能会有所不同取决于设备,在我的Nexus S中就像您可以在图像中看到的那样。

在此输入图像描述

And that's it, you must have Button Clicker Demo sample fully working. 就是这样,你必须让Button Clicker Demo样本完全正常工作。 When you make a purchase you can go to the AmazonSDKTester and see all your purchases. 购买时,您可以访问AmazonSDKTester查看所有购买内容。 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. SDK Tester是一个开发人员工具,允许亚马逊移动应用SDK用户在将其提交到亚马逊出版之前,在生产环境中测试他们的实现。 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. 这将允许开发人员构建涵盖亚马逊移动应用SDK API生成的所有响应的测试用例,并让他们相信他们的应用将被发布并正确运行。

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. 这意味着,您必须在类似生产的环境中使用AmazonSDKTester.apk进行测试,一旦它工作,您可以提交您的应用程序以供发布。

The SDK Tester Uses a JavaScript Object Notation (JSON) text file to contain the IAP item information used to respond to IAP API calls. SDK测试程序使用JavaScript对象表示法(JSON)文本文件来包含用于响应IAP API调用的IAP项信息。 This file resides on the device containing the app under test and the SDK Tester. 此文件驻留在包含待测应用程序和SDK测试程序的设备上。 Once created, the file needs to reside on the device's file system under the path: /mnt/sdcard/amazon.sdktester.json 创建后,文件需要驻留在设备的文件系统下的路径:/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. 点击次数不会减少,因为点击按钮时会返回SKU INVALID消息(查看logcat),因为在SD卡路径中找不到.json文件。

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...) 这是我如何购买In App购买Kindle Fire(经过几个小时的奋斗......)

1.adb install AmazonSDKTester.apk (Install SDKTester on Kindle Fire) 1.adb安装AmazonSDKTester.apk(在Kindle Fire上安装SDKTester)

2.Create a file amazon.sdktester.json in the SDCARD directory (The connected KF shows up as SDCARD in Finder on ur Mac) 2.在SDCARD目录中创建一个文件amazon.sdktester.json(连接的KF在你的Mac上的Finder中显示为SDCARD)

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 " } } 3. 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. 4.按下KF上的电源按钮并按“断开”按钮 - 现在KF不再是Mac上安装的驱动器。

5.Run the AmazonSDKTester app on KF. 5.在KF上运行AmazonSDKTester应用程序。

6.Run your app from Eclipse. 6.从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"); 确保JSON中的包名称与Amazon网站和PurchasingManager.initiatePurchaseRequest(“com.yourcompany.yourpkgname.200_coins”)中的In App Item包名称相匹配;

7.Now you should see the In App interstitials showing up. 7.现在您应该看到In App插页式广告出现。

8.Still doesn't work - Force Close both ur app & AmazonSDKTester on KF; 8.Still不起作用 - 强制关闭KF上的你的app和AmazonSDKTester; Hard Reset KF ; 硬重置KF; Restart Eclipse & Restart from Step 1 重启Eclipse并从步骤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 最后,在开发者网站亚马逊开发者链接中对它进

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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