简体   繁体   English

比特支付安卓集成

[英]Bitpay android integration

Can any give me some direction how can I integrate Bitpay in my android app, I have searched for documentation, didn't find anything useful.I tried to run their sample app from GitHub https://github.com/bitpay/android-sdk-sample谁能给我一些指导如何将 Bitpay 集成到我的 android 应用程序中,我搜索了文档,没有找到任何有用的东西。我尝试从 GitHub https://github.com/bitpay/android-运行他们的示例应用程序- sdk-样本

but getting this error.但得到这个错误。

12-14 09:19:22.140 1665-1665/com.bitpay.sample.musicstore W/System.err: 
com.bitpay.sdk.controller.BitPayException: Error - failed to deserialize 
BitPay server response (Invoice) : Unrecognized field "buyerTotalBtcAmount" 
(class com.bitpay.sdk.model.Invoice), not marked as ignorable (31 known 
properties: "itemDesc", "notificationURL", "guid", "price", 
"transactionSpeed", "orderId", "paymentUrls", "refundAddresses", 
"buyerFields", "currency", "transactions", "physical", "fullNotifications" 
[truncated]])

12-14 09:19:22.141 1665-1665/com.bitpay.sample.musicstore W/System.err:     
at [Source: {"facade":"pos/invoice","data"
{"url":"https://test.bitpay.com/invoice?id=Lh6f8nJmmr3bUpmt7hUzpJ","status":"new","btcPrice":"0.157762","btcDue":"0.157765","price":2546.43,"currency":"USD","buyerTotalBtcAmount":"0.157765","invoiceTime":1513221560521,"expirationTime":1513222460521,"currentTime":1513221560540,"guid":"43408381","id":"Lh6f8nJmmr3bUpmt7hUzpJ","lowFeeDetected":false,"btcPaid":"0.000000","rate":16141,"exceptionStatus":false,"refundAddressRequestPending":false,"addresses":{"BTC":"n2Li7v6Eh43uAM41B8wEwbTG9X2NgohU6X"},"paymentSubtotals":{"BTC":15776200},"paymentTotals":{"BTC":15776500},"paymentUrls":{"BIP21":"bitcoin:n2Li7v6Eh43uAM41B8wEwbTG9X2NgohU6X?amount=0.157765","BIP72":"bitcoin:n2Li7v6Eh43uAM41B8wEwbTG9X2NgohU6X?amount=0.157765&r=https://test.bitpay.com/i/Lh6f8nJmmr3bUpmt7hUzpJ","BIP72b":"bitcoin:?r=https://test.bitpay.com/i/Lh6f8nJmmr3bUpmt7hUzpJ","BIP73":"https://test.bitpay.com/i/Lh6f8nJmmr3bUpmt7hUzpJ"},"bitcoinAddress":"n2Li7v6Eh43uAM41B8wEwbTG9X2NgohU6X","buyerPaidBtcMinerFee":"0.000003","supportedTransactionCurrencies":{"BTC":{"enabled":true}},"exRates":{"USD":16141},"exchangeRates":{"BTC":{"USD":16141}},"token":"3BjTnM1C47mHNgZZy2vS6KQciyhYZB3sstFCQ9SgLLoFGGfiCfCpY9Jf6V7ZEHTMtL"}}; line: 1, column: 212] (through reference chain: com.bitpay.sdk.controller.InvoiceWrapper["data"]->com.bitpay.sdk.model.Invoice["buyerTotalBtcAmount"])
12-14 09:19:22.141 1665-1665/com.bitpay.sample.musicstore W/System.err:     
at com.bitpay.sdk.controller.BitPay.createInvoice(BitPay.java:199)
12-14 09:19:22.141 1665-1665/com.bitpay.sample.musicstore W/System.err:     
at com.bitpay.sdk.android.BitPayAndroid$CreateInvoiceTask.doInBackground(BitPayAndroid.java:395)
12-14 09:19:22.141 1665-1665/com.bitpay.sample.musicstore W/System.err:     
at com.bitpay.sdk.android.BitPayAndroid$CreateInvoiceTask.doInBackground(BitPayAndroid.java:383)
12-14 09:19:22.141 1665-1665/com.bitpay.sample.musicstore W/System.err:     at android.os.AsyncTask$2.call(AsyncTask.java:295)
12-14 09:19:22.141 1665-1665/com.bitpay.sample.musicstore W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
12-14 09:19:22.142 1665-1665/com.bitpay.sample.musicstore W/System.err:     
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
12-14 09:19:22.142 1665-1665/com.bitpay.sample.musicstore W/System.err:     
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
12-14 09:19:22.142 1665-1665/com.bitpay.sample.musicstore W/System.err:     at java.lang.Thread.run(Thread.java:818)

You can achieve this by web service.您可以通过 Web 服务来实现这一点。 Just create one web service where you have to integrate bitcoin properly using bitcoin library ( https://github.com/bitpay/php-bitpay-client ) and tutorial https://github.com/bitpay/php-bitpay-client/tree/master/examples/tutorial .只需创建一个 Web 服务,您必须使用比特币库( https://github.com/bitpay/php-bitpay-client )和教程https://github.com/bitpay/php-bitpay-client/正确集成比特币树/主/示例/教程 Web service should be one PHP file and you have load to android web view control. Web 服务应该是一个 PHP 文件,并且您已加载到 android Web 视图控件。 And manage the success or failure messages.并管理成功或失败的消息。

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

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