Skip to content

Commit

Permalink
Merge pull request #176 from thebiggive/stripe-pi-1s-wait
Browse files Browse the repository at this point in the history
Give Stripe 1 second before looking for payment intent
  • Loading branch information
NoelLH authored Dec 13, 2024
2 parents 41e518a + 375a6d2 commit 4f7d790
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions support/stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ export async function checkStripeCustomerExists(email) {
* @return {Promise<number>}
*/
export async function getChargedAmount(donationUUID) {
// 1ms delay for now just to show how to add a delay. May need a longer delay to wait for
// Stripe's search index to be updated.
await setTimeout(1);
// 1s delay to give Stripe a little time to update search index.
await setTimeout(1000);

// search docs say it results are *usually* available in less than a minute so we may have to experiment to
// see if this is flaky or not. I don't think we have another great way to find the PI.
Expand Down

0 comments on commit 4f7d790

Please sign in to comment.