Skip to content

Instantly share code, notes, and snippets.

@enappd
Created May 12, 2019 10:29
Show Gist options
  • Save enappd/2ee829b7e61d72b3006fe1ad14ac43d5 to your computer and use it in GitHub Desktop.
Save enappd/2ee829b7e61d72b3006fe1ad14ac43d5 to your computer and use it in GitHub Desktop.
Ionic Stripe Native payment function
payWithStripe() {
this.stripe.setPublishableKey(this.stripe_key);
this.cardDetails = {
number: '4242424242424242',
expMonth: 12,
expYear: 2020,
cvc: '220'
}
this.stripe.createCardToken(this.cardDetails)
.then(token => {
console.log(token);
this.makePayment(token.id);
})
.catch(error => console.error(error));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment