larium / pay
A unified API to access different payment gateways.
0.5.0
2023-06-24 12:35 UTC
Requires
- php: >=8.1
- ext-curl: *
- ext-simplexml: *
- larium/credit-card: ^2.0
- larium/http-client: ^2.0
- php-http/discovery: ^1.15
- psr/http-message: ^1.0
Requires (Dev)
- laminas/laminas-diactoros: ^2.0
- php-http/mock-client: ^1.5
- phpunit/phpunit: ^10.0
Suggests
- guzzlehttp/psr7: Provides PSR-7 Message Implementation
- laminas/laminas-diactoros: Provides PSR-7 Message Implementation
README
A unified API to access different payment gateways.
Basic usage
<?php use Larium\CreditCard\CreditCard; use Larium\Pay\Gateway\MyGateway; //Use a gateway use Larium\Pay\Transaction\PurchaseTransaction; # Set up a Card object $card = new CreditCard([ "holderName" => "John Doe", "number" => "41111111111111", "month" => "12", "year" => "2020", "cvv" => "123" ]); # Set up a transaction $amount = 1000; # Amount in cents. $txn = new PurchaseTransaction($amount, $card); # Set up the gateway $options = [ 'login'=>'user-login', 'password'=>'SeCRetPasSwoRd', ]; $gateway = new MyGateway($options); $response = $gateway->execute($txn); $response->isSuccess(); # true or false echo $response->getTransactionId(); # Get unique id reference.