Check Payment Status API

Overview

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.

send

send(checkPaymentStatusRequestConfig)

Returns Promise<ApiResponse<CheckPaymentStatusResponseBody>>

Request Config

export type CheckPaymentStatusRequestParams = EmptyObject

export type CheckPaymentStatusRequestConfig = GeneralRequestConfig & {
  /**
   * Payment transaction ID generated by LINE Pay
   */
  transactionId: string
  /**
   * Request parameters of payment detail API
   */
  params: CheckPaymentStatusRequestParams
}

Response Body

export type Shipping = {
  /**
   * Shipping method ID selected by user
   */
  methodId: string
  /**
   * Shipping fee
   */
  feeAmount: number
}

export type Info = {
  /**
   * Shipping information
   */
  shipping?: Shipping
}

export type CheckPaymentStatusResponseBody = GeneralResponseBody & {
  /**
   * Payment information
   */
  info?: Info[]
}

Return Code

Success

CodeDescription
0000Before authorization
0110Completed authorization - Able to call the Confirm API
0121Payment canceled by user or because of timeout (20min). - Completed status
0122Payment failed - Completed status
0123Payment completed - Completed status

Error

CodeDescription
1104Non-existing merchant
1105The merchant cannot use the LINE Pay.
9000An internal error

Example

Request

const res = await linePayClient.checkPaymentStatus
  .send({
    transactionId: '2021121600698709510',
    params: {}
  })

Response

{
  "body": {
    "returnCode": "0000",
    "returnMessage": "reserved transaction."
  },
  "comments": {}
}

addHandler

addHandler(handler)

Returns CheckPaymentStatusClient

Example:

client.addHandler(({ type, req, next, httpClient }) => {
  console.log(type) // checkPaymentStatus
  return next(req)
})

addHandlers

addHandlers(...handlers)

Returns CheckPaymentStatusClient

Example:

client.addHandlers(
  ({ req, next }) => next(req),
  ({ req, next }) => next(req),
  ({ req, next }) => next(req)
)
Last Updated:
Contributors: Sean Lin, Po-Wei Chen