-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from razorpay/e/minor_edits
Make minor edits
- Loading branch information
Showing
3 changed files
with
39 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
example/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,35 +87,39 @@ link iOS SDK as explained in the previous section: | |
### Steps | ||
1. Import RazorpayCheckout module to your component: | ||
```js | ||
import RazorpayCheckout from 'react-native-razorpay'; | ||
``` | ||
```js | ||
import RazorpayCheckout from 'react-native-razorpay'; | ||
``` | ||
2. Call `RazorpayCheckout.open` method with the payment `options`. The method | ||
returns a **JS Promise** where `then` part corresponds to a successful payment | ||
and the `catch` part corresponds to payment failure. | ||
```js | ||
<TouchableHighlight onPress={() => { | ||
var options = { | ||
description: 'Credits towards consultation', | ||
image: 'https://i.imgur.com/3g7nmJC.png', | ||
currency: 'INR', | ||
key: 'rzp_test_1DP5mmOlF5G5ag', | ||
amount: '5000', | ||
name: 'foo', | ||
prefill: { | ||
email: '[email protected]', | ||
contact: '8955806560', | ||
name: 'Akshay Bhalotia' | ||
}, | ||
theme: {color: '#F37254'} | ||
} | ||
RazorpayCheckout.open(options).then(data => | ||
{ alert("Success: " + data.payment_id) } | ||
).catch(data => | ||
{ alert("Error: " + data.code + " | " + data.description) } | ||
); | ||
}}> | ||
``` | ||
```js | ||
<TouchableHighlight onPress={() => { | ||
var options = { | ||
description: 'Credits towards consultation', | ||
image: 'https://i.imgur.com/3g7nmJC.png', | ||
currency: 'INR', | ||
key: 'rzp_test_1DP5mmOlF5G5ag', | ||
amount: '5000', | ||
name: 'foo', | ||
prefill: { | ||
email: '[email protected]', | ||
contact: '8955806560', | ||
name: 'Akshay Bhalotia' | ||
}, | ||
theme: {color: '#F37254'} | ||
} | ||
RazorpayCheckout.open(options).then((data) => { | ||
// handle success | ||
alert(`Success: ${data.payment_id}`); | ||
}).catch((error) => { | ||
// handle failure | ||
alert(`Error: ${error.code} | ${error.description}`); | ||
}); | ||
}}> | ||
``` | ||
A descriptive [list of valid options for checkout][options] is available (under | ||
Manual Checkout column). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,15 +8,16 @@ | |
"test": "echo \"Error: no test specified\" && exit 1", | ||
"postinstall": "./download_ios_framework.sh" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/razorpay/react-native-razorpay.git" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/razorpay/react-native-razorpay.git" | ||
}, | ||
"keywords": [ | ||
"react-native", | ||
"razorpay" | ||
"razorpay", | ||
"payments" | ||
], | ||
"author": "Razorpay Developers <[email protected]> (https://razorpay.com/)", | ||
"license": "", | ||
"homepage" : "https://github.com/razorpay/react-native-razorpay#readme" | ||
"license": "MIT", | ||
"homepage" : "https://github.com/razorpay/react-native-razorpay#readme" | ||
} |