跳到內容

Function: createLinePayClient() ​

ts
function createLinePayClient(config): LinePayClient;

Defined in: src/client.ts:147

Create a client. It does not connect to anything and keeps no global state, so creating one per merchant is cheap.

Parameters ​

config ​

LinePayConfig

Returns ​

LinePayClient

Example ​

ts
const linePay = createLinePayClient({
  channelId: process.env.LINE_PAY_CHANNEL_ID ?? '',
  channelSecretKey: process.env.LINE_PAY_CHANNEL_SECRET ?? '',
  env: 'sandbox'
})

Throws ​

when the configuration is invalid.

Released under the MIT License. An independent library, not made or endorsed by LINE Pay.