@terap.io/csob-payment-gateway
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

Č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)

Readme

Keywords

none

Package Sidebar

Install

npm i @terap.io/csob-payment-gateway

Weekly Downloads

3

Version

1.2.3

License

ISC

Unpacked Size

53.3 kB

Total Files

35

Last publish

Collaborators

  • la.stef