kyrax324 / laravel-ipay88
IPay88 Payment Gateway Integration for Laravel Application
Installs: 7 086
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 1
Forks: 0
Open Issues: 1
Requires
- php: >=7.2
This package is auto-updated.
Last update: 2024-11-06 21:52:50 UTC
README
IPay88 Payment Gateway Integration for Laravel Application.
Installation
composer require kyrax324/laravel-ipay88
Configuration
Publish the config file & setup the merchantKey
and merchantCode
php artisan vendor:publish --provider="IPay88\IPay88ServiceProvider" --tag=config
Views (Optional)
If you wish to modify the payment form, you may publish the views
php artisan vendor:publish --provider="IPay88\IPay88ServiceProvider" --tag=views
Usage
According to IPay88 documentation, each payment order will undergoes the following steps:
- Prepare & Submit Request to IPay88 Server
- Handle Response from IPay88 Server
- Response (set from
responseURL
) - Backend Post (set from
backendURL
)
- Response (set from
- Requery to check payment status (If needed)
1. Prepare & Submit Request to IPay88 Server
IPay88\Request\RequestBuilder
- create payment request and return view
use IPay88\Request\RequestBuilder as IPay88RequestBuilder; $builder = new IPay88RequestBuilder(); $builder->setRefNo(1); $builder->setAmount(1); $builder->setCurrency('MYR'); $builder->setProdDesc('Sample Prod Desc'); $builder->setUserName('Sample User Name'); $builder->setUserEmail('Sample User Email'); $builder->setUserContact('Sample User Contact'); $builder->setResponseURL("http://sample.com/response_url"); $builder->setBackendURL("http://sample.com/backend_url"); return $builder->loadPaymentFormView();
2. Handle Response from IPay88 Server
IPay88\Request\Response
A. Response (set from responseURL)
use IPay88\Responses\Response as IPay88Response; $response = new IPay88Response($request); // logic to check if order has been updated before if($response->isSuccess()){ // update order to PAID }else{ // update order to FAIL }
B. Backend Post (set from backendURL)
Backend post will be called simultaneously with responseURL (if payment is success)
IPay88 Server will re-try to call up to 3 times on different interval if no ‘RECEIVEOK’ acknowledgement detected
use Ipay88\Responses\Response as IPay88Response; $response = new IPay88Response($request); // logic to check if order has been updated before if($response->isSuccess()){ // update order to PAID return "RECEIVEOK"; }else{ // update order to FAIL }
3. Requery to check payment status (If needed)
IPay88\Request\RequeryBuilder
use IPay88\Request\RequeryBuilder as IPay88RequeryBuilder; $builder = new IPay88RequeryBuilder(); $builder->setRefNo(1); $builder->setAmount(1); if($builder->isSuccess()){ // update order to PAID }else{ // update order to FAIL }
FAQ
For more information, kindly refer to IPay88 Integration FAQ
Issues
If you found any issue, please open a new issue