Paya gateway for the Omnipay PHP payment processing library
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP. This package implements Paya (Nuvei) support for Omnipay.
Omnipay is installed via Composer. To install, simply require league/omnipay
and cmsmaxinc/omnipay-paya
with Composer:
composer require league/omnipay cmsmaxinc/omnipay-paya
The following gateways are provided by this package:
- Paya
For general usage instructions, please see the main Omnipay repository.
The following parameters are required when creating the gateway:
merchantId
- Your paya merchant IDusername
- Your paya API usernamepassword
- Your paya API passwordproductionWsdlUrl
sandboxWsdlUrl
Additionally, you can set:
testMode
- Set to true to use the sandbox environment
The gateway supports the following methods:
purchase()
- Authorize and capture a paymentrefund()
- Refund a previously captured payment
paya provides a sandbox environment for testing your integration. To use the sandbox:
-
Set the gateway to test mode:
$gateway->setTestMode(true);
-
Use the sandbox credentials provided by paya:
$gateway->setMerchantId('your-test-merchant-id'); $gateway->setUsername('your-test-username'); $gateway->setPassword('your-test-password'); $gateway->setProductionWsdlUrl(''); $gateway->setSandboxWsdlUrl('');
-
Set ACH account credentials
$achAccount = $gateway->createAchAccount([ // Bank account details 'routingNumber' => '123456789', 'accountNumber' => '987654321', 'accountType' => 'Checking', // Customer information 'firstName' => 'John', 'lastName' => 'Doe', 'billingAddress1' => '123 Main Street', 'billingAddress2' => 'Apt 456', 'billingCity' => 'Anytown', 'billingState' => 'CA', 'billingPostcode' => '12345', 'phone' => '555-123-4567', // Optional verification information 'dlState' => 'CA', 'dlNumber' => 'D1234567', 'courtesyCardId' => 'CC12345' ]); // Process a purchase transaction $purchaseResponse = $gateway->purchase([ 'requestId' => uniqid(), 'transactionId' => 'INV-' . time(), 'amount' => '50.00', 'achAccount' => $achAccount ])->send();
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 announcements, 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.