# sahl-acceptance

> payment acceptance package

Latest version **1.1.5** (published 2023-02-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install sahl-acceptance
pnpm add sahl-acceptance
yarn add sahl-acceptance
bun add sahl-acceptance
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.5 |
| Published | 2023-02-02 |
| First published | 2022-11-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 60.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | sahl@sahlpay.app |
| Maintainers | npm-sahlpay |

## Links

- npm: https://www.npmjs.com/package/sahl-acceptance
- Repository: https://gitlab.corp.egyptpay.com/iabdelnaby/acceptance-react-native-package
- npm.io page: https://npm.io/package/sahl-acceptance

## Dependencies (3)

- [react-native-elements](https://npm.io/package/react-native-elements.md) ^3.4.2
- [react-native-payment-icons](https://npm.io/package/react-native-payment-icons.md) ^1.0.11
- [react-native-keyboard-aware-scroll-view](https://npm.io/package/react-native-keyboard-aware-scroll-view.md) ^0.9.5

## Recent versions

- 1.1.5 (latest) — 2023-02-02
- 1.1.4 — 2023-02-02
- 1.1.3 — 2023-02-02
- 1.1.2 — 2023-01-01
- 1.1.1 — 2023-01-01
- 1.1.0 — 2023-01-01
- 1.0.4 — 2022-12-13
- 1.0.3 — 2022-11-30
- 1.0.2 — 2022-11-30
- 1.0.1 — 2022-11-30
- 1.0.0 — 2022-11-30

## README

## Table of Contents

- [Install](#install)
- [Usage](#usage)

## Install

Install the latest version to your `package.json`:

// install external dependencies
`$ npm install react-native-webview react-native-svg --save`

// install package
`$ npm install sahl-acceptance --save`


## Usage

```js
import UseSahlAcceptance from 'sahl-acceptance';
import { Stage } from 'sahl-acceptance/Common/Constants';


<UseSahlAcceptance
        apiKey={'API_KEY'}
        requestHashKey={'REQUEST_HASH_KEY'}
        username={'USERNAME'}
        password={'PASSWORD'}
        stage={Stage.Staging or Stage.Sandbox or Stage.Production}
        paymentDetails={
          {
            "customer_id": 1,
            "paid_amount": 10.00,
          }
        }
        style={{mainColor: '#4055FF', buttonBorderRadius: 120, inputFieldBorderRadius: 100}}
        onSuccess={(response) => {
          console.log(response);
          alert('Payment completed successfully')
        }}
        onFailure={(response) => {
          console.log(response);
          alert('Payment failed');
        }}
        onError={(errorMessage) => alert(errorMessage)}
      />
```


#### Properties

All of the following properties are **required**

- `apiKey` (string): Your integration API Key; this to be able to call our APIs.
- `requestHashKey` (string): Your request hash key; this for signing the requests.
- `username` (string): Your API username; this for authentication.
- `password` (string): Your API password; this for authentication.
- `stage` (Enum): The desired environment stage; available values are `Stage.Staging or Stage.Sandbox or Stage.Production`.
- `paymentDetails` (object): This is the actual payment details that requires you to specify the following fields:
    - `customer_id` (integer): This is your customer id and its expcted to be integer number.
    - `paid_amount` (decimal): This is the amount that you need customer to pay.
- `style` (object): This is custom style for you
    - `mainColor` (string): This is the main color.
    - `buttonBorderRadius` (string): This is the border radius that will be applied on any button.
    - `inputFieldBorderRadius` (string): This is the border radius that will be applied on any input field.
#### Events

- `onSuccess`: Called once when the payment is succeeded.
- `onFailure`: Called once when the payment is failed.
- `onError`: Called whenever an error occured.

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