Stripe.create Functions Not In Correct Order
I want to integrate Stripe into my application. I have collected all necessary Data in the req.body. Now an undefined error is being thrown after creating the customer Id and whil
Solution 1:
You should break this down into smaller pieces to verify the behaviour you're expecting, for starters. There's quite a lot going on here.
One problem is that you are trying to await
functions which are not async
-- you should have each function marked:
let createCustomer = asyncfunction () {...}
This is likely the reason the sequence is not what you expect.
You're hitting an error in addCardToCustomer
because createCustomer
is undefined
in the scope of that function. You need to have a parameter:
let addCardToCustomer = asyncfunction (createdCustomer) { ... }
Post a Comment for "Stripe.create Functions Not In Correct Order"