harmonic / ezypay
A PHP SDK for the Ezypay v2.0 API
Requires
- bensampo/laravel-enum: ^1.19
- guzzlehttp/guzzle: ~6.0
- illuminate/support: ~5
Requires (Dev)
- mockery/mockery: ^1.1
- orchestra/testbench: ~3.0
- phpunit/phpunit: ~7.0
- sempro/phpunit-pretty-print: ^1.0
- vlucas/phpdotenv: ^3.4
This package is auto-updated.
Last update: 2024-12-16 13:45:53 UTC
README
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.