2015-04-23 60 views
2

我正在嘗試使用REST API創建支付功能,並且我有幾個錯誤。沙盒上的支付錯誤

雖然我送這個請求:

{"sender_batch_header":{"sender_batch_id":"test_0","email_subject":"RaceBets Withdrawal","recipient_type":"PAYPAL_ID"},"items":[{"recipient_type":"PAYPAL_ID","amount":{"currency":"EUR","value":"20.0"},"receiver":"XXXX","note":"Hello there!","sender_item_id":"71292226"}]} 

我收到:

JAXBException occurred : 4 counts of IllegalAnnotationExceptions. 

或:

{"name":"REQUIRED_SCOPE_MISSING","message":"Access token does not have required scope.","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#REQUIRED_SCOPE_MISSING"} 

第二誤差也奇怪,因爲支付工作正常,和範圍也很好

{"scope":"https://uri.paypal.com/services/subscriptions https://api.paypal.com/v1/payments/.* https://api.paypal.com/v1/vault/credit-card https://uri.paypal.com/services/applications/webhooks openid https://uri.paypal.com/services/invoicing https://api.paypal.com/v1/vault/credit-card/.*","access_token":"xxx","token_type":"Bearer","app_id":"APP-xxx","expires_in":28800} 

任何想法?

回答

2

對於第二個錯誤,請確保您已在您的應用程序下的developer.paypal.com上檢查了「支出」選項。

轉到developer.paypal.com - > DashBoard - >我的APP - >點擊您的APP名稱 - >應用程序功能。在此處選擇付款。

enter image description here

1

關於REQUIRED_SCOPE_MISSING錯誤,我經歷了這一點。添加範圍作爲其他海報描述解決了問題。

請注意,在更改範圍(即添加付款)後,可能需要幾小時才能反映更改,因此您將繼續收到錯誤一段時間。當我測試時,這讓我感到困惑,因爲我不希望沙箱有這種延遲。