1. Go to this page and download the library: Download rohit/line-pay 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/ */
[
'status' => 'success' or 'failed',
'data' => [
'request' => 'Params you send while calling the function (You may need to save it to log for future)',
'response' => 'Array response (You may need to save it to log for future)',
],
]
The response will be empty [] or as follows:
[
'returnCode' => '0000' (if success) or other code,
'returnMessage' -> 'OK',
'info' => [
'transactionId' => 'Transaction Id eg: 12345678',
'paymentUrl' => [
'web' => 'Payment url for web.' (Need to redirect to this for payment),
'app' => 'Payment url for app',
],
'paymentAccessToken' => 'Access Token for Payment'
],
]
LinePay::verifyPayment($transactionId, $params);
[
'status' => 'success' or 'failed',
'data' => [
'request' => 'Params you send while calling the function (You may need to save it to log for future)',
'response' => 'Array response (You may need to save it to log for future)',
],
]
If payment Type is NORMAL the response will be as follow:
[
'returnCode' => '0000' (if success) or other code,
'returnMessage' -> 'OK',
'info' => [
'orderId' => 'OrderID of the payment',
'transactionId' => 'Transaction Id',
'payInfo' => [
[
'method' => 'BALANCE',
'amount' => '10',
],
[
'method' => 'DISCOUNT',
'amount' => '10',
],
],
],
]
If payment Type is PREAPPROVED the response will be as follow:
[
'returnCode' => '0000' (if success) or other code,
'returnMessage' -> 'OK',
'info' => [
'orderId' => 'OrderID of the payment',
'transactionId' => 'Transaction Id',
'payInfo' => [
[
'method' => 'CREDIT_CARD',
'amount' => '10',
'creditCardNickName' => 'test',
'creditCardBrand' => 'VISA',
],
'regKey' => 'Random reg Key',
],
],
]
LinePay::verifyPayment($transactionId, $params);
[
'status' => 'success' or 'failed',
'data' => [
'request' => 'Params you send while calling the function (You may need to save it to log for future)',
'response' => 'Array response (You may need to save it to log for future)',
],
]
The response will be empty [] or as follows:
[
'returnCode' => '0000' (if success) or other code,
'returnMessage' -> 'OK',
'info' => [
'orderId' => 'The order id',
'transactionId' => 'Transaction Id eg: 12345678',
'info' => [
[
'method' => 'BALANCE',
'amount' => 10,
],
[
'method' => 'DISCOUNT',
'amount' => 10,
],
],
],
]
LinePay::voidPayment($transactionId);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.