#nicolas-bouteille-elephorm_api

1 messages Ā· Page 1 of 1 (latest)

small orioleBOT
#

šŸ‘‹ 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.

lethal crest
#

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...

fallen pewter
lethal crest
#

Isn't "Display additional saved payment methods" a different option than Prefill fields on payment page ?

fallen pewter
lethal crest
#

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

fallen pewter
#

So are you asking how to surface additional payment method details? Does the customer have billing address?

lethal crest
#

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

fallen pewter
lethal crest
#

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

fallen pewter
#

Looking

#

The billing details hash does not have email, name, and full address

lethal crest
#

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

fallen pewter
#

I think that is designed this way. If you update the full billling details, do you see the payment methods?

lethal crest
#

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!

fallen pewter
#

Great to hear!

lethal crest
#

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?

fallen pewter
#

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

lethal crest
#

can you elaborate on the last sentence please?

small orioleBOT
fallen pewter
#

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

lethal crest
#

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...

fallen pewter
lethal crest
#

I'm not sure I understand what you suggest I do

fallen pewter
#

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

lethal crest
#

so you suggest that I put for example "address" in features.customer_update.allowed_updates so that the customer can edit his billing address ?

fallen pewter
lethal crest
#

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...

errant crater
#

Hi hi! I’m going to be taking over for my colleague here; give me a moment to read back. Thanks!

lethal crest
#

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?

errant crater
#

Amazing, thanks. Let me think on this for a moment.

#

You are using the Customer Portal to gather their payment details?

lethal crest
#

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…

errant crater
#

Wait one, sorry.

#

I have like a half dozen conversations happening and all the beeps sound the same. šŸ˜‚

lethal crest
#

any last thought before I go then?

errant crater
#

First, did you try allow_redisplay_filters: ["always", "limited", "unspecified"] ?

lethal crest
#

yes

errant crater
#

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.

lethal crest
#

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)

errant crater
#

Once only, for sure - and ideally the first time, right?

lethal crest
#

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

errant crater
#

Yes.

#

Oh.

#

Do you have the billing address in your system too?

lethal crest
#

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

errant crater
#

šŸæ

lethal crest
#

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

errant crater
#

Checkout doesn't create a Stripe Invoice.

lethal crest
#

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

errant crater
#

Grabbing teammates to dig for me.

lethal crest
#

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

errant crater
#

Yes, and that makes sense, because different cards could have different billing addresses - which is relevant for processing the charge.

lethal crest
#

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 ?

errant crater
#

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

lethal crest
#

that's not true

#

I've done so with train tickets, Apple products as well

errant crater
#

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?"

lethal crest
#

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

errant crater
#

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.

lethal crest
#

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...

errant crater
#

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.

lethal crest
#

do you mean: no way to require customers to provide their full address when they create a new Payment Method?

errant crater
#

Via Customer Portal configuration, that is correct.

lethal crest
#

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

errant crater
#

So the Customer Portal allows for updating the billing address, but that's the Invoice billing address we were talking about before.

lethal crest
#

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

errant crater
#

Have you considered using Invoices and Hosted Invoice Pages instead for one-off transactions?

lethal crest
#

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 :/

errant crater
#

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.

lethal crest
#

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...

errant crater
#

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.

#

Ok I have to run, but my colleague is here if you need us to keep digging on this stuff.