#loterak_unexpected

1 messages · Page 1 of 1 (latest)

gray matrixBOT
#

👋 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/1228426219616469026

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

slim zodiacBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

raw onyx
#

For reference, this is how we are creating the subscription, for which we grab the payment intent client secret, that goes into the confirmPayment function:

Stripe::Subscription.create(
  customer: customer.id,
  items: [{ price: @consumer_product_price.stripe_price_id }],
  discounts: [{ promotion_code: permitted_params[:promo_code_id] }],
  automatic_tax: { enabled: true },
  payment_behavior: 'default_incomplete',
  payment_settings: { save_default_payment_method: 'on_subscription' },
  expand: ['latest_invoice.payment_intent']
)
stuck frost
#

Can you share a checkout session id or request id for creating the session where this happened?

raw onyx
#

Yes, one sec

#

cs_test_b1FanCFxjUlWapTN1dFBXyRk3C4wYA0EgwxDByilAv6aLWoLL5fzWNwwgG#fidkdWxOYHwnPyd1blpxYHZxWjA0TGRKPHRBTU9RVG5LVTFHYUFjTHV3TDF9NEpCTmJxMG1nZld%2FS3RGYTJfNkxoN3BxQXxtVzFTYWZ%2FTHdjTGBXf2l8bG12SjxSTmBLfUc1bXNhRzFVMWxENTVTU2I0V3FfQycpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPydocGlxbFpscWBoJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl

stuck frost
#

Ah they don't have a default payment method set in invoice_settings.default_payment_method on the customer object

#

Hm although this is a payment mode session

raw onyx
#

it is, although it does create an invoice too

stuck frost
#

That shouldn't matter

#

With payment sessions most recent saved card should be prefilled according to the above doc. Looking

#

Ah there's no email on the 1 saved payment method that customer has

#

A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer’s card details.

raw onyx
#

Interesting. The payment element I'm using does not ask for an email, could that be it?

stuck frost
#

Yeah

#

All the above need to be set for checkout to prefill

raw onyx
#

could it be because I'm not using the link element? I'm I required to use that in order for email to be appended correctly?

stuck frost
#

You could just collect it in any field really

#

Doesn't have to be the link element

raw onyx
#

yeah I meant for Stripe to do it automatically. Becuase the payment element doesn't really ask for an email when using the card payment method

#

I could just update the payment method through the API, I imagine

stuck frost
#

But yeah for existing payment methods, you can update them with the api

raw onyx
#

oh the confirmPayment option sounds good, I'll try that.

stuck frost
raw onyx
#

good catch!

#

That was it!! Thank you so much 😁

stuck frost
#

Excellent!

#

Happy to help

raw onyx
#

One last question, to be extra careful

stuck frost
#

Sure

raw onyx
#

Could avoiding the email field cause any problems with those payment methods that have an intermediate page? like apple pay, etc

#

I would assume not, but just in case

stuck frost
#

You're still collecting it though

#

Just not in the payment element

#

As long as you pass it to confirmPayment, you're good

raw onyx
#

👍🏻

#

perfect!!

#

have a good weekend!