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 🙏

© 2025 – Pkg Stats / Ryan Hefner

valuepay-react-native

v1.1.0

Published

Official react-native package for the value payment solution provider service

Readme

valuepay-react-native

official react-native package for the Value Payment Solution Service Provider

Installation

npm install valuepay-react-native-lite

Dependency

This package requires [email protected], and is best suited with Typescript based react-native applications.

Usage

import { useState } from 'react';
import { Button, View, StyleSheet } from 'react-native';
import {
  ValuepayReactNative,
  PaymentProp,
  validatePaymentProp,
  ReturnObject,
} from 'valuepay-react-native';
import useMessage from './hooks/useMessage';

const App = () => {
  const [isPaymentVisible, setPaymentVisible] = useState(false);
  const { showMessage } = useMessage();

  // Define the payment details as per the PaymentProp interface
  const paymentDetails: PaymentProp = {
    publicKey: 'public key',  // required (https://developer.valuepayng.com/)
    transactionRef:
      'VPS_TX_REF_12345' +
      Math.floor((Math.random() + 1) * 1324600075).toString(), // required payment reference
    amount: 100, // required payment amount in kobo
    currency: 'NGN', // optional defaults to NGN
    channels: ['card', 'transfer', 'qrcode', 'ussd'], // optional list only the desired payment methods, if none provided, uses all available at the merchant dashboard
    type: 'default', // defaults to default
    redirectUrl: 'https://example.com/', // optional
    onSuccess: (response: ReturnObject) => { // required
      showMessage('Payment Successful', 'Payment Successful');
      console.log(response, '21');
      setPaymentVisible(false);
    },
    callback: (response: ReturnObject) => { // required
      showMessage('Payment Failed', 'Payment Failed');
      console.log(response, '25');
      setPaymentVisible(false);
    },
    onCancelled: (response: ReturnObject) => { // required
      setPaymentVisible(false);
      console.log(response, '21');
      showMessage('Payment Cancelled', 'Payment Cancelled');
    },
    onAborted: (response: ReturnObject) => { // required
      setPaymentVisible(false);
      console.log(response, '21');
      showMessage('Payment aborted', 'Payment Cancelled');
    },
    onClosed: (response: ReturnObject) => { // required
      setPaymentVisible(false);
      console.log(response, '21');
      showMessage('Payment closed', 'Payment Cancelled');
    },
    customer: { // required
      email: '[email protected]',// required
      phone: '+2349011111111', // otptional
      fullName: 'Mberev Nicholas', // required
    },
    customisedCheckout: { // required
      title: 'Pay MeterToken', // required
      description: 'You are paying MeterToken', // payment description required
      logoLink: 'https://metertoken.ng/logo.png', // optional leave as empty string if no logo
    },
    metaData: { // optional
      customer_mac: Math.floor((Math.random() + 1) * 1324600095).toString(),
      linkId: '123345', // if provided and  typeproperty not default, valid payment id or invoice required.
    },
  };

  const initiatePayment = () => {
    const isValidPayment = validatePaymentProp(paymentDetails);
    //console.log(isValidPayment, ' check payment validity');
    if (isValidPayment) {
      setPaymentVisible(true);
    } else {
      showMessage('Invalid payment details', 'Invalid payment details');
    }
  };

  return (
    <View style={styles.main}>
      <Button title="Pay Now" onPress={initiatePayment} />
      {isPaymentVisible && (
        <ValuepayReactNative
          payment={paymentDetails}
          isVisible={isPaymentVisible}
        />
      )}
    </View>
  );
};

const styles = StyleSheet.create({
  main: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
});

export default App;

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

Custom Support

For custom support, send an email to me at nickmberev[at]gmail.com

License

MIT

Free for distribution.


Made with love from create-react-native-library