1.0.19 • Published 5 months ago

greenbanksdk-js-client v1.0.19

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

greenbanksdk-js-client

import * as Greenbank from 'greenbanksdk-js-client'

  let payload = {
      amount: 1, 
      currency: 'NGN', 
      description: 'Invoice payment Fee', 
      channels: ["flutterwave","paypal"], 
      customer_firstname: 'John', 
      customer_lastname: 'Eliam', 
      customer_email: 'user@onewattsolar.com', 
      redirect_url: "https://google.com",
      meta: {
        txntype: 'invoice_payment', 
        invoice_id: 134
      },
      callback: (res) =>{
        // example - do something
        console.log(res)
      },
      
      domain: 'test',
      merchant_key: apikey,
  }


  Greenbank.paymerchant(params)
      

createPaymentLink

import * as Greenbank from 'greenbanksdk-js-client'


  //method will return payment reference
  // merchant can then load the paymerchant page with the reference that was returned.
  // pass redirect_url
  // pass selected payment channels

  let params = {
    amount: 1, 
    currency: 'NGN', 
    description: 'Invoice payment Fee', 
    channels: ["flutterwave","paypal"], 
    customer_firstname: 'John', 
    customer_lastname: 'Eliam', 
    customer_email: 'user@onewattsolar.com', 
    redirect_url: "https://google.com",
    meta: {
      txntype: 'invoice_payment', 
      invoice_id: 134
    },
    onSuccess: (res) =>{
      // example - you can redirect to paymentlink here or just save the link
      window.location = new URL(res.data.link)
      console.log(res)
    },
    onError: (res) =>{
      alert('error occured')
      console.log(res)
    },
    onClose: () =>{
      alert('hello payment closed')
      console.log('colose')
    },
    domain: 'test',
    merchant_key: apikey,
  }
			
	Greenbank.createPaymentLink(params)
1.0.19

5 months ago

1.0.18

6 months ago

1.0.17

6 months ago

1.0.16

6 months ago

1.0.15

7 months ago

1.0.14

7 months ago

1.0.13

7 months ago

1.0.12

7 months ago

1.0.9

11 months ago

1.0.11

11 months ago

1.0.10

11 months ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago