0
當我嘗試通過捲曲或成功郵遞員得到響應從刷新令牌獲得的access_token,獲得貝寶的訪問令牌從令牌刷新
REQUEST
POST /v1/oauth2/token HTTP/1.1
Host: api.sandbox.paypal.com
Content-Type: application/x-www-form-urlencoded
Authorization: Basic QVZZeWdRa2dSX3pScmtJT25PZXVz.....
Cache-Control: no-cache
grant_type=refresh_token&refresh_token=-Q1_6fEwUDQ0ci0CJIA......
結果
{
"scope":"phone https://uri.paypal.com/services/subscriptions https://api.paypal.com/v1/payments/.* address email https://api.paypal.com/v1/vault/credit-card https://uri.paypal.com/services/applications/webhooks https://uri.paypal.com/services/payments/futurepayments openid https://api.paypal.com/v1/vault/credit-card/.*","nonce":"2016-11-08T13:58:45Zm5eDiRGyJIDC9EwX7DRl6aB7IPlRl-cjoS_E3Ro8sCo",
"access_token":"A103.CfI6WQaDmEqrQ.....",
"token_type":"Bearer",
"app_id":"APP-80W28448....",
"expires_in":28796
}
但是,當我做貝寶網SDK這樣一回事,
var apiContext = PaypalConfiguration.GetAPIContext();
var tokenInfo = new Tokeninfo();
tokenInfo.refresh_token = "-Q1_6fEwUDQ0ci0CJIA7BtG_Ey4i....";
var refreshTokenParams = new CreateFromRefreshTokenParameters();
var token = tokenInfo.CreateFromRefreshToken(apiContext, refreshTokenParams);
我不斷收到這個響應,
{
"error_description":"POST /v1/oauth2/token returned a response status of 400 Bad Request",
"error":"400",
"correlation_id":"46ecefc761f3f",
"information_link":"https://developer.paypal.com/docs/api/#errors"
}
我的模式設置爲沙盒,客戶端ID和客戶端密鑰是正確的爲沙盒。
能否請你告訴我,我錯了或者有什麼問題Paypal-NET-SDK?