# react-native-dashpay-sdk

> An android native wrapper for communicating and transacting with the Dashpay payment application

Latest version **1.0.42** (published 2020-05-27) · 0 weekly downloads

## Install

```sh
npm install react-native-dashpay-sdk
pnpm add react-native-dashpay-sdk
yarn add react-native-dashpay-sdk
bun add react-native-dashpay-sdk
```

## 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.0.42 |
| Published | 2020-05-27 |
| First published | 2020-03-09 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 85.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | amadosi |
| Keywords | react-native, dashpay, react-native-dashpay |

## Links

- npm: https://www.npmjs.com/package/react-native-dashpay-sdk
- Homepage: https://github.com/Amadosi/react-native-dashpay-sdk
- npm.io page: https://npm.io/package/react-native-dashpay-sdk

## Recent versions

- 1.0.42 (latest) — 2020-05-27
- 1.0.41 — 2020-05-20
- 1.0.40 — 2020-04-08
- 1.0.39 — 2020-04-08
- 1.0.38 — 2020-04-08
- 1.0.37 — 2020-04-04
- 1.0.36 — 2020-04-04
- 1.0.35 — 2020-04-04
- 1.0.34 — 2020-04-04
- 1.0.33 — 2020-04-04
- 1.0.32 — 2020-04-04
- 1.0.31 — 2020-04-04
- 1.0.30 — 2020-04-04
- 1.0.29 — 2020-04-04
- 1.0.28 — 2020-04-04
- … 28 more at https://npm.io/package/react-native-dashpay-sdk/versions

## README

# react-native-dashpay-sdk

## Getting started

`$ npm install react-native-dashpay-sdk --save`

### Mostly automatic installation

`$ react-native link react-native-dashpay-sdk`

### Manual installation


#### iOS

1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
2. Go to `node_modules` ➜ `react-native-dashpay-sdk` and add `RNDashpaySdk.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRNDashpaySdk.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
4. Run your project (`Cmd+R`)<

#### Android

1. Open up `android/app/src/main/java/[...]/MainActivity.java`
  - Add `import com.dashpay.rndashpay.RNDashpaySdkPackage;` to the imports at the top of the file
  - Add `new RNDashpaySdkPackage()` to the list returned by the `getPackages()` method
2. Append the following lines to `android/settings.gradle`:
  	```
  	include ':react-native-dashpay-sdk'
  	project(':react-native-dashpay-sdk').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-dashpay-sdk/android')
  	```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
  	```
      compile project(':react-native-dashpay-sdk')
  	```


## Usage
```javascript
import RNDashpaySdk from 'react-native-dashpay-sdk';

const paymentRef = '12345';
const amount = '200';

// Simply call the pay function by passing the payment reference and amount to be paid
// This returns a promise
RNDashpaySdk.pay(paymentRef, amount)
.then(data=>console.log(data))
.catch(err=>console.log(err.message));
```

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