Skip to content

Amazon Payment Service driver for the the Omnipay PHP payment processing library

License

Notifications You must be signed in to change notification settings

cave/omnipay-aps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Omnipay: APS (Amazon Payment Service)

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('[email protected]')
//	->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' => '[email protected]',
    '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.

About

Amazon Payment Service driver for the the Omnipay PHP payment processing library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages