
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
react-native-stripe
Advanced tools
Wraps the native Stripe iOS SDK for React Native apps.
npm i react-native-stripe --save
open node_modules/react-native-stripe
StripeNative.xcodeproj
into your Libraries
groupBuild Phases
expand the Link Binary With Libraries
header+
to add a librarylibStripeNative.a
and libStripe.a
under the Workspace
groupvar React = require('react-native');
var StripeNative = require('react-native-stripe');
const STRIPE_KEY = "<YOUR STRIPE KEY>";
const SOME_ITEMS = [
{
label: "Llama Kitty T-shirt",
amount: 19.99,
},
{
label: "Hello Kitty Humidifier",
amount: 25.00,
},
];
var AppEntry = React.createClass({
componentDidMount: function () {
StripeNative.init(STRIPE_KEY);
},
applePay: function () {
Promise.all([StripeNative.canMakePayments(), StripeNative.canMakePaymentsUsingNetworks()]).then(
function (canMakePayments) {
if (!canMakePayments[0])
alert("Apple Pay is not enabled on this device");
else if (!canMakePayments[1])
alert("Apple Pay is enabled but no card is configured");
else {
var options = {
fallbackOnCardForm: false,
shippingAddressFields: StripeNative.iOSConstants.PKAddressFieldAll,
currencyCode: 'USD'
};
StripeNative.paymentRequestWithApplePay(SOME_ITEMS, "Llama Kitty Shop", options).then(function (obj) {
var token = obj[0],
shippingInfo = obj[1],
billingInfo = obj[2];
// (Create charge here)
(chargeWasSuccessful ? StripeNative.success : StripeNative.failure)();
}, function (err) {
alert(err);
})
}
});
},
});
cd node_modules/react-native-stripe/example/
index.ios.js
and replace <YOUR STRIPE KEY>
with your Stripe publishable key.<YOUR APPLE PAY MERCHANT ID>
with your merchant ID. Note that this doesn't matter for testing in the simulator.npm install
react-native start
open ios/example.xcodeproj
Code and documentation copyright 2016-2017 Lane M Rettig. Code released under the MIT license.
FAQs
React Native wrapper for native iOS Stripe SDK
The npm package react-native-stripe receives a total of 10 weekly downloads. As such, react-native-stripe popularity was classified as not popular.
We found that react-native-stripe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.