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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@payze/payze-rn

v1.0.5

Published

Payze SDK for React Native

Downloads

9

Readme

MIT License

About The Project

Payze is the best software platform for running an internet business. We handle money movement flow for our customers by giving them tools they need.

Installation

Install the package in your project

npm install @payze/payze-rn

Installing dependencies

Payze SKD uses react-native-webview , so you need to install it in your project too

If you are using Expo, run:
expo install react-native-webview

and you should be good to go.

If you are running bare React Native project, run:
npm i react-native-webview

From react-native 0.60 autolinking will take care of the link step but don't forget to run pod install.

NOTE: If you ever need to uninstall React Native react-native-webview , run react-native unlink react-native-webview to unlink it.

iOS & macOS:

If using CocoaPods, in the ios/ or macos/ directory run:

$ pod install

Basic Usage

import React, { useRef } from 'react';
import  Payze  from  "@payze/payze-rn";

// Transaction id given by Payze
const  TRANSACTION_ID = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
const info = {
	cardNumber:  "123456789101",
	cardHolder:  "NAME SURNAME",
	expirationDate:  "01/22",
	securityNumber:  "000",
	billingAddress:  "Address",
};

export  default  function  App() {
	const payMethod = useRef();

	const  setPayMethod = (pay) => (payMethod.current = pay);

	const  onSuccess = () => alert("SUCCESS!");
	const  onError = (errorCode) => alert(`ERROR! ${errorCode}`);

	const pay = () => {
		payMethod.current(
			info.cardNumber,
			info.cardHolder,
			info.expirationDate,
			info.securityNumber,
			TRANSACTION_ID,
			info.billingAddress,
			onSuccess,
			onError
		);
	}

	return (
		...
		...
		<Payze  setPay={setPayMethod}  />
	)
}

For complete example, please visit Payze example project

Props

| Prop | Type | Default | Note | | ---------------------- | ------------------ | ------- | ---------------------------------------------------------------------------- | | setPay | Method, Required | | Method that takes single argument - Pay() method (see the signature, below). | | closeButtonTitle | String | close | Title of the modal's close button | | closeButtonTextStyle | Object | | Object to stylise close button |

Pay() method arguments

| Argument | Type | Default | Note | | ---------------- | ------------------ | ------- | ------------------------------------------------------------------------------------------------------------ | | cardNumber | String, Required | | Number of the card. | | cardHolder | String, Required | | Holder of the card. | | expirationDate | String, Required | | Expiration date of the card. | | securityNumber | String, Required | | CVC/CVV of the card. | | transactionId | String, Required | | Transaction id given by Payze. | | billingAddress | String, Required | | Billing address of user (can be an empty string). | | onSuccess | Method, Required | | Method to be called after a successful transaction. | | onError | Method, Required | | Method to be called after an error while trying to process transaction, that takes errorCode as an argument. |

Types

type errorCode {
	BAD_REQUEST:  1002,
	CARD_VERIFICATION_CANCELLED:  1003,
	TRANSACTION_FAILURE:  1004,
	UNKNOWN_ERROR:  1005,
}

License

Distributed under the MIT License. See LICENSE.txt for more information.