我希望用户使用贝宝接受信用卡付款。所以我已经从应用程序授权用户并拨打此链接中提到的电话 https://developer.paypal.com/webapps/developer/docs/integration/direct/accept-credit-cards/
这是我在本地机器上提出的 curl 请求
curl -v https://api.sandbox.paypal.com/v1/payments/payment \
-H "Content-Type:application/json" \
-H "Authorization:Bearer 22SKUmLAeeKccfG-FmJdFiT97FLQnjSbeDHDN0hHdEQ" \
-d '{
"intent":"sale",
"payer":{
"payment_method":"credit_card",
"funding_instruments":[
{
"credit_card":{
"number":"4417119669820331",
"type":"visa",
"expire_month":11,
"expire_year":2018,
"cvv2":"874",
"first_name":"Joe",
"last_name":"Shopper",
"billing_address":{
"line1":"52 N Main ST",
"city":"Johnstown",
"country_code":"US",
"postal_code":"43210",
"state":"OH"
}
}
}
]
},
"transactions":[
{
"amount":{
"total":"7.47",
"currency":"USD",
"details":{
"subtotal":"7.41",
"tax":"0.03",
"shipping":"0.03"
}
},
"description":"This is the payment transaction description."
}
]
}'
我收到以下错误“401 Unauthorized”
任何人都可以帮助我在上面的电话中缺少什么。或进行信用卡付款需要任何其他范围。