【问题标题】:Paypal rest sdk- internal service error has occurred errorPaypal rest sdk- internal service error has occurred 错误
【发布时间】:2014-02-17 22:09:40
【问题描述】:

我正在尝试使用 paypal rest sdk 执行交易。

我正在尝试以与 sdk 文档相同的方式:.

OAuthTokenCredential tokenCredential = 新 OAuthTokenCredential("", "");

String accessToken = tokenCredential.getAccessToken();

Address billingAddress = new Address();
billingAddress.setLine1("52 N Main ST");
billingAddress.setCity("Johnstown");
billingAddress.setCountryCode("US");
billingAddress.setPostalCode("43210");
billingAddress.setState("OH");

CreditCard creditCard = new CreditCard();
creditCard.setNumber("4417119669820331");
creditCard.setType("visa");
creditCard.setExpireMonth("11");
creditCard.setExpireYear("2018");
creditCard.setCvv2("874");
creditCard.setFirstName("Joe");
creditCard.setLastName("Shopper");
creditCard.setBillingAddress(billingAddress);

AmountDetails amountDetails = new AmountDetails();
amountDetails.setSubtotal("7.41");
amountDetails.setTax("0.03");
amountDetails.setShipping("0.03");

Amount amount = new Amount();
amount.setTotal("7.47");
amount.setCurrency("USD");
amount.setDetails(amountDetails);

Transaction transaction = new Transaction();
transaction.setAmount(amount);
transaction.setDescription("This is the payment transaction description.");

List<Transaction> transactions = new ArrayList<Transaction>();
transactions.add(transaction);

FundingInstrument fundingInstrument = new FundingInstrument();
fundingInstrument.setCreditCard(creditCard);

List<FundingInstrument> fundingInstruments = new ArrayList<FundingInstrument>();
fundingInstruments.add(fundingInstrument);

Payer payer = new Payer();
payer.setFundingInstruments(fundingInstruments);
payer.setPaymentMethod("credit_card");

Payment payment = new Payment();
payment.setIntent("sale");
payment.setPayer(payer);
payment.setTransactions(transactions);

Payment createdPayment = payment.create(accessToken);

Payment executePayment = Payment.get(accessToken, "PAY-34629814WL663112AKEE3AWQ");

PaymentExecution paymentExecution = new PaymentExecution();
paymentExecution.setPayerId("7E7MGXCWTTKK2");

Payment newPayment = executePayment.execute(accessToken, paymentExecution);

但是我遇到了异常

Caused by: com.paypal.exception.HttpErrorException: Error code : 500 with response : 
{"name":"INTERNAL_SERVICE_ERROR","message":"An internal service error has occurred","information_link":
"https://developer.paypal.com/webapps/developer/docs/api/#INTERNAL_SERVICE_ERROR","debug_id":"7a7f0k30b2719"}
        at com.paypal.core.HttpConnection.execute(HttpConnection.java:108)
        at com.paypal.core.rest.PayPalResource.execute(PayPalResource.java:321)
        ... 214 more

谁能告诉我为什么会出现这个错误?

谢谢,

【问题讨论】:

  • 我已经尝试按照developer.paypal.com/webapps/developer/docs/api rest sdk 错误几次执行事务,但得到相同的异常。
  • FWIW 我认为这是一个 PayPal 错误......我猜“沙盒”不太稳定......我可能是错的......但是,有时我的代码有效,有时无效。 .. 随机 ... c# .NET ... createdInvoice = getInvoiceFromPayPal.Create(apiContext); "PayPalCoreSDK.dll 中发生了 'PayPal.Exception.PayPalException' 类型的第一次机会异常"

标签: paypal paypal-rest-sdk


【解决方案1】:

不幸的是,我发现 PayPal 沙盒不是很可靠。您在此列表中找到的任何信用卡:http://www.paypalobjects.com/en_US/vhelp/paypalmanager_help/credit_card_numbers.htm 可以并且最终会从 PayPal 返回错误 500。

不断更改您的测试信用卡号码以避免此问题。

您也可以使用自己的信用卡号,因为沙盒环境不会向您的帐户收取任何费用。

我希望我有一个更好的答案,因为我也遇到了这个问题。

见:PayPal Sandbox Internal Service Error

【讨论】:

    【解决方案2】:

    我也发现了这个问题。我试图弄清楚这个问题。1小时后,我发现问题是由于我们多次使用同一张信用卡而发生的。然后我用不同的卡注册,在沙盒模式下我得到了一个新的新令牌。然后我的支付我得到了成功消息

    【讨论】:

      猜你喜欢
      • 2015-03-05
      • 2020-04-10
      • 2022-12-28
      • 2019-10-27
      • 2022-01-09
      • 1970-01-01
      • 2017-03-06
      • 2016-06-12
      • 2014-11-23
      相关资源
      最近更新 更多