cave/omnipay-aps

Omnipay driver for Amazon Payment Services

v0.3 2021-09-28 20:06 UTC

This package is auto-updated.

Last update: 2024-02-29 01:35:10 UTC


README

APS driver for the Omnipay PHP payment processing library

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP. This package implements Amazon Payment Services (APS) support for Omnipay.

Installation

Omnipay is installed via Composer. To install, simply require league/omnipay and cave/omnipay-aps with Composer:

composer require league/omnipay cave/omnipay-aps

Basic Usage

The following gateways are provided by this package:

  • APS

For general usage instructions, please see the main Omnipay repository.

Example

Purchase

The result will be a redirect to the gateway or bank.

use Omnipay\Omnipay;

$gateway = Omnipay::create('APS');

$gateway->setTestMode(TRUE);
$gateway->setRequestPhrase('PASS');

//$gateway->setAccessCode('zx0IPmPy5jp1vAz8Kpg7')
//	->setAmount(10000) // amount * 100
//	->setMerchantIdentifier(123)
//	->setMerchantReference('random')
//	->setCustomerEmail('test@payfort.com')
//	->setOrderDescription('iPhone 6-S');
//	.... OR ....

$response = $gateway->purchase([
    'access_code' => 'zx0IPmPy5jp1vAz8Kpg7',
    'amount' => '10000', // amount * 100
    'merchant_identifier' => 'CycHZxVj',
    'merchant_reference' => 'XYZ9239-yu898',
    'currency' => 'AED', // default AED
    'language' => 'en', // default en
    'customer_email' => 'test@payfort.com',
    'order_description' => 'iPhone 6-S',
])->send();

// Process response
if ($response->isSuccessful()) {
    // Let's party!!!
} else {
    // Payment failed: display message to customer
    echo $response->getMessage();
}

The Purchase request combines Authorization and Capture in the same request (per APS' documentation). If you need to first authorize the amount you can call the Authorization request and then the Capture request separately.

Testing

composer test

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.