Download the PHP package yidas/line-pay-sdk without Composer

On this page you can find all versions of the php package yidas/line-pay-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package line-pay-sdk

LINE Pay SDK for PHP


LINE Pay SDK for PHP

Latest Stable Version License Total Downloads

English | 繁體中文

SDK Version Online API Version Offline API Version
v3 (Current) v3 v2
v2 v2 v2

OUTLINE


DEMONSTRATION

Sample Codes Site for LINE Pay (Request, Confirm, Refund)

LINE Pay API Tool for testing and loging APIs


REQUIREMENTS

This library requires the following:

Authentication

Each LINE Pay merchant Requires authentication information for LINE Pay integration, as shown below:

To get an LINE Pay Authentication:

  1. Merchant's verification information can be viewed at LINE Pay Merchant Center after evaluation process is complete.
  2. Login into LINE Pay Merchant Center, then get the ChannelId/ChannelSecret (Payment Integration Management > Manage Link Key).
  3. In LINE Pay Merchant Center, set IP white list for your servers (Payment Integration Management > Manage Payment Server IP) (v3 is not required).

You can immediately create a sandbox merchant account for test through LINE Pay Sandbox Creation.


INSTALLATION

Run Composer in your project:

composer require yidas/line-pay-sdk ~3.0.0

Then you could use SDK class after Composer is loaded on your PHP project:


USAGE

Before using any API methods, first you need to create a Client with configuration, then use the client to access LINE Pay API methods.

Client

Create a LINE Pay Client with API Authentication:

Device Information

You could set device information for Client (Optional):

Response

Each API methods will return yidas\linePay\Response object, which can retrieve data referred to LINE Pay JSON response data structure.

Retrieving Data

Response object provides response body data accessing by object attributes or array keys:

Retrieving as Object
Retrieving as Array

Methods

Response object has some helpful methods to use:

isSuccessful()

LINE Pay API result successful status (Check that returnCode is "0000")

Example:

getPaymentUrl()

Get LINE Pay API response body's info.paymentUrl (Default type is "web")

getPayInfo()

Get LINE Pay API response body's info.payInfo[] or info.[$param1].payInfo[] as array

toArray()

Get LINE Pay response body as array

toObject()

Get LINE Pay response body as object

getStats()

Get \GuzzleHttp\TransferStats object

Online APIs

For Web integration. Merchant will requests a payment and generates payment URL(QR code) to customer to scan by LINE App.

Flow: Refund

PC flow Mobile flow

Payment Details API

Gets the details of payments made with LINE Pay. This API only gets the payments that have been captured.

Example:

Request API

Prior to processing payments with LINE Pay, the Merchant is evaluated if it is a normal Merchant store then the information is requested for payment. When a payment is successfully requested, the Merchant gets a "transactionId" that is a key value used until the payment is completed or refunded.

Example:

The $bodyParams specification can be referred to Request API v3 Request Body

Confirm API

This API is used for a Merchant to complete its payment. The Merchant must call Confirm Payment API to actually complete the payment. However, when "capture" parameter is "false" on payment reservation, the payment status becomes AUTHORIZATION, and the payment is completed only after "Capture API" is called.

Example:

Refund API

Requests refund of payments made with LINE Pay. To refund a payment, the LINE Pay user's payment transactionId must be forwarded. A partial refund is also possible depending on the refund amount.

Example:

For Partial refund:

Check Payment Status API

An API to check payment request status of LINE Pay. The merchant should regularly check user payment confirm status without using the ConfirmURL and decide if it is possible to complete the payment.

Example:

Capture API

If "capture" is "false" when the Merchant calls the “Request API” , the payment is completed only after the Capture API is called.

Example:

Void API

Voids a previously authorized payment. A payment that has been already captured can be refunded by using the “Refund API”.

Example:

Pay Preapproved API

When the payment type of the Request API was set as PREAPPROVED, a regKey is returned with the payment result. Pay Preapproved API uses this regKey to directly complete a payment without using the LINE app.

Example:

Check RegKey API

Checks if regKey is available before using the preapproved payment API.

Example:

Expire RegKey API

Expires the regKey information registered for preapproved payment. Once the API is called, the regKey is no longer used for preapproved payments.

Example:

Offline APIs

For POS integration. Customer presents their barcode or QR code to merchants to scan at the POS machine.

Flow: OrdersRefund

Payment

This API is to process payment by reading MyCode provided from LINE Pay App with Merchant's device.

Example:

Payment Status Check

It's the API used when the final payment status can't be checked due to read timeout.

Example:

Void

This API is to void the authorization.

Example:

Capture

This API is to capture the authorized transaction.

Example:

Refund

This API is to refund after the payment completion (Captured data).

Example:

Authorization Details

This API is to search the authorization details. Only authorized or cancelled (Void or Expire) data can be searched and the data after capturing can be searched by The Payment Details API.

Example for searching transactionId:

Example for searching orderId:


EXCEPTIONS

Client throws exceptions for errors that occur during a API transaction.

ConnectException

A yidas\linePay\exception\ConnectException exception is thrown in the event of a networking error (Timeout).


RESOURCES

LINE Pay Online API v3 Guide (EN)

LINE Pay Offline API v2 Guide (EN)

LINE Pay Sandbox creation

LINE Pay OneTimeKeys Simulation

LINE Pay OneTimeKeys Simulation (For TW Merchant)

LINE Pay Online API v2 Documents PDF version (Multi-language)


REFERENCES

LINE Pay Developers - APIs


All versions of line-pay-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
guzzlehttp/guzzle Version ^6.3.0 || ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yidas/line-pay-sdk contains the following files

Loading the files please wait ....