sudoroom / sudo-humans

hackerspace membership server
Other
37 stars 19 forks source link

Payment fixes/etc #78

Closed stackptr closed 3 years ago

stackptr commented 7 years ago

Started to read through and test the payments flow tonight. I notice without Stripe key, server crashes and burns on the payment page. Now it produces a 500, but if you use the wrong key (as opposed to undefined) it still crashes and burns in a different place. Probably an adjacent error to #59 with similar fix?

Second commit might be a bit more necessary. Could not make a test subscription (test key + fake card) without this change to the API, passing in card details. Otherwise Stripe complains that the customer does not have an attached payment source. Most likely subscriptions aren't broken since I myself created a subscription earlier this year, and that code hasn't radically been altered since last June. But we should look into why it's failing in this scenario regardless, I'll poke around more

stackptr commented 7 years ago

Crucial detail for the second commit. m.params.stripeToken in createOrUpdateSubscription() is undefined. So there you have it, there is no attached payment source because the source is nulled. Troubleshooting why that is happening will likely fix the underlying problem and render the API change unnecessary

stackptr commented 7 years ago

False alarm, this happens when no publishable key is set ;)