# react-native-payaza

> Payaza React Native Library

Latest version **1.0.1** (published 2024-09-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-payaza
pnpm add react-native-payaza
yarn add react-native-payaza
bun add react-native-payaza
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2024-09-05 |
| First published | 2023-10-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 16.0.0 |
| Dependencies | 0 |
| Unpacked size | 49.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Femi Kolade |
| Maintainers | daltimore |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-payaza
- Repository: https://github.com/78-Financials/react-sdk
- Homepage: https://github.com/78-Financials/react-sdk#readme
- Issues: https://github.com/78-Financials/react-sdk/issues
- npm.io page: https://npm.io/package/react-native-payaza

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2024-09-05
- 0.1.2 — 2023-10-16
- 0.1.1 — 2023-10-16

## README

# react-native-payaza

Payaza React Native Library

## Installation

```sh
npm install react-native-payaza
```
<!-- # or  -->
```sh
yarn add react-native-payaza
```

```sh
npm install ./react-native-payaza-0.1.0.tgz
```

### Installing Dependencies

1. install React Native Webview

```sh
npm install react-native-webview
```

2. install  Clipboard

```sh
npm install --save @react-native-clipboard/clipboard
```

### Link native dependencies

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

React Native modules that include native Objective-C, Swift, Java, or Kotlin code have to be "linked" so that the compiler knows to include them in the app.

```sh
react-native link react-native-webview
```

## Usage

import the package

```tsx
import Payaza, {
  type IPayaza,
  type PayazaErrorResponse,
  type PayazaSuccessResponse,
  PayazaConnectionMode,
} from 'react-native-payaza'

// ...

const payaza = React.useRef<IPayaza>(null);

// ...

const payNow = () => {
  payaza.current?.createTransaction({
    amount: Number(110),
    connectionMode: PayazaConnectionMode.LIVE_CONNECTION_MODE,
    email: "example@example.com",
    firstName: "<first name>",
    lastName: "<last name>",
    phoneNumber: "<+12345678900>",
    currencyCode: 'NGN',
    transactionReference: "transaction_reference",
  });
}

  const handleError = (response: PayazaErrorResponse) => {
    Alert.alert(response.data.message, `Error Occurred`);
  };

  const handleSuccess = (response: PayazaSuccessResponse) => {
    Alert.alert(
      response.data.message,
      `Transaction reference ${response.data.payaza_reference}`
    );
  };

// ...

return (
  <View>
    <TouchableOpacity onPress={payNow}>
      <Text style={styles.buttonText}>Pay Now</Text>
    </TouchableOpacity>
    <Payaza
      onSuccess={handleSuccess}
      onError={handleError}
      onClose={console.log}
      merchantKey="<public key>"
      ref={payaza}
    />
  </View>
)
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---

Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)

---
_Source: https://npm.io/package/react-native-payaza · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
