A PHP library to integrate with eWAY's Rapid Payment API.

Overview

eWAY Rapid PHP Library

Latest Version on Packagist Software License Build Status

A PHP library to integrate with eWAY's Rapid Payment API.

Sign up with eWAY at:

For testing, get a free eWAY Partner account: https://www.eway.com.au/developers

Install

This library requires PHP version 5.4.0 or greater, with the curl, json and openssl extensions.

Using Composer

The eWAY PHP SDK can be install via Composer - this is the recommended method

$ composer require eway/eway-rapid-php

Then use Composer's autoload to include the library:

require_once 'vendor/autoload.php';

Manual

The eWAY PHP SDK can also be downloaded and added without Composer:

  1. Download the latest zip (or git clone this repository)
  2. Unzip the zip into your project - for example into a lib directory
  3. Include the eWAY SDK:
require_once 'lib/eway-rapid-php-master/include_eway.php';

Usage

See the eWAY Rapid API Reference for usage details.

A simple Direct payment:

require('vendor/autoload.php');

$apiKey = 'YOUR-API-KEY';
$apiPassword = 'YOUR-API-PASSWORD';
$apiEndpoint = \Eway\Rapid\Client::MODE_SANDBOX;
$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$transaction = [
    'Customer' => [
        'CardDetails' => [
            'Name' => 'John Smith',
            'Number' => '4444333322221111',
            'ExpiryMonth' => '12',
            'ExpiryYear' => '25',
            'CVN' => '123',
        ]
    ],
    'Payment' => [
        'TotalAmount' => 1000,
    ],
    'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE,
];

$response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::DIRECT, $transaction);
if ($response->TransactionStatus) {
    echo 'Payment successful! ID: '.$response->TransactionID;
}

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

Tests are written with PHPUnit. They can be run using Composer:

$ composer test

License

The MIT License (MIT). Please see License File for more information.

You might also like...
PHP 7+ Payment processing library. It offers everything you need to work with payments: Credit card & offsite purchasing, subscriptions, payouts etc. - provided by Forma-Pro

Supporting Payum Payum is an MIT-licensed open source project with its ongoing development made possible entirely by the support of community and our

Alipay driver for the Omnipay PHP payment processing library

Omnipay: Alipay Alipay driver for the Omnipay PHP payment processing library Omnipay is a framework agnostic, multi-gateway payment processing library

UnionPay driver for the Omnipay PHP payment processing library

Omnipay: UnionPay UnionPay driver for the Omnipay PHP payment processing library Omnipay is a framework agnostic, multi-gateway payment processing lib

First Data driver for the Omnipay PHP payment processing library

Omnipay: First Data First Data driver for the Omnipay PHP payment processing library Omnipay is a framework agnostic, multi-gateway payment processing

Midtrans Payment API CodeIgniter 4

⚠️ ⚠️ ANNOUNCEMENT ⚠️ ⚠️ Please use the updated and composer compatible library: Midtrans PHP. For better more modern composer compatibility. This rep

This document provides the details related to Remittance API. This APIs is used to initiate payment request from Mobile client/others exchange house.

City Bank Remittance API This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. Installation You c

Integrate your PHP application with your HTTP caching proxy

FOSHttpCache Introduction This library integrates your PHP applications with HTTP caching proxies such as Varnish. Use this library to send invalidati

A first party module to integrate Elastic App Search in Magento 2.
A first party module to integrate Elastic App Search in Magento 2.

A first-party Magento integration for building excellent, relevant search experiences with Elastic App Search. ⚠️ This is a beta version of the client

A Magento 2 module to integrate Relay.

Magento Relay Installation First, install Relay as a PHP extension for your CLI and FPM environments. Next, install the Magento module: composer requi

Owner
null
With the help of the Laravel eCommerce CashU Payment Gateway, the admin can integrate the CashU payment method in the Bagisto store.

Introduction Bagisto CashU Payment add-on allow customers to pay for others using CashU payment gateway. Requirements: Bagisto: v1.3.2 Installation wi

Bagisto 2 Aug 22, 2022
CPAY is a sdk that encapsulates the Orange Money api with an intuitive syntax allowing you to integrate the Orange Money payment into your PHP project.

CPAY CHOCO PAY is a sdk that encapsulates the Orange Money api with an intuitive syntax allowing you to integrate the Orange Money payment into your P

faso-dev 1 Oct 26, 2022
Integrate Paytm Payment gateway to php website.

paytm-integration-kit-project-for-PHP Integrate Paytm Payment gateway to php website. Copy PaytmKit folder in document root of your server (like /var/

Er. Dipankar Mohanta 1 Feb 11, 2022
Production-grade rapid controller development with built in love for API and Search

Installation For CakePHP 4.x compatible version: composer require friendsofcake/crud For CakePHP 3.x compatible version: composer require friendsofca

Friends Of Cake 357 Jan 2, 2023
The whmcs payment module for TigoPesa Payment Gateway.

whmcs-tigopesa INSTALLATION INSTRUCTIONS TIGOPESA WHMCS Please follow the instructions below to setup the whmcs-tigopesa gateway module. Download zipp

Medson Naftali 3 Dec 11, 2021
The Laravel eCommerce Accept Payment Gateway allows the customer to make use of Accept payment gateway in the Bagisto eCommerce website.

Introduction Bagisto WeAccept add-on allow customers to pay for others using WeAccept payment gateway. Requirements: Bagisto: 1.3.2 Installation with

Bagisto 2 May 31, 2022
PHP implementation of Rapid Automatic Keyword Exraction algorithm (RAKE) for extracting multi-word phrases from text

PHP implementation of Rapid Automatic Keyword Exraction algorithm (RAKE) for extracting multi-word phrases from text.

Assisted Mindfulness 7 Oct 19, 2022
This is a port of the original WireGuard UI bits as implemented by Netgate in pfSense 2.5.0 to a package suitable for rapid iteration and more frequent updating on future releases of pfSense.

This is a port of the original WireGuard*** UI bits as implemented by Netgate in pfSense 2.5.0 to a package suitable for sideloading and more frequent updating on future releases of pfSense. This also includes some improvments such as a proper status page (found under Status / WireGuard Status) and improved assigned interface handling.

R. Christian McDonald 195 Dec 23, 2022
A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.

Motan Overview Motan is a cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services. Related

Weibo R&D Open Source Projects 5.8k Dec 20, 2022
A framework agnostic, multi-gateway payment processing library for PHP 5.6+

Omnipay An easy to use, consistent payment processing library for PHP Omnipay is a payment processing library for PHP. It has been designed based on i

The League of Extraordinary Packages 5.7k Dec 30, 2022