Click here to Skip to main content
15,895,833 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to fetch status which is success
Array
(
[status] => 1
[msg] => 1 out of 1 Transactions Fetched Successfully
[transaction_details] => Array
(
[41234567890123456789] => Array
(
[mihpayid] => 9876543210
[request_id] =>
[bank_ref_num] => 123456789012
[amt] => 1.01
[transaction_amount] => 1.00
[txnid] => 41234567890123456789
[additional_charges] => 0.01
[productinfo] => Test Info
[firstname] => TestName
[bankcode] => xxxxx
[udf1] =>
[udf3] =>
[udf4] =>
[udf5] =>
[field2] => xxxxxx
[field9] => Transaction Completed Successfully
[error_code] => xxxx
[payment_source] => xxxx
[card_type] => xxxxx
[error_Message] => NO ERROR
[net_amount_debit] => 1.01
[disc] => 0.00
[mode] => DC
[PG_TYPE] => XXXXXXXXX
[card_no] => 123456XXXXXX1234
[name_on_card] => xxxxxx
[udf2] =>
[addedon] => 2018-01-01
[status] => success
[unmappedstatus] => captured
[Merchant_UTR] => xxxxxxxxxxxx
[Settled_At] => 0000-00-00 00:00:00
)

)

)

What I have tried:

i have tried using multidimentional array
Posted
Updated 5-Jan-18 2:18am

1 solution

you can get the value of you array like:

echo $myarray[0]['status'];
echo $myarray[0]['request_id'];
 
Share this answer
 
Comments
RitikaPurohit 5-Jan-18 8:27am    
I have tried using this but i don't why as a result i am getting this only "<<"

Here is my code : if you help i would appreciate it. Thanks.

<?php
$key = "xxxxx";
$salt = "xxxxx";
$command = "verify_payment";
$var1 = "xxxxx"; // Transaction ID

$hash_str = $key . '|' . $command . '|' . $var1 . '|' . $salt ;
//gtKFFx|verify_payment|xxxxxxx|xxxxxx

$hash = strtolower(hash('sha512', $hash_str));

$r = array('key' => $key , 'hash' =>$hash , 'var1' => $var1, 'command' => $command);

$qs= http_build_query($r);
//$wsUrl = "https://test.payu.in/merchant/postservice.php?form=1";
$wsUrl = "https://info.payu.in/merchant/postservice?form=1";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $wsUrl);
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_POSTFIELDS, $qs);
curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 0);
$o = curl_exec($c);
if (curl_errno($c)) {
$sad = curl_error($c);
throw new Exception($sad);
}
curl_close($c);

$valueSerialized = @unserialize($o);
if($o === 'b:0;' || $valueSerialized !== false) {
print_r($valueSerialized);
}
else{

print_r($o);
echo $o[0]['status'];
echo $o[0]['request_id'];

}


?>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900