【问题标题】:PayPal REST API - 'An internal service error has occurred'PayPal REST API - '发生内部服务错误'
【发布时间】:2016-07-08 06:09:41
【问题描述】:

我已在我的 iOS 应用上安装并使用了 PayPal 移动 SDK。 我通过应用程序处理单笔付款,然后将售后 PayPal 确认字典传递到我的服务器进行确认(按照 PayPal 的指示)

但是,当我尝试在服务器上确认销售时,我收到 “发生内部服务错误”。

这是 PayPal 确认 JSON:

"paypalConfirmation" : {
"response" : {
  "id" : "APAYPALSALECONFIRMATIONID",
  "state" : "approved",
  "create_time" : "2016-03-21T15:18:36Z",
  "intent" : "sale"
},
"client" : {
  "environment" : "mock",
  "product_name" : "PayPal iOS SDK",
  "paypal_sdk_version" : "2.14.0",
  "platform" : "iOS"
},
"response_type" : "payment"
}

这是我服务器上的 node.js 代码:

//I am using the PayPal Node.js SDK
paypal.sale.get("APAYPALSALECONFIRMATIONID", function (error, sale) {


    if (error) {

        console.log(error);
        context.fail('There was an error confirming the payment');

    } else {


        console.log('Verifying sale...');
        compareSaleWithPost(order, sale, context); 


    }


});

这是错误:

{ [Error: Response Status : 500]
response: 
 { name: 'INTERNAL_SERVICE_ERROR',
 message: 'An internal service error has occurred',
 information_link: 'https://developer.paypal.com/docs/a/#INTERNAL_SERVICE_ERROR',
 debug_id: '***********',
 httpStatusCode: 500 },
httpStatusCode: 500 }

我知道还有其他关于此错误的问题,但它们指的是信用卡付款以及数字或负面测试设置的问题。

我关闭了负面测试,这是针对 PayPal 帐户交易而不是信用卡交易。我正在使用沙盒模式

【问题讨论】:

  • 也许确实是他们内部的错误,稍后解决?
  • paypal 状态页面上没有提到沙盒已关闭。我倾向于错误在我身边只是不确定是什么

标签: ios iphone paypal paypal-sandbox paypal-rest-sdk


【解决方案1】:

原来我使用了错误的请求。我应该一直使用 paypal.payment.get 而不是 paypal.sale.get。像这样:

paypal.payment.get("APAYPALSALECONFIRMATIONID", function (error, payment) {


    if (error) {

        console.log(error);
        context.fail('There was an error confirming the payment');

    } else {


        console.log('Verifying payment...');
        compareSaleWithPost(order, payment, context); 


    }
}

【讨论】:

    猜你喜欢
    • 2013-10-08
    • 1970-01-01
    • 2016-01-10
    • 1970-01-01
    • 2013-08-12
    • 2013-08-02
    • 2014-04-29
    • 2022-11-26
    • 2014-11-04
    相关资源
    最近更新 更多