getPaymentExecStatus() 给空
getPaymentExecStatus() giving null
我正在尝试使用来自 paypal java sdk 的自适应支付 api 并调用 getPaymentExecStatus() 返回 null。这是我的代码
final PayRequest payRequest = new PayRequest();
final List<Receiver> receivers = new ArrayList<Receiver>();
final Receiver receiver = new Receiver();
receiver.setAmount(ammount);
receiver.setEmail("sandeepraju_123@yahoo.co.in");
receivers.add(receiver);
final ReceiverList receiverList = new ReceiverList(receivers);
payRequest.setSenderEmail(Constants.PAYPAL_USER_ID);
payRequest.setReceiverList(receiverList);
final RequestEnvelope requestEnvelope = new RequestEnvelope("en_US");
payRequest.setRequestEnvelope(requestEnvelope);
payRequest.setActionType("PAY");
payRequest.setCancelUrl("https://devtools-paypal.com/guide/ap_implicit_payment?cancel=true");
payRequest.setReturnUrl("https://devtools-paypal.com/guide/ap_implicit_payment?success=true");
payRequest.setCurrencyCode("USD");
payRequest.setIpnNotificationUrl("http://replaceIpnUrl.com");
final Map<String, String> sdkConfig = new HashMap<String, String>();
sdkConfig.put("mode", Constants.PAYPAL_MODE);
sdkConfig.put("acct1.UserName", Constants.PAYPAL_USER_ID);
sdkConfig.put("acct1.Password", Constants.PAYPAL_USER_PASSWORD);
sdkConfig.put("acct1.Signature",Constants.PAYPAL_USER_SIGNATURE);
sdkConfig.put("acct1.AppId",Constants.PAYPAL_APPID);
Logger.debug("paypal"+Constants.PAYPAL_USER_ID+Constants.PAYPAL_USER_PASSWORD+Constants.PAYPAL_USER_SIGNATURE);
final AdaptivePaymentsService adaptivePaymentsService = new AdaptivePaymentsService(sdkConfig);
try {
final PayResponse payResponse = adaptivePaymentsService.pay(payRequest);
Logger.error("error list"+payResponse.getError());
Logger.debug("pay respose"+payResponse.toString());
coachWithdrawl.withdrawlAmount = ammount;
Logger.debug("payResponse"+payResponse.getPaymentExecStatus());
coachWithdrawl.paymentExecStatus = payResponse.getPaymentExecStatus();
coachWithdrawl.payKey = payResponse.getPayKey();
payResponse.getPaymentExecStatus();
} catch (SSLConfigurationException | InvalidCredentialException | HttpErrorException
| InvalidResponseDataException | ClientActionRequiredException | MissingCredentialException
| IOException | InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (final com.paypal.sdk.exceptions.OAuthException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
我从这里举了个例子paypal implicite example
它处于沙盒模式,因此我从仪表板帐户选项卡获取凭据。
请帮我找出为什么响应和其他数据提前 null.thanks..
我错误地使用了 paypal 用户 ID 作为发件人 ID,所以它给出了 null 来执行 status.thanks。
我正在尝试使用来自 paypal java sdk 的自适应支付 api 并调用 getPaymentExecStatus() 返回 null。这是我的代码
final PayRequest payRequest = new PayRequest();
final List<Receiver> receivers = new ArrayList<Receiver>();
final Receiver receiver = new Receiver();
receiver.setAmount(ammount);
receiver.setEmail("sandeepraju_123@yahoo.co.in");
receivers.add(receiver);
final ReceiverList receiverList = new ReceiverList(receivers);
payRequest.setSenderEmail(Constants.PAYPAL_USER_ID);
payRequest.setReceiverList(receiverList);
final RequestEnvelope requestEnvelope = new RequestEnvelope("en_US");
payRequest.setRequestEnvelope(requestEnvelope);
payRequest.setActionType("PAY");
payRequest.setCancelUrl("https://devtools-paypal.com/guide/ap_implicit_payment?cancel=true");
payRequest.setReturnUrl("https://devtools-paypal.com/guide/ap_implicit_payment?success=true");
payRequest.setCurrencyCode("USD");
payRequest.setIpnNotificationUrl("http://replaceIpnUrl.com");
final Map<String, String> sdkConfig = new HashMap<String, String>();
sdkConfig.put("mode", Constants.PAYPAL_MODE);
sdkConfig.put("acct1.UserName", Constants.PAYPAL_USER_ID);
sdkConfig.put("acct1.Password", Constants.PAYPAL_USER_PASSWORD);
sdkConfig.put("acct1.Signature",Constants.PAYPAL_USER_SIGNATURE);
sdkConfig.put("acct1.AppId",Constants.PAYPAL_APPID);
Logger.debug("paypal"+Constants.PAYPAL_USER_ID+Constants.PAYPAL_USER_PASSWORD+Constants.PAYPAL_USER_SIGNATURE);
final AdaptivePaymentsService adaptivePaymentsService = new AdaptivePaymentsService(sdkConfig);
try {
final PayResponse payResponse = adaptivePaymentsService.pay(payRequest);
Logger.error("error list"+payResponse.getError());
Logger.debug("pay respose"+payResponse.toString());
coachWithdrawl.withdrawlAmount = ammount;
Logger.debug("payResponse"+payResponse.getPaymentExecStatus());
coachWithdrawl.paymentExecStatus = payResponse.getPaymentExecStatus();
coachWithdrawl.payKey = payResponse.getPayKey();
payResponse.getPaymentExecStatus();
} catch (SSLConfigurationException | InvalidCredentialException | HttpErrorException
| InvalidResponseDataException | ClientActionRequiredException | MissingCredentialException
| IOException | InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (final com.paypal.sdk.exceptions.OAuthException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
我从这里举了个例子paypal implicite example 它处于沙盒模式,因此我从仪表板帐户选项卡获取凭据。 请帮我找出为什么响应和其他数据提前 null.thanks..
我错误地使用了 paypal 用户 ID 作为发件人 ID,所以它给出了 null 来执行 status.thanks。