#hans_unexpected

1 messages ¡ Page 1 of 1 (latest)

willow pelicanBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1394699307642257570

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

heady forge
#

hi there, can you tell me where you're getting that error message? normally checkout sessions will handle the verification steps for you

somber rose
#

// Step 2: Retrieve Stripe checkout session
const checkoutSession = await step.do('retrieve-checkout-session', async () => {
const stripe = validationResult.customerEnvironment === 'live' ? dependencies.stripe : dependencies.stripeTest;
return this.retrieveCheckoutSession(validationResult.stripeCheckoutSessionId, stripe);
});

// Step 3: Retrieve Stripe setup intent
const setupIntent = await step.do('retrieve-setup-intent', async () => {
  const stripe = validationResult.customerEnvironment === 'live' ? dependencies.stripe : dependencies.stripeTest;
  return this.retrieveSetupIntent(checkoutSession.setup_intent as string, stripe);
});

// Step 4: Retrieve Stripe payment method
const paymentMethod = await step.do('retrieve-payment-method', async () => {
  const stripe = validationResult.customerEnvironment === 'live' ? dependencies.stripe : dependencies.stripeTest;
  return this.retrievePaymentMethod(setupIntent.payment_method as string, stripe);
});

// Step 5: Create Stripe customer
const stripeCustomer = await step.do('create-stripe-customer', async () => {
  const stripe = validationResult.customerEnvironment === 'live' ? dependencies.stripe : dependencies.stripeTest;
  return this.createStripeCustomer({
    userEmail: req.userEmail,
    organizationName: validationResult.organizationName,
    paymentMethod,
    legalBusinessName: validationResult.legalBusinessName,
    idempotencyKey: validationResult.idempotencyKey,
    stripe,
  });
});

// Step 6: Attach payment method to customer
await step.do('attach-payment-method', async () => {
  const stripe = validationResult.customerEnvironment === 'live' ? dependencies.stripe : dependencies.stripeTest;
  return this.attachPaymentMethod(paymentMethod.id, stripeCustomer.id, stripe);
});
#

We're failing on step 6

heady forge
#

ok, can you describe when you're running that code? generally it takes a couple days for US bank account verification to complete, and you will be unable to attach the payment method to the customer until it does. the attachment should happen automatically once verification completes, so you can listen for the payment_method.attached to detect when that occurs