【发布时间】:2013-12-24 04:30:33
【问题描述】:
我有以下代码
curl -v https://api.sandbox.paypal.com/v1/payments/payment \
-H 'Content-Type:application/json' \
-H 'Authorization:Bearer EEwJ6tF9x5WCIZDYzyZGaz6Khbw7raYRIBV_WxVvgmsG' \
-d '{
"intent":"sale",
"redirect_urls":{
"return_url":"http://example.com/your_redirect_url/",
"cancel_url":"http://example.com/your_cancel_url/"
},
"payer":{
"payment_method":"paypal"
},
"transactions":[
{
"amount":{
"total":"7.47",
"currency":"USD"
}
}
]
}'
我一直在尝试转换它,但我不知道该使用哪些参数。
如何将其转换为 PHP?
【问题讨论】:
-
是的,你可以转换它,文档应该会帮助很多:php.net/manual/en/book.curl.php 具体查看
curl_setopt来设置你设置的各种选项。祝你好运。