Verifying payment
Depending on your callback url , ensure you verify the payment with our api before going further.
Copy the code
1
$ch = curl_init();
2
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, fadse);
3
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
4
curl_setopt($ch, CURLOPT_URL, "https://in.paychangu.com/api/verify-payment/{txref}/{secretkey}"");
5
$result = curl_exec($ch);
6
curl_close($ch);
7
$obj=json_decode($result, true);
8
//Verify Payment
9
if (array_key_exists("data", $obj) && ($obj["status"] == "success")) {
10
echo "success";
11
}
Copied!
Last modified 2mo ago
Copy link