harmonic/ezypay

A PHP SDK for the Ezypay v2.0 API

v1.0.11 2019-09-11 02:45 UTC

This package is auto-updated.

Last update: 2024-04-16 12:17:42 UTC


README

Latest Version on Packagist Total Downloads Build Status StyleCI

A Laravel/PHP SDK for the Ezypay v2 API. Take a look at contributing.md to see a to do list.

Installation

Via Composer

$ composer require harmonic/ezypay

Publish config file

php artisan vendor:publish --provider="harmonic\Ezypay"

Alias

Optionally add Ezypay alias tp app.php config file:

'aliases' => [
	...
	'Ezypay' => harmonic\Ezypay\Facades\Ezypay::class,

Usage

Add Ezypay credentials to your .env file

EZY_PAY_WEBHOOK_CLIENT_KEY=YOUR_WEBHOOK_CLIENT_KEY
EZY_PAY_API_URL=https://api-global.ezypay.com
EZY_PAY_USER=your@email.com
EZY_PAY_PASSWORD=YOUR_PASSWORD
EZYPAY_INTEGRATOR_ID=YOUR_INTEGRATOR_ID
EZY_PAY_API_CLIENT_ID=YOUR_CLIENT_ID
EZY_PAY_CLIENT_SECRET=YOUR_SECRET
EZY_PAY_MERCHANT_ID=YOUR_MERCHANT_ID

All Ezypay API methods are availble via the Ezypay facade.

Simply call

Ezypay::methodName

Where methodName is any method from https://developer.ezypay.com/reference eg. createCustomer(), getCustomers()

Testing Facade

There is a testing facade available for your tests that will return fake data. In your tests:

use harmonic\Ezypay\Facades\Ezypay;

...

Ezypay::fake();

Then use Ezypay facade as normal.

Change log

Please see the changelog for more information on what has changed recently.

Tests

Add a .env file containing your Ezypay details, then:

$ vendor/bin/phpunit

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email craig@harmonic.com.au instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.