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

wo-payment

v1.0.14

Published

WO payment plugin

Readme

wo-payment

NOTE

You will need the following dependency installed in your React Native project before starting the implementation.

  1. react-native-webview
  2. axios
  • Please follow the steps given in the document according to your platform(android/ios)

Installation

npm install wo-paymen --save

Usage

Follow the steps given below :

  • Import to your js file
import { acceptService, PaymentModal, AcceptPaymentButton } from 'wo-payment';
  • Set the following configuration of your accept payment on top of your App.js
acceptService.setConfig({
  apiKey: 'API_KEY', # get your API key from your profile in AccepttPayment account (String) 
  iFrameId: IFRAME_ID, # get your iFrameId from Iframe segment in your AccepttPayment account (Number) 
  status: 'test', # Set your environment ('test'/'live') (String)
  integration: {
    # get ids by creating ['Payment Integrations'](https://portal.weaccept.co/portal/integrations)
    test: {
      card: '12345',
      kiosk: '12345',
      wallet: '12345',
      cash: '12345'
    },
    live: {
      card: '12345',
      kiosk: '12345',
      wallet: '12345',
      cash: '12345'
    }
  }
});
  • Make payment options
const paymentOptions = {

    uniqueId: 'UNIQ_ID', 
    firstName: 'FIRST_NAME',
    lastName: 'LAST_NAME',
    email: 'EMAIL',
    country: 'COUNTRY' # (i.e. 'EG' for egypt),
    price: 'AMOUNT',
    currency: 'CURRENCY_CODE' # (i.e. 'EGP' for egyptian pound),
    marchantId: 'MARCHANT_ID'
    city: 'CITY_NAME', # (i.e. cairo)
    state: 'STATE_NAME', # (i.e. cairo)
    phoneNumber: 'PHONE_NUMBER', # (i.e. +86(8)9135210487)
    price: 1000,
    currency: 'CURRENCY',# ('EGP' Or 'USD')
};
  • Put a Button to start a payment
{/* default plugin button only for card payment */}
<AcceptPaymentButton
    paymentOptions={paymentOptions}
    onClose={(res) => {
        console.log('AcceptPaymentButton onClose in app component', res);
    }}
    onError={(e) => {
        console.log('AcceptPaymentButton e', e)
    }} />
{/* plugin button with options & innerComponent only */}
<AcceptPaymentButton
    buttonContainerStyle={styles.button}
    innerComponent={
        <Text style={[styles.buttonText]}>
            Plugin Button With innerComponent (card)
        </Text>
    }
    paymentOptions={paymentOptions}
    onClose={(res) => {
        console.log('AcceptPaymentButton onClose in app component', res);
    }}
    onError={(e) => {
        console.log('AcceptPaymentButton e', e)
    }} />
{/* just a simple button with 'PaymentModal' */}
<TouchableOpacity
    style={[styles.button, styles.buttonContainerStyle || {}]}
    onPress={() => {
        payClicked()
    }}>
    <Text style={[styles.buttonText, styles.buttonTextStyle || {}]}>
        User Button (card)
    </Text>
</TouchableOpacity>
<PaymentModal
    isVisible={isVisibale}
    iframeUrl={iframeUrl}
    onClose={(res) => {
        setIsVisibale(false);
        console.log('onClose res ---->>>', res);
    }}
    onError={(e) => {
        setIsVisibale(false);
        console.log('AcceptPaymentButton e', e)
    }}
/>
{/* wallet transaction */}
<TouchableOpacity
    style={[styles.button, styles.buttonContainerStyle || {}]}
    onPress={() => {
        payClicked('wallet')
    }}>
    <Text style={[styles.buttonText, styles.buttonTextStyle || {}]}>
        User Button (wallet)
    </Text>
</TouchableOpacity>
{/* cash transaction */}
<TouchableOpacity
    style={[styles.button, styles.buttonContainerStyle || {}]}
    onPress={() => {
        payClicked('cash')
    }}>
    <Text style={[styles.buttonText, styles.buttonTextStyle || {}]}>
        User Button (cash)
    </Text>
</TouchableOpacity>
{/* kiosk transaction */}
<TouchableOpacity
    style={[styles.button, styles.buttonContainerStyle || {}]}
    onPress={() => {
        payClicked('kiosk')
    }}>
    <Text style={[styles.buttonText, styles.buttonTextStyle || {}]}>
        User Button (kiosk)
    </Text>
</TouchableOpacity>
  • 'payClick' function:-
async function payClicked(type = 'card') {
    paymentOptions.uniqueId = 'UNIQUE_ID'; #Unique Id for you order
    paymentOptions.type = type;
    let reference = '';
    reference = await acceptService.getReference(paymentOptions);
    console.log('payClicked reference ---->>>', reference);
    if (reference && ['card', 'wallet'].includes(type)) {
        setIsVisibale(true);
        setIframeUrl(reference);
    }
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update the tests as appropriate.

License

MIT