Sandbox rest api getting" INTERNAL_SERVICE_ERROR"退款操作

时间:2017-09-06 13:19:14

标签: paypal

我会全额退款并收到此错误消息。

    RefundRequest refund = new RefundRequest();
    Sale sale = new Sale();
    sale.setId(paymentId);

    try {
        sale.refund(context, refund);
    } catch (PayPalRESTException e) {
        throw new PaymentException(e);
    }

response-code: 500 details: name: INTERNAL_SERVICE_ERROR message: An internal service error occurred. details: null debug-id: ddc5e8373a92c information-link: https://developer.paypal.com/webapps/developer/docs/api/#INTERNAL_SERVICE_ERROR

1 个答案:

答案 0 :(得分:0)

您似乎正在尝试使用PAY ID(PAY-XXXX)退款。您需要使用结果交易ID来处理退款。

请通过传递以下交易ID运行退款:

https://api.sandbox.paypal.com/v1/payments/sale/4JXXXXXXXXXXX2H/refund