parkwayprojects/paywithbank3d-php

A PHP API wrapper for PayWithBank3D.

0.0.2 2020-07-27 08:11 UTC

This package is auto-updated.

Last update: 2024-08-27 17:32:17 UTC


README

Latest Version on Packagist Build Status Quality Score Total Downloads

PayWithBank3D PHP is a library for using the PayWithBank3D API from PHP.

Installation

You can install the package via composer:

composer require parkwayprojects/paywithbank3d-php

Usage

First you initialize the library with your public key, secret key and option(live or staging)

$bank3d = \ParkwayProjects\PayWithBank3D\PayWithBank3D::setup('Public Key', 'Secret Key', 'staging');

Transaction

initialize a transaction

\ParkwayProjects\PayWithBank3D\Transaction::addBody('reference', time())
            ->addBody('amount', '100000')
            ->addBody('currencyCode', 'NGN')
            ->addBody('customer', [
                'name' => 'Edward Paul',
                'email' => 'infinitypaul@live.com',
                'phone' => '0848494839'
            ])
            ->addBody('returnUrl', 'https://infinitypaul.com')
            ->addBody('color', '#FF0000')
            ->addBody('metadata', [
                'orderId'=> '1234'
            ])->getAuthorizationUrl()->redirectNow();

This will automatically take you to secure payment page on PayWithBank3D, Once payment is completed, you are redirected to the url you specify in the returnURL

Verify Transaction

\ParkwayProjects\PayWithBank3D\Transaction::verify();

This return the status of the payment you just made and some other values of the transaction

Configuration Parameters

Testing

composer test

Credits

License

The MIT License (MIT). Please see License File for more information.