I am newbie, working on codeigniter and I am using the razorpay payment gateway apis for transferring the amount using route concept as defined in the razorpay documentation. When I am calling the api using curl
I am getting the error:
{ "error": { "code": "BAD_REQUEST_ERROR", "description": "Please provide your api key for authentication purposes.", "source": null, "step": null, "reason": null, "metadata": {} } }
the code i used is :
$url = 'https://api.razorpay.com/v1/payments/pay_E8JR8E0XyjUSZd/transfers';
/* Array Parameter Data */
$data = ['account' => 'va_FWSvFCwsaV1w5K', 'amount' => 90, 'currency' => 'INR'];
/* pass encoded JSON string to the POST fields */
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
/* set the content type json */
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json','YOUR_KEY_ID','YOUR_KEY_SECRET'));
/* set return type json */
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
/* execute request */
$result = curl_exec($ch);
/* close cURL resource */
curl_close($ch);
print_r($result);
How should I place my key and secret in curl so that error does not occur.
Please help me out. Thanks in advance.