1. Go to this page and download the library: Download msilabs/bkash library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
public function payment()
{
// your code
$response = $this->createPayment($amount, $invoice_id, $callback_url);
return redirect($response->bkashURL);
}
public function callback(Request $request)
{
$payment_id = $request->paymentID;
$status = $request->status;
if($paymentID && $status == 'success') {
$response = $this->executePayment($paymentID);
if($response->transactionStatus == 'Completed') {
$order_id = $response['merchantInvoiceNumber'];
$trxID = $response['trxID'];
// your code
}
}
// your code
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.