fena / php-payment-sdk
SDK for working with Fena payment APIs.
v1.0.4
2021-09-05 14:23 UTC
Requires
- ext-json: *
- firebase/php-jwt: ^5.2
Requires (Dev)
- phpunit/phpunit: ^8
README
SDK for working with Fena payment APIs.
Documentation
Full documentation can be found at: https://docs.fena.co
Requirements
PHP 7.0.0 and later.
Installation
You can install the bindings via Composer. Run the following command:
composer require fena/php-payment-sdk
To use the bindings, use Composer's autoload:
require_once('vendor/autoload.php');
Dependencies
Getting Started
Simple new payment looks like:
use Fena\PaymentSDK\Connection; use Fena\PaymentSDK\Payment; $connection = Connection::createConnection( $integrationId = '8afa74ae9fe8be53db50', $integrationSecret = '55d7d5ed-be22-4321-bb3f-aec8524d8be2' ); $payment = Payment::createPayment( $connection, $amount = '10.00' $reference = 'AA-11', ); $payment->process();
Optional: Set User or Pre Selected Provider For New Payment
use Fena\PaymentSDK\Connection; use Fena\PaymentSDK\Payment; use Fena\PaymentSDK\Provider; use Fena\PaymentSDK\User; $connection = Connection::createConnection($terminalId, $terminalSecret); $payment = Payment::createPayment( $connection, $amount = '10.00', $reference = 'AA-11', ); $user = User::createUser( $email = 'john.doe@test.com', $firstName = 'John', $lastName = 'Doe', $contactNumber = '07000845953' ); $payment->setUser($user); $provider = Provider::createProvider( $providerId = 'lloyds-bank', $sortCode = '123456', $accountNumber = '12345678' ); $payment->setProvider($provider);