Open jhalborg opened 6 years ago
@jhalborg you can collect card data with https://github.com/sbycrosz/react-native-credit-card-input and then send that data with this lib, get a token and send it to your backend.
handleConfirm = () => {
const {onCreditCardToken} = this.props;
const {
form: {
values: {
number,
expiry,
cvc,
}
}
} = this.state;
const stripe = getStripeClient();
const card = {
"number": number,
"exp_month": expiry.split("/")[0],
"exp_year": "20" + expiry.split("/")[1],
"cvc": cvc
};
console.debug("Stripe createToken",card);
const tokenPromise = stripe.createToken({
card,
});
...
};
Sure, or build it from the ground up :-) But that still makes the statement
"Collect credit card information and convert it to a Stripe token in a single line of Javascript"
false ;-)
Hello,
It seems to me that the premises under "Features" are false:
"Collect credit card information and convert it to a Stripe token in a single line of Javascript"
As far as I understand the library, it does not offer any tools to collect card information (checkout flow, UI elements or the like), but should instead read
"Convert credit card information to a Stripe token in a single line of Javascript"