Payze is the best software platform for running an internet business. We handle money movement flow for our customers by giving them tools they need.
- Install payze package in your project
npm install @payze/payze-js
- Import payze-js SDK
import {Payze} from "@payze/payze-js";
- initialize payze
const payze = Payze('transactionId', {});
- include following html
<div id="card"> <div id="card-info"> </div> </div>
- Render Card Elements
payze.renderCardInfo();
- Validate Card Elements
this.payze.validateCardInfo().subscribe((valid) => { this.valid = valid; // true or false });
- Pay functionality
payze.pay();
// Payze SDK accepts 2 arguments: transactionId and styles object
// styles object is optional and can be used to customize card inputs
// Example usage:
const payze = Payze('transactionId', {
pan: 'font-size: 20px;',
name: 'background-color: red;',
date: 'font-size: 20px;background-color: #f00;',
cvv: 'font-size: 20px;color: #f00;border-radius: 10px;',
iframeHeight: '400', // height of iframe in pixels (default: 200)
panError: 'Card number is invalid!', // error message for pan input
expirationDateError: 'Date is invalid!', // error message for expiration date input
cardHolderError: 'Cardholder name is required!', // error message for cardholder name input
cvvError: 'CVV/CVC is required!', // error message for cvv/cvc input
cardHolderPlaceholder: 'Cardholder Name', // placeholder for cardholder name input
expirationDatePlaceholder: 'MM/YY', // placeholder for expiration date input
successCallback: successCallbackFunction, // success callback
errorCallback: errorCallbackFunction, // error callback
});
Parameters | Description |
---|---|
pan | Card Number input |
name | Cardholder Name input |
date | Expiration Date input |
iframeHeight | Iframe Height (Default: 200px) |
panError | Error message for pan (Card number) input |
expirationDateError | Error message for expiration date input |
cardHolderError | Error message for Cardholder name |
cvvError | Error message for CVV/CVC input |
cardHolderPlaceholder | Placeholder for cardholder name |
expirationDatePlaceholder | Placeholder for expiration date input |
successCallback | Success Callback function |
errorCallback | Fail Callback function |
Dependencies | Version |
---|---|
Rxjs | ^7.5.7 |
Distributed under the MIT License. See LICENSE.txt
for more information.