diff --git a/bKash-for-Laravel-Framework.php b/bKash-for-Laravel-Framework.php new file mode 100644 index 0000000..d6622e3 --- /dev/null +++ b/bKash-for-Laravel-Framework.php @@ -0,0 +1,170 @@ + 9081, + + CURLOPT_URL => $bkash_url, + + CURLOPT_RETURNTRANSFER => true, + + CURLOPT_ENCODING => "", + + CURLOPT_MAXREDIRS => 10, + + CURLOPT_TIMEOUT => 30, + + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + + CURLOPT_CUSTOMREQUEST => "GET", + + CURLOPT_HTTPHEADER => array( + + "cache-control: no-cache", + + "content-type: application/json" + + ), + + )); + + + $response = curl_exec($curl); + + $err = curl_error($curl); + + $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE); + + curl_close($curl); + + if ($err) { + echo $err; + } + 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. + + $transaction_time = $api_response['transaction']['trxTimestamp']; // bKash Transaction Time & Date. + + +// Return Transaction Information into Your Blade Template. + + return view('transaction.bkash', compact('transaction_status', 'transaction_amount', 'transaction_reference', 'transaction_time')); + + } + } + + + +// # # # # View # # # # // Laravel Blade File + +