- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试处理 PayPal 预批准付款。
我使用在 PayPal 集成指南中找到的以下代码:
RequestEnvelope requestEnvelope = new RequestEnvelope("en_US");
PreapprovalRequest preapprovalRequest = new PreapprovalRequest();
preapprovalRequest.setRequestEnvelope(requestEnvelope);
preapprovalRequest.setCurrencyCode("USD");
preapprovalRequest.setStartingDate("2014-03-22");
preapprovalRequest.setEndingDate("2015-03-22");
preapprovalRequest.setMaxAmountPerPayment(1.0);
preapprovalRequest.setMaxNumberOfPayments(5);
preapprovalRequest.setMaxTotalAmountOfAllPayments(5.0);
preapprovalRequest.setSenderEmail("platfo_1255077030_biz@gmail.com");
preapprovalRequest.setCancelUrl("https://devtools- paypal.com/guide/ap_preapprove_payment?cancel=true");
preapprovalRequest.setReturnUrl("https://devtools- paypal.com/guide/ap_preapprove_payment?success=true");
preapprovalRequest.setIpnNotificationUrl("http://replaceIpnUrl.com");
Map<String, String> sdkConfig = new HashMap<String, String>();
sdkConfig.put("mode", "sandbox");
sdkConfig.put("acct1.UserName", "jb-us-seller_api1.paypal.com");
sdkConfig.put("acct1.Password", "WX4WTU3S8MY44S7F");
sdkConfig.put("acct1.Signature","AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy");
sdkConfig.put("acct1.AppId","APP-80W284485P519543T");
AdaptivePaymentsService adaptivePaymentsService = new AdaptivePaymentsService(sdkConfig);
PreapprovalResponse preapprovalResponse = adaptivePaymentsService.preapproval(preapprovalRequest);
但是我得到这个错误:
03-22 14:04:15.926: E/AndroidRuntime(14824): FATAL EXCEPTION: main
03-22 14:04:15.926: E/AndroidRuntime(14824): Process: com.example.provapaypal, PID: 14824
03-22 14:04:15.926: E/AndroidRuntime(14824): java.lang.ExceptionInInitializerError
03-22 14:04:15.926: E/AndroidRuntime(14824): at com.paypal.core.SSLUtil.<clinit>(SSLUtil.java:40)
03-22 14:04:15.926: E/AndroidRuntime(14824): at com.paypal.core.DefaultHttpConnection.<init>(DefaultHttpConnection.java:30)
03-22 14:04:15.926: E/AndroidRuntime(14824): at com.paypal.core.ConnectionManager.getConnection(ConnectionManager.java:52)
03-22 14:04:15.926: E/AndroidRuntime(14824): at com.paypal.core.APIService.makeRequestUsing(APIService.java:151)
03-22 14:04:15.926: E/AndroidRuntime(14824): at com.paypal.core.BaseService.call(BaseService.java:258)
03-22 14:04:15.926: E/AndroidRuntime(14824): at com.paypal.svcs.services.AdaptivePaymentsService.preapproval(AdaptivePaymentsService.java:699)
03-22 14:04:15.926: E/AndroidRuntime(14824): at com.paypal.svcs.services.AdaptivePaymentsService.preapproval(AdaptivePaymentsService.java:662)
03-22 14:04:15.926: E/AndroidRuntime(14824): at com.example.provapaypal.MainActivity.onCreate(MainActivity.java:62)
03-22 14:04:15.926: E/AndroidRuntime(14824): at android.app.Activity.performCreate(Activity.java:5231)
03-22 14:04:15.926: E/AndroidRuntime(14824): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
03-22 14:04:15.926: E/AndroidRuntime(14824): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
03-22 14:04:15.926: E/AndroidRuntime(14824): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
03-22 14:04:15.926: E/AndroidRuntime(14824): at android.app.ActivityThread.access$800(ActivityThread.java:135)
03-22 14:04:15.926: E/AndroidRuntime(14824): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
03-22 14:04:15.926: E/AndroidRuntime(14824): at android.os.Handler.dispatchMessage(Handler.java:102)
03-22 14:04:15.926: E/AndroidRuntime(14824): at android.os.Looper.loop(Looper.java:136)
03-22 14:04:15.926: E/AndroidRuntime(14824): at android.app.ActivityThread.main(ActivityThread.java:5017)
03-22 14:04:15.926: E/AndroidRuntime(14824): at java.lang.reflect.Method.invokeNative(Native Method)
03-22 14:04:15.926: E/AndroidRuntime(14824): at java.lang.reflect.Method.invoke(Method.java:515)
03-22 14:04:15.926: E/AndroidRuntime(14824): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
03-22 14:04:15.926: E/AndroidRuntime(14824): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
03-22 14:04:15.926: E/AndroidRuntime(14824): at dalvik.system.NativeStart.main(Native Method)
03-22 14:04:15.926: E/AndroidRuntime(14824): Caused by: java.security.NoSuchAlgorithmException: KeyManagerFactory SunX509 implementation not found
03-22 14:04:15.926: E/AndroidRuntime(14824): at org.apache.harmony.security.fortress.Engine.notFound(Engine.java:177)
03-22 14:04:15.926: E/AndroidRuntime(14824): at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:151)
03-22 14:04:15.926: E/AndroidRuntime(14824): at javax.net.ssl.KeyManagerFactory.getInstance(KeyManagerFactory.java:77)
03-22 14:04:15.926: E/AndroidRuntime(14824): at com.paypal.core.SSLUtil.<clinit>(SSLUtil.java:37)
03-22 14:04:15.926: E/AndroidRuntime(14824): ... 21 more
最佳答案
您似乎正尝试在 Android 上使用 PayPal Java SDK。不幸的是,该 SDK 从未设计用于 Android,并且由于对 Sun SDK 的依赖而失败。参见 a similar issue here .
关于安卓java.security.NoSuchAlgorithmException : KeyManagerFactory SunX509 implementation not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22578289/
我遇到异常,告诉我“AES KeyManagerFactory 不可用”。 这是我的代码: try { LOG.warn("Configuring SSL connection on port
在我们的项目中,我们需要通过 SSL 与第三方服务器通信。之前我们使用 RSA 的 sslJ 提供程序 com.rsa.jsse.JsseProvider,但由于其中的一些问题,现在我们不得不使用 S
Sun JRE 1.6 中的 KeyManagerFactory 有问题。我们正在使用类似于以下的代码来上传和使用 p12 格式的证书: KeyStore keyStore = KeyStore.ge
我在创建 SSLContext 的过程中发现了这个 Java 片段。我想知道 init 调用,其中指定了 keyPass 。如果 KeyStore 包含多个具有不同别名和不同密码的证书怎么办? val
我想创建 SSL 连接。我创建了 keystore 。并尝试使用 x509。 final KeyManagerFactory kmf = KeyManagerFactory.getInstance(
我正在 Google App Engine 上部署一个 Spring Social 应用程序,但在其中一个应用程序工作流程中出现以下错误: java.lang.NoClassDefFoundError
我正在尝试处理 PayPal 预批准付款。 我使用在 PayPal 集成指南中找到的以下代码: RequestEnvelope requestEnvelope = new RequestEnvelop
String keyStorePath = "2keystore.jks"; String keyStoreType = "JKS"; String keyStorePassword = "mypas
我有以下代码尝试使用 SHA-256 哈希作为密码来初始化 KeyManagerFactory。 public static KeyManager[] getKeystoreManagers()
当我执行以下代码时: KeyManagerFactory keyManagerFactory = KeyManagerFactory .getI
我是一名优秀的程序员,十分优秀!