🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

fincra-checkout-react-native

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fincra-checkout-react-native

This is a react native library for implementing fincra payment gateway

0.0.7
latest
npm
Version published
Weekly downloads
6
-53.85%
Maintainers
1
Weekly downloads
 
Created
Source

fincra-checkout-react-native

This is a react native library for implementing fincra payment gateway

Features

  • Accept Payment with your Card, USSD & PayAttitude

Getting started

This React Native library provides a wrapper to add Fincra Payments to your React Native Andriod & iOS application

Install

npm install fincra-checkout-react-native --save

or with yarn

yarn add fincra-checkout-react-native

Usage

You can integrate this library into any React Native application by following two simple steps:

  • Include a screen in the React Native Navigator with the name FincraPaymentScreen.
  • Trigger the initiation process to launch the payment modal.

1. Add 'FincraPaymentScreen' Screen

import { FincraPaymentScreen } from "fincra-checkout-react-native";
//...
<NavigationContainer>
  <Stack.Navigator>
    // ...
    <Stack.Screen
      name="FincraPaymentScreen"
      component={FincraPaymentScreen}
      options={{ headerShown: false }}
    />
  </Stack.Navigator>
</NavigationContainer>;

2. Initiate payment widget

import { useFincraPayment, FincraInitiate } from "fincra-checkout-react-native";
//...

export default function PaymentScreen() {
  const { initiate } = useFincraPayment();

  final data = {
        publicKey: "pk_test_NjOjoxMzEyMzc=",
        amount: 3500,
        currency: "NGN",
        customerFirstName: "Test",
        customerLastName: "User",
        customerEmail: "customer@gmail.com",
        customerPhone: "081698661421",
        feeBearer: "customer",
        reference: "9876JLh023",
        paymentMethods: ["card", "bank_transfer", "payattitude"],
        defaultPaymentMethod: "card",
    }

const onClickHandler = ()=>{
  initiate({
        data,
        onSuccess: (response) => {
        console.log(response);
        },
    });
}

  return (
    <View>
      //...
      <Button
        title="Initiate Payment"
        onPress={onClickHandler}
      />
    </View>
  );
}

FAQs

Package last updated on 03 Mar 2024

Did you know?

Socket

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.

Install

Related posts