I am trying to figure out how to use Pin Payments API, function get charge.
https://pin.net.au/docs/api/charges#get-charge
As you can see they provide an example of the request using CURL
curl https://test-api.pin.net.au/1/charges/ch_bZ3RhJnIUZ8HhfvH8CCvfA -u your-secret-api-key:
I am just not sure how do I convert that to PHP, how do I pass my API key and how to pass charge ID so that the URL understood by the server.
Please help me comple the code below:
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'https://test-api.pin.net.au/1/charges/ch_bZ3RhJnIUZ8HhfvH8CCvfA',
));
$resp = curl_exec($curl);
curl_close($curl);