PHPackages                             rohit/line-pay - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. rohit/line-pay

ActiveLibrary[Payment Processing](/categories/payments)

rohit/line-pay
==============

Line Payment Package for Laravel

3.0.0(7y ago)41533MITPHPPHP &gt;=7

Since Jun 13Pushed 5y ago2 watchersCompare

[ Source](https://github.com/rohitsubedi/line-pay)[ Packagist](https://packagist.org/packages/rohit/line-pay)[ Docs](https://github.com/rohitsubedi/line-pay)[ RSS](/packages/rohit-line-pay/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (4)Versions (5)Used By (0)

Line Payment
============

[](#line-payment)

Very easy and light package for Line Payment.

Installation
------------

[](#installation)

### Composer

[](#composer)

Add Line Pay to your composer.json file

```
"rohit/line-pay": "^3.0"

```

Run `composer install` to get the latest version of package

Or you can directly run the `composer require` command

```
composer require rohit/line-pay

```

### Configuration

[](#configuration)

After the package install is completed you need to configure `config/app.php` and add `Providers` and `Aliases`

```
    'providers` => [
        .......
        .......
        Rohit\LinePay\LinePayServiceProvider::class
    ]
```

```
    'aliases' => [
        ......
        ......
        'LinePay' => Rohit\LinePay\Facades\LinePay::class
    ]
```

### Vendor Publish

[](#vendor-publish)

After the above steps, you need to publish vendor for this packge. It will create `line-pay.php` file under `config` folder. This folder contains the configuration for your locales.

```
php artisan vendor:publish --provider="Rohit\LinePay\LinePayServiceProvider"

```

The file `line-pay.php` will contain the following structure

```
    return [
        'channel-id' => 'Line Pay Channel Id',
        'channel-secret' => 'Line Pay Channel Secret',
        'reservation-url' => 'https://sandbox-api-pay.line.me/v1/payments/request',
        'detail-url' => 'https://sandbox-api-pay.line.me/v1/payments',
    ];
```

### Functions

[](#functions)

- #### Process Payment

    [](#process-payment)

    You can process your payment with the function process Payment which accepts array as an arguments with following

    ```
    LinePay::processPayment($params);
    ```

    The array params for processPayment is described below:

    ItemsDatatypeRequiredDescriptionRemarksproductNamestring (4000byte)YName of Product you want user to pay foramountnumericYAmount of the productcurrencystring (3byte)YPayment Currencysupported Currencies are `(USD, JPY, TWD, THB)`orderIdstring (100byte)YOrder Number corresponding to payment requestMust be unique for each orderconfirmUrlstring (500byte)YUrl to which Line will redirect after successful of paymentcancelUrlstring (500byte)NUrl to which Line will redirect when user cancel the paymentDefault redirect to request URL. No additional parameters is sent by LINEproductImageUrlstring (500byte)NUrl to Product Imagemidstring (50byte)NLine member IDoneTimeKeystring (12byte)NScanning and reading QR/Bar code information given by LINE pay app is used as LINE pay users's mid. Valid time is 5 minutes and it will be deleted with reserve at the same timeconfirmUrlTypestringNType of URL that the buyer is redirected to after selecting payment method and entering the payment password in LINE pay`CLIENT`: A user based URL `(DEFAULT)`.
     `SERVER`: A server based URLcheckConfirmUrlBrowserBooleanNWhen moved to confirmUrl. check a browser`true`: When a browser calling a payment and browser directing to confirmUrl are different LINE pay provides a guide page directing to a previous browser.
    `false`: Redirecting to confirmUrl without checking a browser `(DEFAULT)`packageNamestring (4000byte)NInformation to avoid phishing during transition between apps in AndroiddeliveryPlacePhonestring (100byte)NReceipent Contact NumberpayTypestring (12byte)NPayment Types`NORMAL`: Single Payment `(DEFAULT)`
    `PREAPPROVED`: Preapproved PaymentlangCdstringNLanguage code on the payment waiting screenSupported Languages are:
     - `ja` (Japanese)
     - `ko` (Korean)
     - `en` (English) `(DEFAULT)`
     - `zh-Hans` (Chinese Simplified)
     - `zh-Hant` (Chinese Traditional)
     - `th` (Thai)captureBooleanNWhether to capture or not- `true`: Payment authorization and capture are handled at once when the confirm payment API is called `(DEFAULT)`
     - `false`: A payment is compleed only after it is authorized and then separately captured by calling Capture API when confirm payment API is calledThe response from the process payment will be as below

    ```
    [
        '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'
        ],
    ]
    ```
- #### Verify Payment

    [](#verify-payment)

    After Successful payment from line, it redirects to the `confirmUrl`. Now we need to verify the payment from line before updating our order. Its a 3 way handshake for security. This function takes 2 arguments. TransactionId and the array of parameters.

    ```
    LinePay::verifyPayment($transactionId, $params);
    ```

    The array param for verifyPayment is described below:

    ItemsDatatypeRequiredDescriptionRemarksamountnumericYPayment AmountShould match with the amount on Process Payment for the given transaction Id.currencystring (3byte)YPayment CurrencyShould match with Currency on Process Payment for the given transaction Id.
     Supported Languages are:
     - `ja` (Japanese)
     - `ko` (Korean)
     - `en` (English) `(DEFAULT)`
     - `zh-Hans` (Chinese Simplified)
     - `zh-Hant` (Chinese Traditional)
     - `th` (Thai)
    The response from the verify payment will be as below

    ```
    [
        '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:

    ```
    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',
            ],
        ],
    ]
    ```
- #### Capture Payment

    [](#capture-payment)

    If `capture` is false while processing payment by `processPayment` function, then the payment is completed only after the Catpute API is called. This function completes the payment that was only authorized by `processPayment`. This function takes 2 arguments. TransactionId and the array of parameters.

    ```
    LinePay::verifyPayment($transactionId, $params);
    ```

    The array param for verifyPayment is described below:

    ItemsDatatypeRequiredDescriptionRemarksamountnumericYPayment AmountShould match with the amount on Process Payment for the given transaction Id.currencystring (3byte)YPayment CurrencyShould match with Currency on Process Payment for the given transaction Id.
     Supported Languages are:
     - `ja` (Japanese)
     - `ko` (Korean)
     - `en` (English) `(DEFAULT)`
     - `zh-Hans` (Chinese Simplified)
     - `zh-Hant` (Chinese Traditional)
     - `th` (Thai)
    The response from the verify payment will be as below

    ```
    [
        '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,
                ],
            ],
        ],
    ]
    ```
- #### Void Payment

    [](#void-payment)

    Voids a previously authorized payment. A payment that has been already captured can be refunded by this API

    ```
    LinePay::voidPayment($transactionId);
    ```

    The response from the void payment will be as below

    ```
    [
        'status' => 'success' or 'failed',
        'data' => [
            'request' => [],
            'response' => 'Array response (You may need to save it to log for future)',
        ],
    ]

    The response will be empty [] or as follows:
    [
        'statusCode' => '0000' (if success) or other code,
        'returnMessage' => 'OK',
    ]
    ```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~198 days

Total

4

Last Release

2661d ago

Major Versions

1.0.1 → 2.0.02017-06-28

2.0.0 → 3.0.02019-01-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/a166b313d7c600a2d045a399b324eabf9b2d058776aee69363247e8fcc482433?d=identicon)[rohitsubedi](/maintainers/rohitsubedi)

---

Top Contributors

[![rohitsubedi](https://avatars.githubusercontent.com/u/4637059?v=4)](https://github.com/rohitsubedi "rohitsubedi (13 commits)")

---

Tags

phplaravelpaymentline pay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rohit-line-pay/health.svg)

```
[![Health](https://phpackages.com/badges/rohit-line-pay/health.svg)](https://phpackages.com/packages/rohit-line-pay)
```

###  Alternatives

[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[omalizadeh/laravel-multi-payment

A driver-based laravel package for online payments via multiple gateways

491.1k](/packages/omalizadeh-laravel-multi-payment)[henryejemuta/laravel-monnify

A laravel package to seamlessly integrate monnify api within your laravel application

132.1k](/packages/henryejemuta-laravel-monnify)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
