npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-nuvei

v0.1.0

Published

demo library

Readme

react-native-nuvei

Installation

With yarn:

yarn add react-native-nuvei

With npm:

npm install react-native-nuvei

For iOS you need to install pods:

cd ios && pod install

Dependencies

Native modules need to be installed so they can link to the SDK.

With yarn:

yarn add react-native-device-info react-native-webview @react-native-async-storage/async-storage @react-native-community/checkbox

With npm:

npm install react-native-device-info react-native-webview @react-native-async-storage/async-storage @react-native-community/checkbox

For iOS you need to install pods:

cd ios && pod install

Setup

Import the provider and wrap your application with it. The SDK relies on this context, so it must be accessible throughout your app.

import { NuveiProvider } from 'react-native-nuvei';

export default function App() {
  return (
    <NuveiProvider>
      <YourApp />
    </NuveiProvider>
  );
}

Open Order

Before initiating a payment, you need to fetch the order details using Nuvei's openOrder API.

API Reference:
https://docs.nuvei.com/api/main/indexMain_v1_0.html?json#openOrder

The response from this request of type OrderResponse will be passed to the payment component of your choice and will be referred to as the order throughout the documentation.

Make sure the response includes:

  • status = "SUCCESS"
  • sessionToken

Without these values, the payment flow will not proceed.

Nuvei Fields

Description

Nuvei fields is a component for paying with card. It includes the following fields: cardholder name, card number, expiry date, cvv and button, that triggers the payment.

Integration

Import the component:

import { NuveiFields } from 'react-native-nuvei';

The component expects the following props:


type Props = {
  paymentSettings: {  
    googlePayGateway: string;
    googlePayGatewayMerchantId: string;
    googlePayMerchantId: string;
    googlePayMerchantName: string;
  };
  order: OrderResponse;
  uiSettings:  type UiSettings = {
  customFonts: boolean;

  backgroundColor: ColorType;
  borderColor: ColorType;
  borderWidth: number;
  cornerRadius: number;
  labelFontSize: number;
  labelFontColor: ColorType;
  fieldFontSize: number;
  fieldFontColor: ColorType;
  fieldBackgroundColor: ColorType;
  fieldBorderColor: ColorType;
  fieldBorderWidth: number;
  fieldCornerRadius: number;
  errorFontSize: number;
  errorFontColor: ColorType;

  i18NTextManagement: boolean;
  i18NLabels: {
    cardHolderNameTitle: string
    cardHolderNamePlaceholder: string
    cardNumberTitle: string
    cardNumberPlaceholder: string
    expirationDateTitle: string
    expirationDatePlaceholder: string
    cvvTitle: string
    cvvPlaceholder: string

    numberEmpty: string
    creditCardInvalid: string
    expiryEmpty: string
    expiryInvalid: string
    cvvEmpty: string
    cvvInvalid: string
    holderNameEmpty: string
    holderNameInvalid: string
  }
};
;
  onSuccess: (response: any) => void;
  onFail: (response: any) => void;
  navigateToWebView: (webViewParams: any) => void;
  forceWebChallengeChecked: boolean;
  onInputValidated?: onInputValidatedType;
  onCardDetailsUpdated?: onCardDetailsUpdatedType;
};

type onInputValidatedType = (errors: string[]) => void;

type onCardDetailsUpdatedType = (
  output: any,
  error: {
    result: string;
    errorCode: number;
    errorDescription: string;
    rawResult: {};
  } | null
) => void;

type ColorType = 'black' | 'green' | 'yellow' | 'blue' | 'red' | 'transparent'

onInputValidatedType – a callback function invoked whenever input validation occurs.
It receives one parameter: an array of strings containing the validation errors.

onCardDetailsUpdated – a callback function invoked when a credit card number is validated.
It receives two parameters: output and error.

  • output contains the response from getCardDetails.do when the lookup succeeds.
  • error contains an error object if the lookup fails, in which case output will be null.

