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
Code | Description |
---|---|
0000 | Before authorization |
0110 | Completed authorization - Able to call the Confirm API |
0121 | Payment canceled by user or because of timeout (20min). - Completed status |
0122 | Payment failed - Completed status |
0123 | Payment completed - Completed status |
Error
Code | Description |
---|---|
1104 | Non-existing merchant |
1105 | The merchant cannot use the LINE Pay. |
9000 | An 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)
)