Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
flutterwave-rn-pos
Advanced tools
Readme
Flutterwave POS React Native SDK is the official library that makes it easier to carry out transaction related actions on pos terminals
npm install flutterwave-rn-pos
or
yarn add flutterwave-rn-pos
Import the methods you want to use from the package in your JavaScript/TypeScript code:
import {
performKeyExchange,
performTransaction,
printReceipt,
performReprintAndEOD,
viewTransactionHistory,
} from 'flutterwave-rn-pos';
// key exchange
// ...
const result = await performTransaction(
200,
false,
['CARD', 'TRANSFER'],
'3.2.1'
);
A key exchange is done to get the terminal parameters. This should be performed upon launch of your application before you start making transactions. To do this, follow the steps below:
const ParameterResponse = await performKeyExchange(
'Flutterwave',
'https://flutterwave.com/waveLogo.png'
);
The merchantName
represents a unique identifier for your business and customLogoUrl
is an optional parameter for your custom logo.
To perform a transaction, you'll need the following parameters
Amount
shouldPrint
transactionTypes
and AppVersion
🚨 Note: The possible values for Transaction Types include: ‘CARD’, ‘TRANSFER’, ‘USSD’, ‘MOMO’, and ‘QR’.
const transactionResponse = await performTransaction(
200, // Amount
false, // Should Print
['CARD', 'TRANSFER'], // Transaction Types
'3.2.1' // App Version
);
Once the function is launched, the POS will take over and complete the card processing flow. When this is completed, the transaction details are returned as a json string.
To print a receipt, design your receipt such that each line represents an instance of the PrintField object. Add each line as a print field to a array. To do this, follow the steps below:
const printResponse = await printReceipt([
{
header: 'Flutterwave',
alignment: 'center',
textSize: 40,
bold: true,
},
{
header: 'RRN',
body: '1234567890',
bold: false,
alignment: 'left',
textSize: 30,
},
{
header: 'Amount',
body: '100.0',
bold: true,
alignment: 'center',
textSize: 30,
},
]);
When the terminal completes the printing process, A response is returned as a callback contain a json with the same pattern as the TransactionResponse but with the data field set to null.
To reprint transactions and perform end of day actions, follow the steps below:
const reprint = await performReprintAndEOD();
The POS will take over and complete the process once the function is launched.
To view all transactions that have been made on the POS device, follow the steps below:
const launchHistory = await viewTransactionHistory();
The POS will take over and complete the process once the function is launched.
For additional assistance using this library, contact the developer experience (DX) team via email or on slack.
You can also follow us @FlutterwaveEng and let us know what you think 😊.
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
By contributing to the {{language}} library, you agree that your contributions will be licensed under its MIT license.
Copyright (c) Flutterwave Inc.
FAQs
Flutterwave POS React Native SDK
The npm package flutterwave-rn-pos receives a total of 1 weekly downloads. As such, flutterwave-rn-pos popularity was classified as not popular.
We found that flutterwave-rn-pos demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.