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

react-native-ozow

v1.1.3

Published

React Native Ozow is a React Native library for integrating Ozow payment gateway into your React Native app. It supports both In-App and Link payments.

Downloads

376

Readme

React Native Ozow

React Native Ozow is a React Native library for integrating Ozow payment gateway into your React Native app. It supports both In-App and Link payments.

This is not an official Ozow library.

npm npm GitHub issues [GitHub stars] [GitHub license] Twitter [GitHub contributors] [GitHub last commit] [GitHub pull requests] [GitHub pull requests] [GitHub forks] [GitHub stars] [GitHub watchers]

Check out my other libraries

Table of contents

Getting started

npm install react-native-ozow

Expo?

npx expo install react-native-ozow

Documentation

  • For more information, please visit Ozow API

Usage

Demos

In-App Payments Link Payments

In-App Payments

import { Ozow } from "react-native-ozow";

const MyPaymemt = () =>{
    return(
        <Ozow
            data={{
                SiteCode: "RPI-RPI-300",
                Amount: 1000, // in rands
                TransactionReference: "1234567",
                BankReference: "123456",
                CancelUrl: "https://ozow.com",
                ErrorUrl: "https://ozow.com",
                SuccessUrl: "https://ozow.com",
                NotifyUrl: "https://ozow.com",
                }}
            privateKey="f276b028..."
            onErrorMessage={...}
            onPaymentCancel={(data) => {...}}
            onPaymentSuccess={(data) => {...}}
      />
    )
}

export default MyPaymemt;

Props

| Prop | Type | Description | Required | | ---------------- | ---------- | ------------------------------------------------------------------------------------------------------------ | -------- | | data | object | Data to be sent to Ozow API | Yes | | privateKey | string | Private key generated from Ozow | Yes | | onErrorMessage | function | Callback function to handle error message | No | | onPaymentCancel | function | Callback function to handle payment cancellation | No | | onPaymentSuccess | function | Callback function to handle payment success | No | | onPaymentError | function | Callback function to handle payment error | No |

Data

| Prop | Type | Description | Required | | -------------------- | ------------------ | -------------------------------------------------- | ---------------------------------------------------------------- | | SiteCode | string | Site code generated from Ozow | Yes | | Amount | number | Amount to be paid in rands | Yes | | TransactionReference | string | Transaction reference to be sent to Ozow | Yes | | BankReference | string | Bank reference to be sent to Ozow | Yes | | CancelUrl | string | Url to be redirected to when payment is cancelled | Yes | | ErrorUrl | string | Url to be redirected to when payment has an error | Yes | | SuccessUrl | string | Url to be redirected to when payment is successful | Yes | | NotifyUrl | string | Url to be redirected to when payment is successful | Yes | | Customer | string or number | The customer’s name or identifier. | No | | IsTest | boolean | Run on test mode when true | No (default false) | | style | object | Style passed to the WebView component | No |

In-App Payments Response example

{
  "Amount": "1.00",
  "BankName": "Capitec+Pay",
  "CurrencyCode": "ZAR",
  "Hash": "e2a02f05650f7468963776e8d6...73baf3835",
  "IsTest": "true",
  "Optional1": "",
  "Optional2": "",
  "Optional3": "",
  "Optional4": "",
  "Optional5": "",
  "SiteCode": "IPR-IPR-003",
  "Status": "Complete", // or "Cancelled" or "Error"
  "StatusMessage": "Test+transaction+completed",
  "TransactionId": "e315bf89-...-9823ef5d3d41",
  "TransactionReference": "12345671"
}

Link Payments

import { PaymentLink } from "react-native-ozow";

const myLink = new PaymentLink("9219...[API_KEY]", "f276...[PRIVATE_KEY]");

...
        <Button
          title="Get Payment Link"
          onPress={async () => {
            const results = await myLink.generateLink({
              SiteCode: "IPR...[SITE_CODE]]",
              CountryCode: "ZA",
              CurrencyCode: "ZAR",
              Amount: 10,
              TransactionReference: "1234567",
              BankReference: "123456",
              CancelUrl: "https://ozow.com",
              ErrorUrl: "https://ozow.com",
              SuccessUrl: "https://ozow.com",
              NotifyUrl: "https://ozow.com",
              IsTest: false,
              Customer: "John Doe",
            }, false);

            setLink(results.url);

            console.log(myLink.getPaymentLink()); //Get last generated link
          }}
        />
...

PaymentLink Params

| Param | Type | Description | Required | | ----------- | -------- | ------------------------------- | ---------------------------------------------------------------- | | API_KEY | string | API key generated from Ozow | Yes | | PRIVATE_KEY | string | Private key generated from Ozow | Yes |

PaymentLink Methods

| Method | Params | Description | Required | | -------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------ | -------- | | generateLink | data: object, isTest: boolean | Data to be sent to Ozow API | Yes | | getPaymentLink | none | Get last generated link | No |

PaymentLink Data

See In-App Payments Data

PaymentLink Response example

{
  "errorMessage": null,
  "paymentRequestId": "77cc0a3f-c4cc-40fd-9048-de78d9a03ce0",
  "url": "https://pay.ozow.com/77cc0a3f-c4cc-40fd-9048-de78d9a03ce0/Secure"
}

Author

Author

  • Axole Maranjana Twitter Follow GitHub followers Instagram LinkedIn

Help wanted!

Credits

Support

  • If you need help with this project or you want to report a bug, please open an issue on GitHub

Donate