parkwayprojects/paywithbank3d-php
Composer 安装命令:
composer require parkwayprojects/paywithbank3d-php
包简介
A PHP API wrapper for PayWithBank3D.
README 文档
README
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
| Parameter | Required | Description |
|---|---|---|
| amount | True | Amount to be charged in kobo. |
| color | False | You get to choose a theme color for the payment modal that reflects your brand |
| customer | True | This is an object that contains customer details |
| False | Customer email address | |
| metadata | False | This is an object that allows you to add additional detail(s) to your request |
| phone | False | Phone number of customer |
| reference | False | Your unique transaction reference. |
| returnUrl | True | Url Redirected To After A Successful Payment. |
Testing
composer test
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-26