ks-pay-package-pvt
v2.0.7
Published
Payment processing utilities for KS Pay
Downloads
10
Maintainers
Readme
KS-PAY PAYMENT PACKAGE
Integrate package in your react application.
Prerequisites
- git
- npm
- react
Examples
Installation
import Gateways from "ks-pay-package-pvt";
BASIC EXAMPLE:
const [transactionPayload, setTransactionPayload] = useState({});
const payload = {
referenceNumber: "REFRENCE_NUMBER",
amount: "AMOUNT",
currencyId: "CURRENCY_ID",
paymentMethodId: "PAYMENT_METHOD_ID"
};
const headers = {
x-signature: "YOUR_APP_SIGNATURE",
environment: "URL"
};
const transactionStatusCallback = (payload) => {
setTransactionPayload(payload);
};
return (
<div>
<Gateways
payload={payload}
headers={headers}
userInfo={userInfo}
transactionStatusCallback={transactionStatusCallback}
/>
</div>
);
- FULL EXAMPLE:
import React, { useState } from "react";
import Gateways from "ks-pay-package-pvt";
export default function App() {
const payload = {
referenceNumber: "REFRENCE_NUMBER",
amount: "AMOUNT",
currencyId: "CURRENCY_ID",
paymentMethodId: "PAYMENT_METHOD_ID"
};
const headers = {
x-signature: "YOUR_APP_SIGNATURE",
environment: "URL"
};
const transactionStatusCallback = (payload) => {
setTransactionPayload(payload);
};
return (
<div>
<Gateways
payload={payload}
headers={headers}
userInfo={userInfo}
transactionStatusCallback={transactionStatusCallback}
/>
</div>
);
}