使用 Instamojo 支付网关处理支付时Method \"POST\" not allowed
出现错误。不知道我在这里做错了什么。
$this->load->helper('url');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://test.instamojo.com/api/1.1/');
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //<---- add this line or attach ssl certi
curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-Api-Key:test_e7ae89197569462c232b303d30e",
"X-Auth-Token:test_a62220667c7197fc3a1ac17c1da"));
$payload = Array(
'purpose' => "Fifa 16",
'amount' => "3499",
'phone' => "990900909",
'buyer_name' => "Ajay Singh",
'redirect_url' => base_url().'Billing/paymentconfirmation',
'webhook' => base_url().'Billing/paymentconfirmation',
'send_email' => true,
'send_sms' => true,
'email' => "123@gmail.com",
'allow_repeated_payments' => false
);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($payload));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
从上面的代码中得到响应
{ "success": false, "message": "Method \"POST\" not allowed." }