#comet_elements-invoice

1 messages ยท Page 1 of 1 (latest)

hardy raftBOT
#

๐Ÿ‘‹ 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/1432788163578957891

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

cinder thunder
#

@junior aspen I don't think so. You have to pass the list of payment_method_types to your front end instead

#

did you initialize Elements with the client_secret of that PaymentIntent?

junior aspen
#

yes

#

and it works when explicitly creating the payment intent

#

because this is set on the payment intent:
"automatic_payment_methods": {
"enabled": true
}

cinder thunder
#

sorry you said yes

#

can you share how you have initialized Elements? Like your exact code

junior aspen
#

when creating the invoice and finalizing it, the payment intent that gets attached does not have that set

cinder thunder
#

I know ๐Ÿ™‚

#

Please share your exact code to initialize Elements

#

comet_elements-invoice

junior aspen
#

ok, one second

#
    () => ({
      mode: recurringDonation === 'monthly' ? 'subscription' : 'payment',
      amount: Math.max(50, Math.round((typeof getTotal === 'function' ? getTotal() : 50) * 100)),
      currency: 'usd',
    }),
    [recurringDonation, getTotal],
  );```
#

it does work when explicitly passing in payment_method_types but i'd like to maintain the automatic payment method functionality since we're also using stripe connect for connected accounts

cinder thunder
#

yeah you see, you are not doing what I was saying from waht I can tell

#

You can pass the existing PaymentIntent's client_secret when you initialize Elements instead of passing amount and currency and that would solve your problem

junior aspen
#

ok, cool. i'll try that. thank you!

proud whale
#

Koopajah. Do you have a tip jar? If this works you saved us quite a bit of time tyvm

cinder thunder
#

No tip jar, it's my job to help you all ๐Ÿ™‚

#

I'm here so I'd say try it and let's make sure it works!