Last active
March 8, 2017 20:10
-
-
Save heymartinadams/a4d1d218407714f761363668743c40d3 to your computer and use it in GitHub Desktop.
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
onToken(token) { | |
// This is where token is received, as described in Logic #1 | |
const userId = this.props.data.user.id | |
const stripeToken = token.id | |
// Hide or remove button to prevent duplicate purchases | |
this.setState({ buttonStyle: 'button hidden' }) | |
// Logic #2 | |
this.props.createCard({ variables: { stripeToken, userId } }) | |
.then(() => { | |
console.log('Customer created...') | |
this.setState({ status: 'Customer created...' }) | |
}) | |
.catch((e) => { console.error(e) }) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment