From edf4e56cc00bfdb959ebdf102157da14da0bb77a Mon Sep 17 00:00:00 2001 From: Abdullah Al Noman <30390432+AbdullahValley@users.noreply.github.com> Date: Sun, 20 Jan 2019 23:18:07 +0600 Subject: [PATCH] Error Codes Updated --- bKash-for-Raw-PHP.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/bKash-for-Raw-PHP.php b/bKash-for-Raw-PHP.php index bb51e6e..d43d0aa 100644 --- a/bKash-for-Raw-PHP.php +++ b/bKash-for-Raw-PHP.php @@ -55,19 +55,20 @@ curl_close($curl); - if ($err) { - echo $err; - } + //print_r($response); // For Getting all Response Data. + + $api_response = json_decode ($response, true); // Getting Response from bKash API. + + $transaction_status = $api_response['transaction']['trxStatus']; // Transaction Status Codes + + + if ($err || $transaction_status == "4001") { + echo 'Problem for Sending Response to bKash API ! Try Again after fews minutes.'; + } else { - $api_response = json_decode ($response, true); // Getting Response from bKash API - - //print_r($response); // For Getting all Response Data - // Assign Transaction Information - $transaction_status = $api_response['transaction']['trxStatus']; // Transaction Status Codes - $transaction_amount = $api_response['transaction']['amount']; // bKash Payment Amount $transaction_reference = $api_response['transaction']['reference']; // bKash Reference for Invoice ID