@terap.io/csob-payment-gateway
v1.3.0
Published
CSOB payment gateway module
Downloads
9
Readme
ČSOB CZ payment modules
Source | Gateway documentation
Module for ČSOB CZ payment gateway
Instalation
npm i @terap.io/csob-payment-gateway
Usage
import { CSOBPaymentModule } from '@terap.io/csob-payment-gateway';
import Logger from 'bunyan'
const gateway = new CSOBPaymentModule({
// this is the sandbox api
gateUrl: 'https://iapi.iplatebnibrana.csob.cz/api/v1.9',
privateKey: "-----BEGIN RSA PRIVATE KEY-----...-----END RSA PRIVATE KEY-----",
merchantPublicKey: "-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----",
bankPublicKey: "-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----",
calbackUrl: 'https://example.com',
merchantId: 'id-given-by-CSOB',
logger: new Logger()
})
const payment = await gateway.init(gateway.createPaymentPayload({
orderNo: '1',
totalAmount: 400,
currency: Currency.CZK,
language: Language.CZ,
cart: [ {
name: 'banana',
quantity: 4,
amount: 400,
description: 'A basic banana'
} ]
}))
gateway.getRedirectUrl(payment.payId) // redirect user here
// you can also
await gateway.status(payment.payId)
await gateway.reverse(payment.payId)
await gateway.close(payment.payId)
await gateway.refund(payment.payId)