liquido-payin-js-sdk
v2.0.0
Published
A library with client codes to integrate with the Liquido Payin API
Readme
Liquido PayIn JS SDK
It is a library that provides integration with Liquido PayIn API (Virgo) for JS projects.
Installing
npm install liquido-payin-js-sdk
Usage
import { Config, AuthService, PayInService } from "liquido-payin-js-sdk"
// false for sandbox env; true for production.
const isLiveMode = false
const configObj = new Config({
"merchhant-client-id",
"merchhant-client-secret",
"merchhant-client-api-key"
}, isLiveMode)
const authService = new AuthService(configObj)
const authResponse = await authService.getAccessToken()
const accessToken = authResponse.access_token
/*
Request body for PIX payin as example...
for more details, see: https://docs.liquido.com/payin/brazil/pix/
*/
const liquidoCreatePayInPayload = {
idempotencyKey: "hz-testpixdynamic-230703-001",
amount: 100,
currency: "BRL",
country: "BR",
paymentMethod: "PIX_DYNAMIC_QR",
paymentFlow: "DIRECT",
...
}
const payInService = new PayInService(configObj)
const payInResponse = await payInService.createPayIn(accessToken, liquidoCreatePayInPayload)Running Tests
All tests
npm run test
Code coverage
npm run test:coverage