ColorType also accepts any valid hex color value (e.g. #FFFFFF, #000000).

i18NLabels object customizes the labels, placeholders and error messages of the fields.

Simply Connect

Simply Connect is a full-screen component that displays multiple payment methods such as Google Pay, Apple Pay, credit/debit cards, bank transfers, PayPal, and more.
It also allows users to save their payment methods for faster checkout in the future. Saved payment methods are shown on the same screen.

Because this component is intended to take over the full screen, the SDK does not handle navigation.
You need to import the component and register it in your own navigation flow. The example below uses @react-navigation/stack:

import { SimplyConnectScreen } from 'react-native-nuvei';

<Stack.Screen
    name="SimplyConnectScreen"
    component={SimplyConnectScreen}
    options={{ title: 'Simply Connect' }}
/>

Import useCheckout hook. IT accepts the following parameters:

  • order: OpenOrder;
  • settings
  • navigate - function that navigates to the Simply connect screen
  • onSuccess - callback for success
  • onFail - callback for error
  • checkoutI18NFields - optional customization of the labels, placeholders and the error messages

The hook returns a function that needs to be called when the user wants to proceed to checkout.

const useCheckout = (
  settings: {
  forceWebChallenge: boolean;
  enableInstallments: boolean;
  requirePersonalId: boolean;
},
  navigate: () => void,
  onSuccess: () => void,
  onFail: (error: { errorCode?: number; reason: string }) => void,
  checkoutI18NFields?: i18NFieldsType
)

type i18NFieldsType = {
  cardHolderNameTitle: string;
  cardHolderNamePlaceholder: string;
  cardNumberTitle: string;
  cardNumberPlaceholder: string;
  expirationDateTitle: string;
  expirationDatePlaceholder: string;
  cvvTitle: string;
  cvvPlaceholder: string;
  cvvPlaceholderAmex: string;
  installmentsProgramTitle: string;
  singlePaymentText: string;
  deferredWithInterestText: string;
  deferredWithoutInterestText: string;
  deferredWithoutInterestAndGraceText: string;
  numberOfInstallmentsTitle: string;
  personalIdTitle: string;
  personalIdPlaceholder: string;
  saveDetailsText: string;
  payButtonTitle: string;
  numberEmpty: string;
  creditCardInvalid: string;
  expiryEmpty: string;
  expiryInvalid: string;
  cvvEmpty: string;
  cvvInvalid: string;
  holderNameEmpty: string;
  holderNameInvalid: string;
  nationalityIdEmpty: string;
  nationalityIdInvalid: string;
};

The function accepts the order as a parameter.

const checkout = useCheckout(
    settings,
    navigate,
    onSuccess,
    onFail,
    checkoutI18NFields
)

checkout(  order: OrderResponse )`

Simple example using again @react-navigation/stack:

import { useNavigation } from '@react-navigation/native';

const navigation = useNavigation();

const checkout = useCheckout(
    {
      forceWebChallenge: false,
      enableInstallments: false,
      requirePersonalId: false,
    },
    () => navigation.navigate('SimplyConnectScreen'),
    () => {console.log('Successful payment!')},
    (error) => {console.log('Error while paying', error)},
    i18nFields, //your settings here
);

<Button onPress={() => checkout(order)}>Checkout</Button>

Alternatively you can use the SimplyConnectScreen component in a Modal.

import { SimplyConnectScreen } from 'react-native-nuvei';
const [visible, setVisible] = useState(false);

<Modal visible={visible}>
    <SimplyConnectScreen />
</Modal>

const checkout = useCheckout(
    ...,
    () => setVisible(true),
    ...
);

<Button onPress={checkout}>Checkout</Button>  

Google pay

To add google pay you need to import the component. It is a button that on click it triggers tyh payment.

import { GooglePayButton } from 'react-native-nuvei';

<GooglePayButton
    order={order}
    onSuccess={() => console.log('Successful payment!')}
    onError={(error) =>{console.log('Error while paying.', error)}}
/>

It accepts the following props:

  • order: OpenOrder
  • onSuccess: function that triggers when the payment is successful
  • onError: function that triggers when there is an error

Apple pay

To add google pay you need to import the component. It is a button that on click it triggers tyh payment.

import { GooglePayButton } from 'react-native-nuvei';

<ApplePayButton
    order={order}
    onSuccess={onSuccess}
    onError={onError}
    applePayMerchantId={applePayMerchantId}
/>

It accepts the following props:

  • order: OpenOrder
  • onSuccess: function that triggers when the payment is successful
  • onError: function that triggers when there is an error
  • applePayMerchantId

License

MIT


Made with create-react-native-library