Created
May 12, 2019 10:29
-
-
Save enappd/2ee829b7e61d72b3006fe1ad14ac43d5 to your computer and use it in GitHub Desktop.
Ionic Stripe Native payment function
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
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