PHP code example of epmnzava / crdb-bank-mastercard-visa-laravel

1. Go to this page and download the library: Download epmnzava/crdb-bank-mastercard-visa-laravel 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/ */

    

epmnzava / crdb-bank-mastercard-visa-laravel example snippets


//.env
CARD_PAYMENT_ACCESS_CODE="given access code by CRDB"

CARD_PAYMENT_URL=  https://migs-mtf.mastercard.com.au/vpcpay

CARD_PAYMENT_SECURE_SECRET="Your given secure secret code"

CARD_PAYMENT_MERCHANT_ID="your merchant ID name"

CARD_PAYMENT_REDIRECT_URL="your redirect url"




namespace App\Http\Controllers;

use Epmnzava\Crdb\Crdb;

class PaymentController extends Controller
{
public function payOnline(){
$crdb = new Crdb;
$crdb->makepayment($card, $order_referenceId, $amount, $currency);

#example..
$redirect = $crdb->makepayment("Visa", 4434345, "4000", "TZS");
$redirect = $crdb->makepayment("MasterCard", 4434345, "4000", "TZS");

return redirect($redirect);

}

}