react-native-hyperpay-sdk 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,21 +1,42 @@
|
|
|
1
|
-
# react-native-hyperpay
|
|
1
|
+
# react-native-hyperpay-sdk
|
|
2
2
|
|
|
3
3
|
hyperpay
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npm
|
|
8
|
+
npm i react-native-hyperpay-sdk
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
|
-
import {
|
|
15
|
-
|
|
14
|
+
import { setConfig } from "react-native-hyperpay-sdk";
|
|
15
|
+
|
|
16
|
+
// the firt step , set default configiration
|
|
17
|
+
// 1- shopperResultURL to redirect to this url after the payment completed
|
|
18
|
+
// 2- select your country code from list
|
|
19
|
+
// 3- merchantIdentifier is for apply pay only
|
|
20
|
+
setConfig({
|
|
21
|
+
shopperResultURL:"shopperResultURL",
|
|
22
|
+
countryCode:"SA",
|
|
23
|
+
merchantIdentifier:"merchantIdentifier"
|
|
24
|
+
})
|
|
16
25
|
// ...
|
|
17
|
-
|
|
18
|
-
const result = await
|
|
26
|
+
// to pay with apple
|
|
27
|
+
const result = await applePay("CheckoutId")
|
|
28
|
+
|
|
29
|
+
// to pay with any brand
|
|
30
|
+
const result=await createPaymentTransaction(
|
|
31
|
+
{ paymentBrand: "VISA",
|
|
32
|
+
holderName: "Test Test",
|
|
33
|
+
cardNumber: '4111111111111111',
|
|
34
|
+
expiryYear: '2027',
|
|
35
|
+
expiryMonth: '12',
|
|
36
|
+
cvv: '123',
|
|
37
|
+
checkoutID: `${res.data?.checkout_id}`,
|
|
38
|
+
shopperResultURL: "[YOUR_APP_IDENTIFIER]://[URL_SCHEMES]"
|
|
39
|
+
})
|
|
19
40
|
```
|
|
20
41
|
|
|
21
42
|
## Contributing
|