可以使用庫API按照此步驟存儲信用卡在貝寶
第1步:生成訪問令牌通過OAuth令牌請求
嘗試在郵遞員
Url :- https://api.sandbox.paypal.com/v1/oauth2/token
Headers :- (Key,Value)
1.(Accept , application/json)
2.(Accept-Language , en_US)
3.(Content-Type , application/x-www-form-urlencoded)
4.(Authorization , Basic<Space>(here your code generated by postman))
注意: - 通過選擇授權選項卡==>基本身份驗證,然後輸入paypal客戶端密鑰和客戶端ID,在post man中生成一個基本身份驗證。
Body :- (Key,Value)
1.(grant_type,client_credentials)
注: - 選擇X WWW的形式,進行了urlencoded在郵遞員體片
第2步:使用valut API 嘗試在郵遞員商店信用卡
Url :- https://api.sandbox.paypal.com/v1/vault/credit-cards
Headers :- (Key,Value)
1.(Accept , application/json)
2.(Accept-Language , en_US)
3.(Content-Type , application/x-www-form-urlencoded)
4.(Authorization , Bearer(your Access Token))
Body : (Json)
{
"payer_id": "user12345",
"type": "visa",
"number": "4111111111111111",
"expire_month": "11",
"expire_year": "2018",
"first_name": "Joe",
"last_name": "Shopper",
"billing_address": {
"line1": "52 N Main ST",
"city": "Johnstown",
"state": "OH",
"postal_code": "",
"country_code": "US"
}
}
注意: - 在郵遞員身上選擇原始標籤。
你能夠產生訪問令牌? –