larium/pay

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

A unified API to access different payment gateways.

0.4.3 2020-06-06 12:01 UTC

README

Scrutinizer Code Quality Code Coverage Build Status

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.