1.2.0 • Published 10 days ago

react-alfa-payment v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 days ago

react-alfa-payment

NPM npm GitHub

A Bank Alfalah Limited payment gateway component for React Apps for easy integration written in Typescript

  • This library currently supports Debit/Credit Card payments only
  • Other methods are planned to be supported in the upcoming releases

Installation

Install react-alfa-payment using npm

npm install --save react-alfa-payment

Or using yarn

yarn add react-alfa-payment

Demo

Click here to test

Usage/Examples

import ReactAlfaPayment from 'react-alfa-payment'

function App() {
  return (
      <ReactAlfaPayment 
        alfaConfig={{
            merchantId: '',
            storeId: '',
            channelId: '',
            merchantHash: '',
            merchantUsername: '',
            merchantPassword: '',
            redirectUrl: '',
            secretKey1: '',
            secretKey2: '',
            transactionReferenceNumber: '',
            transactionAmount: 100,
        }} 
        message="Proceed to Pay"
        className="btn-primary"
        isSandbox
    />
  )
}

Component Props

ParameterTypeRequiredDescription
alfaConfigobjecttrueScroll down to see the required properties
isSandboxbooleanfalseTo determine whether the current environment is a sandbox or not
messagestringfalseText to appear on submit button
classNamestringfalseCSS className
refreffalseSubmit button ref to trigger actions i.e click

Prop: alfaConfig

object containing all of the following (required) properties

  {
    merchantId: '',
    storeId: '',
    channelId: '',
    merchantHash: '',
    merchantUsername: '',
    merchantPassword: '',
    redirectUrl: '',
    secretKey1: '',
    secretKey2: '',
    transactionReferenceNumber: '',
    transactionAmount: 100,
  }

Acknowledgements

This project is generated from react-typescript-library template

License

MIT © Shahzaib

Links

linkedin\ twitter