This might be simple to some but a challenge to me. Well from a documentation, I am getting JSON object in the body of the POST request. The format is shown below.
Question how do I decode the json object when they have not given the variable name of the json object. I thought I would get a variable name so that I would decode this way $data = json_decode($jsonFromSource);
I can not figure out a way to do the same, anyone? Thanks.
Direction from documentation: The POST request will be sent to a URL provided by the enterprise. The following POST parameters that will be passed will be as follows
The parameters passed above will be contained in a JSON object in the body of the POST request. Link to the brief documentation https://app.kopokopo.com/push_api
{
"service_name" : "MPESA",
"business_number" : "888555",
"transaction_reference" : "DE45GK45"
"internal_transaction_id" : 3222
"transaction_timestamp" : "2013-03-18T13:57:00Z"
"transaction_type" : "Paybill"
"account_number" : "445534"
"sender_phone" : "+254903119111"
"first_name" : "John"
"middle_name" : "K"
"last_name" : "Doe"
"amount" : 4000
"currency" : "KES"
"signature" : "dfafwerewKkladaHOKJdafdf"
}