【发布时间】:2015-12-03 14:31:27
【问题描述】:
我正在尝试使用 cURL 在我的网站上添加 PayPal 付款,我找到了如何获取访问令牌,但我不知道如何将此请求(由 PayPal 开发人员提供)转换为 PHP cURL 以继续付款。
curl -v https://api.sandbox.paypal.com/v1/payments/payment \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <Access-Token>' \
-d '{
"intent":"sale",
"redirect_urls":{
"return_url":"http://example.com/your_redirect_url.html",
"cancel_url":"http://example.com/your_cancel_url.html"
},
"payer":{
"payment_method":"paypal"
},
"transactions":[
{
"amount":{
"total":"7.47",
"currency":"USD"
}
}
]
}'
【问题讨论】: