Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
stripe-client
Advanced tools
React Native Stripe wrapper that makes using Stripe with React Native safe and easy in iOS/Android.
React Native Stripe wrapper that makes using Stripe with React Native easy in iOS/Android.
npm install stripe-client --save
Or
yarn add stripe-client
stripe.createToken(...)
returns a Promise of a token object (https://stripe.com/docs/api/node#token_object).
If the token object creation fails (ex. the expiration date is invalid, the card number is the wrong format), stripe.createToken(...)
returns the corresponding error (https://stripe.com/docs/api/node#errors).
stripe.createToken({
card: {
"number": '4242424242424242',
"exp_month": 12,
"exp_year": 2018,
"cvc": '123'
}
});
Or
var otherValidFormat = {
"card[number]": '4242424242424242',
"card[exp_month]": '12',
"card[exp_year]": '18',
"card[cvc]": '123'
}
stripe.createToken(otherValidFormat);
{
"id": "tok_1AWuxsJd4nFN3COfSKY8195M",
"object": "token",
"card": {
"id": "card_1AWuxsJd4nFN3COfUOhQfBVw",
"object": "card",
"address_city": null,
"address_country": null,
"address_line1": null,
"address_line1_check": null,
"address_line2": null,
"address_state": null,
"address_zip": null,
"address_zip_check": null,
"brand": "Visa",
"country": "US",
"cvc_check": null,
"dynamic_last4": null,
"exp_month": 8,
"exp_year": 2018,
"fingerprint": "EL88ufXeYTG02LOU",
"funding": "credit",
"last4": "4242",
"metadata": {
},
"name": null,
"tokenization_method": null
},
"client_ip": null,
"created": 1497998212,
"livemode": false,
"type": "card",
"used": false
}
import React from 'react';
var stripe = require('stripe-client')('YOUR_PUBLISHABLE_STRIPE_API_KEY');
var information = {
card: {
number: '4242424242424242',
exp_month: '02',
exp_year: '21',
cvc: '999',
name: 'Billy Joe'
}
}
export class App extends React.Component {
async onPayment() {
var card = await stripe.createToken(information);
console.log(card.id);
}
render() {
...
}
}
import React from 'react';
var stripe = require('stripe-client')('YOUR_PUBLISHABLE_STRIPE_API_KEY');
var information = {
bank_account: {
country: 'US',
currency: 'usd',
account_holder_name: 'Noah Martinez',
account_holder_type: 'individual',
routing_number: '110000000',
account_number: '000123456789'
}
}
export class App extends React.Component {
async onPayment() {
var card = await stripe.createToken(information);
console.log(card.id);
}
render() {
...
}
}
var stripe = require('stripe-client')('YOUR_PUBLISHABLE_STRIPE_API_KEY');
var information = {
pii: {
personal_id_number: '000000000'
}
}
export class App extends React.Component {
async onPayment() {
var card = await stripe.createToken(information);
console.log(card.id);
}
render() {
...
}
}
Where can I find more information about creating tokens in Stripe?
Help! I don't know where to find 'YOUR_PUBLISHABLE_STRIPE_API_KEY' ?
I want to charge a customer with this library. How would I do that?
FAQs
React Native Stripe wrapper that makes using Stripe with React Native safe and easy in iOS/Android.
The npm package stripe-client receives a total of 1,062 weekly downloads. As such, stripe-client popularity was classified as popular.
We found that stripe-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.