2016-03-21 64 views
1

我已经安装了PayPal移动SDK并在我的iOS应用程序中使用。 我处理通过应用单付款,然后在售后的PayPal确认字典传递到我的服务器进行确认(通过PayPal作为指示)PayPal REST API - '发生了内部服务错误'

然而,当我试图确认服务器上出售我收到“发生内部服务错误'。

这里是贝宝确认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帐户交易不是信用卡一。我正在使用SANDBOX模式

+0

也许这确实是一个内部错误,他们的结局,这将在稍后解决? –

+1

在贝宝状态页面上没有提到有关沙箱被关闭的信息。我倾向于在我身边的错误只是不知道什么 – Zigglzworth

回答

0

原来我使用了错误的请求。我应该使用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); 


    } 
} 
相关问题