hackathon-starter icon indicating copy to clipboard operation
hackathon-starter copied to clipboard

Stripe Create Charge

Open tbonz opened this issue 10 years ago • 2 comments

It seems as though the instantiation of the stripe var should be moved into the postStripe method. That is where the var stripe is used to create the charge. Let me know your thoughts.

Here's a commit showing the changes in my own fork.

https://github.com/tbonz/hackathon-starter/commit/b6f51a8439285f4edf3d7c781f40fe29e586354f

tbonz avatar Mar 10 '16 21:03 tbonz

@tbonz It will not really make any difference, unless you are hitting postStripe directly via XHR request. Ideally, I would leave initialization at the top, as before, but this change was necessary to speed up app start-up time.

Since I am already initializing all other API examples inside a GET route, it does not make sense to have an exception case for Stripe.

sahat avatar Mar 14 '16 19:03 sahat

@sahat Thanks for the explanation, I understand now why you have it setup this way.

tbonz avatar Mar 15 '16 00:03 tbonz