I am new to working with JSON in PHP. I want to help a friend on his software developed using PHP. There is payment integration which the interswitch requires URL where they can be posting JSON parameter upon every successful payment to help him keep track of the payment activities. The parameters are as follows
PaymentLogId String
CustReference String
Amount Numeric
PaymentReference String
IsReversal Boolean
PaymentDate DateTime
BankName String
CustomerName String
ItemName String
CustomerAddress String
The payment gateway insisted that he should write code that can capture the above JSON parameters and update his database.
I have:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, 'https://');
$result = curl_exec($ch);
curl_close($ch);
$obj = json_decode($result);
echo $obj->firstname;
?>
But seems there should be address to fetch the information and they refused to give any address.