1. Go to this page and download the library: Download jagdish-j-p/billdesk 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/ */
/**
* This will be called after the user approve the payment
* on the bank side
*
* @param Request $request
* @return Response
*/
public function callback(Request $request)
{
$response = $request->handle();
if ($response['response_format'] == 'JSON')
return response()->json(['response' => $response, 'billdesk_response' => $request->all()]);
dd($response, $request); // Remove this line and modify as per your needs.
// Update your order status
}
/**
* This will handle any direct call from BillDesk
*
* @param Request $request
* @return string
*/
public function webhook(Request $request)
{
$response = $request->handle();
// Update your order status
return 'OK';
}
use JagdishJP/Billdesk/Billdesk;
/**
* Returns status of transaction
*
* @param string $reference_id reference order id
* @return array
*/
$status = Billdesk::getTransactionStatus($reference_id);