0
我嘗試使用支付系統(bePaid)在我的網站上創建付款頁面。爲了進行付款,我需要創建令牌。 要創建令牌,我需要發送POST請求與驗證數據,標題和JSON參數付款系統url。將http驗證和標頭傳遞給modrestcurlclient請求
在純bash的形式,它看起來像
curl https://checkout.bepaid.by/ctp/api/checkouts -u shopId:shopKey -H 'Content-type: application/json' -d '
{
"checkout": {
"order": {
"amount": 1,
"currency": "USD",
"description": "Test"
},
"settings": {
"decline_url": "http://www.example.com/decline",
"fail_url": "http://www.example.com/fail",
"notification_url": "http://www.example.com/notify",
"success_url": "http://www.example.com/success"
},
"transaction_type": "payment",
"version": 2
}
}'
我的網站是在鏌鋣革命。我知道它有它自己的CURL客戶端。從文檔我看到如何發送請求
request(string $host, string $path, string $method = GET, array $params = array, array $options = array)
因此到$host
爲https://checkout.bepaid.by/ctp/api/checkouts,$path
是 '/',method
是POST,$params
是JSON。我不知道什麼是$options
。如果這是認證數據和頭文件 - 語法是什麼?如果沒有,我應該在哪裏通過這些信息?