k3rnel/omnipay-easy-pay

EasyPay gateway for Omnipay payment processing library

1.0.5 2023-12-20 08:31 UTC

This package is auto-updated.

Last update: 2024-05-03 09:54:02 UTC


README

EasyPay driver for the Omnipay Laravel payment processing library

Latest Stable Version Total Downloads

Omnipay is a framework-agnostic, multi-gateway payment processing library for PHP 5.5+. This package implements EasyPay support for Omnipay.

Installation

Omnipay is installed via Composer. To install, add it to your composer.json file:

{
    "require": {
        "k3rnel/omnipay-easy-pay": "^1.0"
    }
}

Run composer to update your dependencies:

composer update

Or you can run

composer require k3rnel/omnipay-easy-pay

Basic Usage

  1. Initialize EasyPay gateway:
    use Omnipay\Omnipay;
    use Omnipay\EasyPay\EasyPayGateway;

    $gateway = Omnipay::create(EasyPayGateway::class);
    $gateway->setMerchantId('12345678'); // E-Merchant unique ID provided by EasyPay after being integrated
    $gateway->setMerchantToken('8f11efa4-4041-4e28-a191-0cc01c4ff66c'); // Merchant token (key) provided by EasyPay after being integrated
  1. Call purchase, it will automatically redirect to EasyPay's hosted page
    $purchaseRequest = $gateway->purchase();
    $purchaseRequest->setTransactionId('123456'); // Order ID of the merchant system.
    $purchaseRequest->setAmount(5); // Transaction amount
  1. Create a controller to handle the callback request. This URL merchant should provide EasyPay during registration.
    $gateway = Omnipay::create(EasyPayGateway::class);
    $gateway->setMerchantId('12345678');
    $gateway->setMerchantToken('8f11efa4-4041-4e28-a191-0cc01c4ff66c');
    
    $fetchTransactionRequest = $gateway->fetchTransaction();
    $fetchTransactionRequest->setTransactionId('123456');

    $fetchTransactionResponse = $fetchTransactionRequest->send();
    
    if ($fetchTransactionResponse->isSuccessful()) {
        // Your logic is to mark the order as paid.
    }

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

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 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.