#xfechx-plink-default-pm
1 messages ยท Page 1 of 1 (latest)
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
);```
sure
how can I check it?
cs_test_b1Du73c6cVgc8ERwXo5T81EFL4zxqP0xYzsOEI7LUoXuR6PvT0VN0sfqmK
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;`
Well that's up to your webhook handler code!
I'd assume no because the $default_payment_method variable will be undefined
The setup_intent field never be set for Payment Links as there's no 'setup' mode (only with Checkout)
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
Indeed, Payment Links don't create Customer objects but instead use Guest customers
how can I diferentiate in my webhook between a payment-link or a checkout session
?
I am listening for checkout.session.completed
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
Also, I don't see a description on the dashboard, under payments
I only see pi_3KgSLsGZgYEIO0k51yQKKFEH
Yup, those can't be set with Payment Links
really?
Payment links are super limited
no ability to update amount on them, no ability to save customers, or payment methods
They're a low/no-code solution
If they don't fit your requirements, then you should use Checkout
I already use checkout
but was wondering if in my implementation I should also include payment links
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
Hi ๐ jumping in as my teammate needed to step away. They're referring to the mode value of a Checkout Session:
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-mode
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I have another question
about a connected account not showing up SEPA debit
I asked a few times about this
Sure, what's the question?
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
When you're creating the Checkout Sessions, are you providing a Stripe-Account parameter so the session is created on the connected account?
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
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.
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 ?
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.
Hm, can you share the ID of a checkout session where you're seeing this behavior?
sure
how can I find it?
cs_test_a1prY5ZZ3UOpALRrNcicYZsbUpz3D5xKf0jqBUXBSoLsPl56NvjJHb2jBW
Thanks for the ID. Looking in to it
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