1. Go to this page and download the library: Download letuananh1873/fpx-payment 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/ */
'certificates' => [
'uat' => [
'disk' => 'local', // S3 or Local. Don't put your certificate in public disk
'dir' => '/public/fpx/uat',
],
'production' => [
'disk' => 'local', // S3 or Local. Don't put your certificate in public disk
'dir' => '/public/fpx/prod',
]
],
$schedule->command('fpx:banks')->daily();
<x-fpx-payment
:reference-id="$invoice->id"
:datetime="$invoice->created_at->format('Ymdhms')"
:amount="$invoice->total"
:customer-name="$company->name"
:customer-email="$company->owner->email"
:product-description="Salary Invoice"
:class="css class name for styling button">
<x-fpx-payment
:reference-id="$invoice->id"
:datetime="$invoice->created_at->format('Ymdhms')"
:amount="$invoice->total"
:customer-name="$company->name"
:customer-email="$company->owner->email"
:product-description="Salary Invoice"
:class="css class name for styling button"
test-mode>
/**
* This will be called after the user approve the payment
* on the bank side
*
* @param Request $request
* @return Response
*/
public function callback(Request $request) {
$response = $request->handle();
// Update your order status
}
/**
* This will handle any direct call from FPX
*
* @param Request $request
* @return string
*/
public function webhook(Request $request) {
$response = $request->handle();
// Update your order status
return 'OK';
}
use JagdishJP/FpxPayment/Fpx;
/**
* Returns status of transaction
*
* @param string $reference_id reference order id
* @return array
*/
$status = Fpx::getTransactionStatus($reference_id);
/**
* returns collection of bank_id and name
*
* @param bool $getLatest (optional) pass true to get latest banks
* @return \Illuminate\Support\Collection
*/
$banks = Fpx::getBankList(true);