gpt4 book ai didi

安卓java.security.NoSuchAlgorithmException : KeyManagerFactory SunX509 implementation not found

转载 作者:太空宇宙 更新时间:2023-11-03 16:31:45 25 4
gpt4 key购买 nike

我正在尝试处理 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com