Skip to content

Instantly share code, notes, and snippets.

@ryanbelke
Created October 13, 2018 19:12
Show Gist options
  • Select an option

  • Save ryanbelke/f7857af36f5d8d79f8635453dde030f5 to your computer and use it in GitHub Desktop.

Select an option

Save ryanbelke/f7857af36f5d8d79f8635453dde030f5 to your computer and use it in GitHub Desktop.
submitOrder() {
const { context } = this.props;
const { data } = this.state;
console.log(context);
this.props.stripe.createToken().then(res => {
strapi
.createEntry("orders", {
amount: context.total,
dishes: context.items,
address: data.address,
city: data.city,
state: data.state,
stripe_id: data.stripe_id,
token: res.token.id
})
.then(Router.push("/"));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment