PHP Library that wraps endpoints documented https://documentation.opayweb.com/
- Cashier/Checkout - Get Paid with OPay
- Bank Transfer - Send money to any Nigerian bank account(s)
- OPay wallet Transfer - Send money to OPay USER/MERCHANT seamlessly
$ composer require opay/merchant-cashier-php
You need the library initialized as follows: (example in http_example/init.php file)
use Opay\MerchantCashier;
use Opay\MerchantTransfer;
$endpointBaseUrl = 'http://sandbox-cashierapi.opayweb.com';
$pubKey = 'OPAYPUBxxxxxxxxxxxxx.xxxxxxxxxxxxx';
$prvKey = 'OPAYPRVxxxxxxxxxxxxx.xxxxxxxxxxxxx';
$merchantId = '256620xxxxxxxxxxxxx';
$merchantCashier = new MerchantCashier("environment-endpoint-url", "Public_Key", "Private_Key", "your-merchant-id");
$merchantTransfer = new MerchantTransfer("environment-endpoint-url", "Public_Key", "Private_Key", "your-merchant-id");
Access sample codes & implementations right inside the http_example
folder
- initiate: http_example/accept_payment/order.php
- status query: http_example/accept_payment/order_status.php
- cancel payment: http_example/accept_payment/order_cancel.php
- handling payment callback: http_example/accept_payment/callback.php
- get supported countries: http_example/transfer/bank/get_countries.php
- get supported banks: http_example/transfer/bank/get_banks.php
- validate a bank account: http_example/transfer/bank/validate_account.php
- initiate transfer: http_example/transfer/bank/initiate.php
- status query: http_example/transfer/bank/order_status.php
- validate a user/customer: http_example/transfer/wallet/validate_user.php
- validate a merchant: http_example/transfer/wallet/validate_merchant.php
- initiate transfer: http_example/transfer/wallet/initiate.php
- status query: http_example/transfer/wallet/order_status.php