#stealth_webhooks

1 messages ¡ Page 1 of 1 (latest)

grave tangleBOT
#

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

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

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.

limber gale
#

hi! you said no ID, but you should have a checkout session ID from your session you've created. can you look that up for the second case and share it with me?

#

or the request ID from your API request?

paper rivet
#

session request id req_H6Y76B1BfdGEJm

#

session id cs_test_c1rRXmJpYCw97QioLxmUPjn4NAIWZB4XWx2Oe0ZalauJCpGgOxPvNH3DK5

#

That is the one that does not work. aka no payment method

#

And this one I think is the one that works.
session request id req_KPyfBFRSiebYzf
session id cs_test_c1xeDmHtymKNAs7hoT5xYfThSiKkr7nEMDq1HaDSGYRV7hnPVmK78QTc5s

limber gale
#

hi! sorry, something came up but i'll get back to you asap

#

ok so i'm looking at the one you said doesn't work and i'm seeing that the checkout session was never confirmed, which is why you never got checkout.session.completed

paper rivet
#

how do I confirm it? Because when I use credit card it somehow gets confirmed on its own

#

I do actually call some confirm function on FE. let me check

limber gale
#

can you share more details about exactly what you're trying to do? do you have a public test page where i can reproduce your checkout flow and this error?

#

what are you doing differently between these two sessions? they look extremely similar, except in one case i see you attempt to confirm the payment and succeed, and in the other there's no confirmation attempt at all

paper rivet
#

In one case I use payment method element in the other I did not use it

limber gale
#

what exactly are you trying to do in the case where you're not using it? this checkout session is in setup mode, which means it's trying to collect card details to create a saved payment method

#

so if you're not collecting card details with our elements there isn't anything to save, so no checkout session to complete

paper rivet
#

I want to collect billing details and taxId. then on session completed event, I remove trial from the subscription making it active. Because this one has send_invoice as collectionMethod.

#

this is case where invoice is sent by email to a customer. so collection method is send_invoice for that subscription

#
                        throw new Error('Checkout actions not available.');
                    }
                    return from(this.loadActionsResult.actions.confirm());```
#

this is triggered when for both scenarios. It works when payment method exists and it does not work when there's no PM. it's success in both cases.

#

oh.. i catched an error... "Please ensure that the Payment Element is mounted and the ready event has been emitted before calling confirm()."

#

sooo. i can't complete session when there is no PM, that is collection_method = send_invoice?

limber gale
#

yeah, i don't think this flow is expected to work if you're not collecting a payment method

#

let me triple check that

#

i would test it out myself but i might need to make a lot of tweaks to my test integration first so it might take me a bit

paper rivet
#

Can only be set in subscription mode.

#

I have a setup mode

#
            {
                UiMode = "custom",
                Customer = customerId,
                Locale = ResolveLocale(locale),
                BillingAddressCollection = "required",
                Currency = "eur",
                Mode = "setup",
                ReturnUrl = returnUri,
                WalletOptions = new global::Stripe.Checkout.SessionWalletOptionsOptions
                {
                    Link = new global::Stripe.Checkout.SessionWalletOptionsLinkOptions
                    {
                        Display = "never"
                    }
                },
                TaxIdCollection = new global::Stripe.Checkout.SessionTaxIdCollectionOptions
                {
                    Enabled = true,
                },
                AutomaticTax = new global::Stripe.Checkout.SessionAutomaticTaxOptions { Enabled = false },
                CustomerUpdate = new global::Stripe.Checkout.SessionCustomerUpdateOptions
                {
                    Address = "auto",
                    Name = "auto"
                }

#

Can I manually complete session?

limber gale
#

ok, so i've been doing some additional digging and we don't currently support a path where you use checkout sessions + the payment element and you don't collect a payment method up front

#

so what you're currently trying to do is not supported unfortunately

#

the only way to do this is with mode: "subscription", payment_method_collection: "if_required", ui_mode of either "embedded" or "hosted", and using either a 0 amount price or creating the subscription in trial mode

#

so there are multiple things you would need to change

#

ideally in the long run we'll support ui_mode: "custom" for this too, but only in subscription mode

paper rivet
#

The problem with subscription mode is it always creates new subscription as far as I know. I cant just update existing one

limber gale
#

then what exactly are you trying to do in the case where you're not collecting any payment method and trying to modify an existing subscription?

paper rivet
#

collect address, taxId and then move subscription out of a trial. I could use elements for that but then I'd have two different implementations. I was trying to re-use the same flow I already use for credit cards.

limber gale
#

hmm yeah you can't do that unfortunately, if i were you i'd just collect the info outside of the context of a checkout session and update the customer / subscription directly using our APIs

#

checkout sessions will expect you to

  1. charge a payment method
  2. collect a payment method
  3. create a subscription

they can't be used in any instance where you're not also doing one of those things

paper rivet
#

Okay. Thank you.