Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/196.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Android中使用Simplify Commerce支付API?_Android_Payment - Fatal编程技术网

如何在Android中使用Simplify Commerce支付API?

如何在Android中使用Simplify Commerce支付API?,android,payment,Android,Payment,我正在尝试从卡令牌创建付款 在我的android程序中,如下链接所示: 我无法使用Simplify Commerce Android SDK创建“Payment”对象,因此我通过将这一行添加到gradle构建中来包含java Payment SDK 添加这一行后,我可以导入“com.simplify.payments”包并创建支付对象,但这次我的android构建失败了(因为我使用java sdk?) 如何在android程序中使用Simplify Commerce支付api 全面披露:这并没

我正在尝试从卡令牌创建付款 在我的android程序中,如下链接所示:

我无法使用Simplify Commerce Android SDK创建“Payment”对象,因此我通过将这一行添加到gradle构建中来包含java Payment SDK

添加这一行后,我可以导入“com.simplify.payments”包并创建支付对象,但这次我的android构建失败了(因为我使用java sdk?)

如何在android程序中使用Simplify Commerce支付api


全面披露:这并没有回答如何在应用程序中包含支付API的问题,而是为您指明了使用Simplify在应用程序中收集付款的正确方向

您绝对不应该尝试在Android应用程序中使用java sdk。这样做需要您提供私有API密钥,并且会带来严重的安全问题。见:

友好提示:不要将您的私钥捆绑在应用程序中

您的私钥被认为是神圣的,可以用于处理付款、发放退款等。一个常见的开发错误是在应用程序中简单地包含JavaSDK,并使用私钥来完成事务生命周期,而不涉及服务器。虽然这似乎是整合支付的一种简单方法,但在应用程序中分发私钥会使其容易受到简单反向工程的攻击。一旦受到攻击,攻击者可以使用您的密钥执行通过我们的API提供的几乎所有操作。这是糟糕的安全做法。此外,由于键可以从API键页面中撤销,因此它们也被认为是易失性的。如果私钥被吊销,使用它的任何应用程序都将被破坏,直到使用新密钥发布更新。底线是:不要这样做。我们会找到你的。:)

好消息是Simplify提供了一个Android SDK,您可以使用它在应用程序中收集和标记卡信息。只需将其包含在以下行中:

compile 'com.simplify:simplify-android:2.0.3'
以及参考文档和示例应用程序:

嗯,我试过了,但失败了+1
    Information:Gradle tasks [:app:assembleDebug]
Warning:Dependency org.apache.httpcomponents:httpclient:4.2.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency org.apache.httpcomponents:httpclient:4.2.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency commons-logging:commons-logging:1.1.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency org.apache.httpcomponents:httpclient:4.2.1 is ignored for release as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency org.apache.httpcomponents:httpclient:4.2.1 is ignored for release as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency commons-logging:commons-logging:1.1.1 is ignored for release as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42220Library UP-TO-DATE
:app:prepareComSimplifySdkAndroid103Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:preDexDebug UP-TO-DATE
:app:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lorg/hamcrest/Description;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
    at com.android.dx.command.dexer.Main.run(Main.java:277)
    at com.android.dx.command.dexer.Main.main(Main.java:245)
    at com.android.dx.command.Main.main(Main.java:106)
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_60\bin\java.exe'' finished with non-zero exit value 2
Information:BUILD FAILED
compile 'com.simplify:simplify-android:2.0.3'