#nicolas-bouteille-elephorm_api
1 messages Ā· Page 1 of 1 (latest)
š 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/1339985365003407422
š Have more to share? Add more details, code, screenshots, videos, etc. below.
just to mention that these payment methods have not been attached to the customer through Stripe Checkout but with PaymentIntent API creation or directly through the customer portal. I am just beginning my tests with Stripe Checkout.
but I would assume that since the customer can see those payment methods in his customer portal, as long as Checkout knows which customer is concerned, these payment methods should be suggested to be reused. Especially with saved_payment_method_options allow_redisplay_filters...
Hi, the requirements for showing saved payment method details are here: https://docs.stripe.com/payments/existing-customers?platform=web&ui=stripe-hosted#prefill-payment-fields
You'd want to ensure that billing details are included on the customer. Please also note the prefilled payment method displays for 30 minutes following Checkout Session creation. After it expires, loading the same Checkout Session doesnāt prefill the payment method anymore for security reasons.
Isn't "Display additional saved payment methods" a different option than Prefill fields on payment page ?
The above link is about prefilling payment fields: https://docs.stripe.com/payments/existing-customers?platform=web&ui=stripe-hosted#prefill-payment-fields
screenshot
yes it looks like you are talking about "prefilling payment fields" when what I want is just to "Display additional saved payment methods"
the section just above on the doc
that could also suggest payment methods like Paypal for example
So are you asking how to surface additional payment method details? Does the customer have billing address?
I don't know what "surface additional payment method details" means, I want the existing payment methods of the customer to be available at checkout. Yes he already has a billing address.
available payment methods and address
Can you create a new Checkout Session by following the document, https://docs.stripe.com/payments/existing-customers?platform=web&ui=stripe-hosted#display-additional-saved-payment-methods and share that Checkout Session creation id with me?
here is my code:
$checkout_session = $stripe->checkout->sessions->create([
'customer' => $stripe_customer_id,
'line_items' => [
[
'price' => 'price_1QsPKJLaAQrxbmc91WyX2p2N',
'quantity' => 1,
],
],
'mode' => 'payment',
'saved_payment_method_options' => [
'allow_redisplay_filters' => ['always', 'limited', 'unspecified'],
],
'success_url' => 'http://multi.elephorm:8888/',
]);
sorry you wnat the ID not the url
cs_test_a107Rjg8Aix8c3AptZ70t6uNYRjtxRmtHqG9RY2J0S8s2x57OFIvC8Ynyu
this is what Checkout looks like: missing existing payment methods
Looking
I think the issue is that these payment methods do not have full adress. These require values for email, name, and all address fields. Can you update the payment method details, https://docs.stripe.com/api/payment_methods/update#update_payment_method-billing_details and provide values to all?
The billing details hash does not have email, name, and full address
what will happen if the customer creates a new payment method from his Stripe Customer Portal? Will these be filled?
I will try it now
I've just added a new card on the customer portal and it does not show up at checkout. it seems weird that I would have to update the payment method added throuth the portal with full address so that it can show up at checkout no ?
that's the pm id : pm_1QsRlmLaAQrxbmc99AJFCJeU
I think that is designed this way. If you update the full billling details, do you see the payment methods?
ok I will try
so far I've been able to update name and address but not the email
and the pm does not show up so far
let me see how I can update the email though API
it works man!
Great to hear!
works
so should I report a bug that the customer's Name, Adresse and Email are not properly associated to the Payment Method when created through customer portal then?
I do not think it's a bug, rather it just collects only the required details
You can use the CheckoutSessions to collect these details instead
can you elaborate on the last sentence please?
If the above behavior is what you want, you do not use the Customer Portal to collect the payment details. Rather, you use the Checkout Session
Ok but our customers will also have access to their customer Portal. For example in order to update their subscription and payment methods and billing address and retrieve invoices. If they add a new default payment method, whouldn't you expect it to show up at next checkout session?
I would
If you know the customer's email and address, and these are required on payment methods, I don't understand why they are not attached to the payment method at creation?
when the payment method is created by the customer from the portal I mean...
Would passing these https://docs.stripe.com/api/customer_portal/configurations/create#create_portal_configuration-features-customer_update-allowed_updates to collect the details work for you? Can you test this?
I'm not sure I understand what you suggest I do
You change the customer billing portal configuration to collect the additional details required to surface these payment methods on the Checkout
I provided the exact link to the API to test
so you suggest that I put for example "address" in features.customer_update.allowed_updates so that the customer can edit his billing address ?
Kind of but you create the billing portal configuration to tell it to collect these details, and pass that id when you create the Customer Postal Session: https://docs.stripe.com/customer-management/integrate-customer-portal
ok so I think this does not solve the problem. As of right now, my customers, when they access their customer portal can already edit their billing address. Yet the problem is that this address is not attached to the payment method when they create a new payment method through the customer portal. Neither is their email.
your solution could work if the only thing missing was their "name" but right now neither the address nor the email get attached to the pm...
Hi hi! Iām going to be taking over for my colleague here; give me a moment to read back. Thanks!
hi thank you
so just to sum up where we are now, the first question has been answered: how to make existing payments methods of the customer to show up at checkout? => we found out that the payment method needed the name, address and email of the customer.
Which brings my new question: if these data are required for the pm to show up at checkout, why aren't they attached to the pm when it is created by the customer from his portal and we know his email and billing address?
right now I would have to listen to pm creation webhook and manually update the pm with this info so that they can be visible at checkout... can't Stripe do it automatically?
Amazing, thanks. Let me think on this for a moment.
You are using the Customer Portal to gather their payment details?
they have access to the Customer Portal all the time to manage Subscription, Payment methods, Billing address and retrieve invoices
but we will use Stripe Checkout for payments
so we expect Payment Methods added through the Portal to be available when purchasing stuff through Stripe Checkout
I've tried to add a Payment Method through the customer Portal and the created PM did not have the name, email and address of the customer although these are info we already have about the customer
so only after manually adding this info to the PM was the PM visible at checkout
If we're switching to Stripe Billing, Stripe Portal and Stripe Checkout it is so that things are done automatically... I don't expect to have to manually add customer's info to the payment method he creates through your portal so that payment method can be available at checkout...
I'm gonna have to leave now. I understand this is the actual behavior and you don't have a magic solution for me right now. I will write an email to the support explaining my feature request and I guess that for now I'm gonna have to manually add the customer's info to the payment method when it is created. I don't know what is the real problem here: the payment method not being provided unless name + email + address are not attached to it OR this information not being attached to the PM when it is createdā¦
Wait one, sorry.
I have like a half dozen conversations happening and all the beeps sound the same. š
any last thought before I go then?
First, did you try allow_redisplay_filters: ["always", "limited", "unspecified"] ?
yes
Ok. I would expect the same interoperability for sure. I am just digging into the Customer Portal to see if there's a way to force address collection on PM creation.
thank you
will wait on you then
of course we would not want the customer to have to specify his address once again when adding a payment method (unless it is prefilled with the already known address)
Once only, for sure - and ideally the first time, right?
not sure what you mean but I guess... my point is: if the billing address is already known for that customer, I don't want him to have to type it again when adding a payment method
until now we did, but as soon as you'll be in charge we won't
so for the migration we can provide the address, but in the future, the customer can update his address then create a PM through the portal
so we would have to listen to the webhook PM created and retrieve the address from you and attach this to the PM
silly
ok maybe I found something
šæ
What's weird here is that the customer is able to pay with these payment methods from the custom portal, for example when the subscription renewal fails and they go add a new payment method. Yet they are not available at checkout
I'm thinking maybe there are different types of checkout
ones where we will create an invoice and those where we won't
Checkout doesn't create a Stripe Invoice.
wow are you sure about that?
I cannot use Stripe Checkout and have an invoice at the end?
chatGPT tells me we can have an invoice with Stripe Checkout
so basically what I mean is that perhaps the reason why so far my PMs are not showing up unless they have the billing info is because I have not configured my checkout session to retrieve the billing info?
maybe if I set the checkout session to retrieve billing info and create an invoice, maybe then the PMs without billing info will be suggested
Grabbing teammates to dig for me.
thx
ok I have added the parameter 'billing_address_collection' => 'required', when creating the Checkout session
but the billing address form is not above or below the payment method section but inside each payment method
so it is indeed the Payment Method's address that is used, not the customer's billing address
Yes, and that makes sense, because different cards could have different billing addresses - which is relevant for processing the charge.
I actually don't know what to think about this... for me the billing address should not be related to the Payment Method. With Stripe Billing and subscriptions, they are not linked
say you need to borrow your friend of family card to finalize the purchase but you want the invoice to be under your name and address ?
The billing address is (or should be).
If you try processing your friend's card with your address, it should by all accounts fail because your address is not that card's billing address.
Ah
It actually is true. Those charges should fail zipcode validation. It might not always, but they should by design (of the credit card system).
Also:
From an Invoicing perspective, a billing address is "who should I, the vendor of an item, send the bill to?" but fom a VISA / MC perspective, it is "who should I send this credit card statement to?"
I agree that: if you attach an address to the payment method and the address is not the one that the bank knows, payment will fail.
But you don't have to have an address linked to a Payment Method for the payment to work
You for example don't attach any address to the Payment Method when it is created through the Portal, yet customers can actually pay with those
and they provide their billing address separately so that is it used only for the invoice
now maybe we can start to understand why the customer's address IS NOT automatically attached to the Payment Method they create through the Portal : because it could be someone else's credit card with a different name / address etc so it could fail the payment
So I realize that attaching the customer's email, name and address to their credit card might not be to right solution for me afterall because it could make more payments fail
my real problem is Stripe Checkout requesting the billing address to be attached to the card and not the invoice
my real problem is Stripe Checkout requesting the billing address to be attached to the card and not the invoice
Right, but this is how it works - but I would expect we can require this in Customer Portal. I'm just trying to figure that out.
Also a colleague has taken over new conversations, so I have you and one other that I'm working on now.
ID of an existing Customer, if one exists. In payment mode, the customerās most recently saved card payment method will be used to prefill the email, name, card details, and billing address on the Checkout page.
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-customer
...which just confirms why it's not doing what you want it to.
ok I guess I know how things have been designed so far
I am curious to see what will happen if the customer provides a new billing address for his Payment Method, I'm pretty sure it won't update the billing address on his customer Portal, which is the billing address of the Customer entity.
I find it weird that Stripe Checkout and Stripe Billing don't handle things the same way
If I had to guess I would say that Stripe Checkout is older and has been created that way, then they did not to want the same mistake for Billing, but could not change how things are done on Checkout
this is assuming the Portal was created along with Billing...
Totally fair. As far as I can tell, there's unfortunately no way to tell Customer Portal to require customers to provide their full address unfortunately.
Stripe has evolved pretty dramatically since it started in ~2010.
do you mean: no way to require customers to provide their full address when they create a new Payment Method?
Via Customer Portal configuration, that is correct.
No but that makes sense, because nobody wants to have to type his address for each and every Payment Method⦠which is why now the billing address is handled separately from the Payment Method on the Portalā¦
But more important, attaching the customer address to the Payment Method can make the payment fail if he's not using his own payment methodā¦
So I guess if we start using Stripe Checkout, because the customer's will have to match their billing address to the Payment Method, they won't be able to use other people's Payment Methods and we will have more payment failures
So the Customer Portal allows for updating the billing address, but that's the Invoice billing address we were talking about before.
yes exactly
the only one we should care about IMHO
right now we have already switched to Stripe Billing for subscription renewals. The Payment Methods don't have any billing details attached and they work. The billing address is only used for the invoice
it's a bummer that Stripe Checkout does not work this way too
Have you considered using Invoices and Hosted Invoice Pages instead for one-off transactions?
I don't know what that is, but I'm pretty sure Stripe Checkout is what we need: we are an ecommerce selling individual trainings or subscriptions, we have a cart and stuff... would your solution fit to this?
also we probably don't want to create an invoice unless it has been paid. I assume this is how Checkout works?
ok I really have to leave know it is 8pm in France and I still have one last migration before I can finish my day
thank you for your time and your help even though what I discovered is not necessarilly good news :/
Hosted Invoicing could work for you and it keeps it within the 'Billing' realm.
Also you're welcome and also I'm sorry I took so long to come to this conclusion.
I don't think hosted invoicing could work because we also have to deal with new customers whom we don't have the billing address yet
I assume we need to have the billing address before creating the invoice...
The minimum is, I believe, a Customer ID: https://docs.stripe.com/api/invoices/create
Using invoices here means 1) all your inflows are Stripe Invoices; 2) If you're using Invoice History in the Customer Portal they will see both their Subscription invoices and their one-off invoices in the same place.
Checkout can create Invoices too though: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-invoice_creation-enabled
Ok I have to run, but my colleague is here if you need us to keep digging on this stuff.