Initialization

Here is the instructions on how to initialize the Wepin PIN Pad Library.

init

To create and initialize an instance of the Wepin PIN Pad Library, set the language to be displayed on the PIN pad screen during initialization.

// Create instance
const wepinPin = new WepinPin({
  appKey: 'your-wepin-app-key',
})
// Initialize
await wepinPin.init({
  defaultLanguage: 'ko',
})

Parameters

  • defaultLanguage: <string> It sets the default language of the widget. The default value is 'ko'. Currently supported languages are 'ko', 'en'and 'ja'

Return value

  • Promise<void>

Example

// Create instance
const wepinPin = new WepinPin({
  appKey: 'your-wepin-app-key',
})

or 

// Pass the created WepinLogin instance to WepinPin
const wepinLogin = new WepinLogin()
const wepinPin = new WepinPin({
  appKey: 'your-wepin-api-key',
  wepinLogin,
})
// Initialize
await wepinPin.init({
  defaultLanguage: 'ko',
})

Then, log in to Wepin using the Wepin Login Library.

// Execute the required login method based on the login method
const loginRes = await wepinPin.login.loginWithEmailAndPassword(...)
// Log in to Wepin
await wepinPin.login.loginWepin(loginRes)

isInitialized

It checks if the Wepin PIN Pad Library is initialized properly.

wepinPin.isInitialized()

Parameters

  • <void>

Return Value

  • <boolean> It returns true if init was successful, otherwise returns false.

Example

if(wepinPin.isInitialized()) {
  console.log('wepinPin is initialized!')
}

changeLanguage

wepinPin.changeLanguage(language)

Changes the language displayed on the PIN pad screen. Currently, only 'ko', 'en', and 'ja' are supported.

Supported Version

  • Supported from version 0.0.23 and later.

Parameters

  • language <string>

Return value

  • <void>

Example

wepinPin.changeLanguage("ko")

Last updated