#xfechx-plink-default-pm

1 messages ยท Page 1 of 1 (latest)

snow notch
#

Hey, what's the Q?

peak crest
#

Hey, I would like to know first if this is possible. I have a listener (webhook) setup for checkout sessions, that listens on checkout.session.completed
However, when successfully receiving a payment through a payment-link, and listening to the same event, I get an error and my code the only thing it does is the following:

            $setup_intent = \Stripe\SetupIntent::retrieve($event->data->object->setup_intent, $connected_account);
            $default_payment_method = $setup_intent->payment_method;

Stripe\Customer::update(
                $customer,
                [
                  'invoice_settings' => [
                    'default_payment_method' => $default_payment_method
                  ],
                ], 
                $connected_account
            );```
snow notch
#

What's the error?

#

Can you share a failing Event ID evt_xxx

peak crest
#

sure

#

how can I check it?

#

cs_test_b1Du73c6cVgc8ERwXo5T81EFL4zxqP0xYzsOEI7LUoXuR6PvT0VN0sfqmK

snow notch
#

That works

#

My assumption here is that there's no setup_intent field on your object

peak crest
#

ok, but why is it not catching that error?

#

Do I have to check first if it is present then if yes call it, if not then not retrieve it

#

Also, can I still do this:

                $customer,
                [
                  'invoice_settings' => [
                    'default_payment_method' => $default_payment_method
                  ],
                ], 
                $connected_account
            );```
#

before: ```$customer = $event->data->object->customer;`

snow notch
snow notch
#

The setup_intent field never be set for Payment Links as there's no 'setup' mode (only with Checkout)

peak crest
#

so my question is, how do I get a default payment method, and customer from a payment link?

#

I can see that there is no customer

snow notch
#

Indeed, Payment Links don't create Customer objects but instead use Guest customers

peak crest
#

how can I diferentiate in my webhook between a payment-link or a checkout session

#

?

#

I am listening for checkout.session.completed

snow notch
#

Well they both use the same underlying Checkout Session events/objects

#

So you'd check for the fields you're expecting/not expecting and handle accordingly

peak crest
#

Also, I don't see a description on the dashboard, under payments

#

I only see pi_3KgSLsGZgYEIO0k51yQKKFEH

snow notch
#

Yup, those can't be set with Payment Links

peak crest
#

really?

#

Payment links are super limited

#

no ability to update amount on them, no ability to save customers, or payment methods

snow notch
#

They're a low/no-code solution

#

If they don't fit your requirements, then you should use Checkout

peak crest
#

I already use checkout

#

but was wondering if in my implementation I should also include payment links

snow notch
#

What's the use case? Seems like you're just adding complexity (i.e. your webhook handler)

#

If you need both, then maybe in your webhook handler you can route checkout.session.completed events to different functions depending on their mode value

peak crest
#

mode ?

#

what is the mode value?

cobalt pond
peak crest
#

I have another question

#

about a connected account not showing up SEPA debit

#

I asked a few times about this

cobalt pond
#

Sure, what's the question?

peak crest
#

I have it enabled in the platform, so not sure why it is not appearing in checkout

#

And in the platform dashboard under payment methods > connected accounts I have it set up as On by default

cobalt pond
#

When you're creating the Checkout Sessions, are you providing a Stripe-Account parameter so the session is created on the connected account?

peak crest
#

yes, that was not the question

#

I have no problems connecting accounts and doing things related to connected accounts

#

sorry

#

I get the checkout session from the connected account.

#

but without the payment methods

cobalt pond
#

Apologies, I know it's not your question but it is a key detail that I needed to know to help answer your question.

#

So when you're in the dashboard, looking at your Connect settings for Standard Accounts, do you see a banner saying something along the lines of the following?

Platform Controls will not apply to X of your existing connected accounts. Your platform does not have permission to manage these accounts.

peak crest
#

no

#

I don't see that

#

ah yes

#

I see this:
Platform Controls will not apply to 18 of your existing connected accounts. Your platform does not have permission to manage these accounts.
Learn more

#

Why am I getting that message ?

cobalt pond
#

Because platform controls is a newer functionality, and not all existing connections are ready to support it yet. I would recommend taking a closer look at the particular account where you're not seeing SEPA appear in their checkout sessions, and check if SEPA is enabled for the account.

peak crest
#

yes

#

it is enabled

#

on the connected account

cobalt pond
#

Hm, can you share the ID of a checkout session where you're seeing this behavior?

peak crest
#

sure

#

how can I find it?

#

cs_test_a1prY5ZZ3UOpALRrNcicYZsbUpz3D5xKf0jqBUXBSoLsPl56NvjJHb2jBW

blissful abyss
#

Thanks for the ID. Looking in to it

blissful abyss
#

Still looking in to this. I can see that SEPA is set up on that account and have been checking in to why else this might not be there. Will still need a bit more time