1. Go to this page and download the library: Download xahmedtaha/paybridge 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/ */
xahmedtaha / paybridge example snippets
use AhmedTaha\PayBridge\Data\ChargeData;
use AhmedTaha\PayBridge\Data\CustomerData;
use AhmedTaha\PayBridge\Data\Payment\CreditCardData;
use AhmedTaha\PayBridge\Enums\PaymentEnvironment;
use AhmedTaha\PayBridge\Enums\PaymentGateway;
$charge = new ChargeData('charge ID', 200, 'USD');
$customer = new CustomerData('customer ID', 'Ahmed', 'phone', '[email protected]');
$paymentData = new CreditCardData('1234 1234 1234 1234', '24', '05', '123');
$result = PayBridge::setEnvironment(PaymentEnvironment::TESTING)
->gateway(PaymentGateway::FawryPay)
->pay($charge, $customer, $paymentData);
// $result = [
// 'success' => true,
// 'status' => PaymentStatus::PENDING,
// 'shouldRedirect' => true,
// 'redirectUrl' => 'fawry gateway url...',
//];
use PayBridge;
use AhmedTaha\PayBridge\Enums\PaymentGateway;
use AhmedTaha\PayBridge\Enums\PaymentEnvironment;
use Illuminate\Http\Request;
public function callbackRouteHandler(Request $request) {
$result = PayBridge::setEnvironment(PaymentEnvironment::TESTING)
->gateway(PaymentGateway::FawryPay)
->callback($request);
// Your additional app logic...
}
// $result = [
// 'success' => true,
// 'status' => PaymentStatus::PAID,
// 'charge' => ChargeData object,
// 'customer' => CustomerData object,
// 'referenceNumber' => 'fawry ref no',
//];