1. Go to this page and download the library: Download kyrax324/laravel-ipay88 library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kyrax324 / laravel-ipay88 example snippets
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();
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
}
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
}
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
}