#fossil_unexpected
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/1229356648422703144
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
👋 happy to help
would you mind sharing a screen recording of the behavior you're seeing now?
I got a screenshot if that helps
Naam == Name 🙂
Same for PayPal and some other methods.
are you using the PaymenElement?
I am redirecting to hosted Checkout
The customer object used for this test has a name attached to it.
would you mind sharing the request ID for creating the C?heckout session?
Let me see
Is that the cs_ ID?
cs_test_a1qB2BOW1570Md0GuIYiZtrkOa1z28TMPQErQ3cjC2vgWQQYLPYdTCikVz
that works too
🙂
so as you can see in the response of the Checkout session creation https://dashboard.stripe.com/test/logs/req_GY6gJm5P2l6oFy the customer_details doesn't contain a name
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I'm checking to see why
give a couple of minutes
Heh indeed. I also tried providing those details directly when making the session but that's not supported when also providing a cus_ (which makes sense)
yes that's correct
Ok. I'm making a coffee so might not reply for a few mins.
no worries, still looking into it
I do have another small question. I could make another thread if it's not a short answer haha:
The payment methods shown on Checkout depend on customers location. But if I am visiting the US for example, it wouldn't show my local payment methods like Bancontact or Giropay. I have auto currency enabled. Is there any way to enable some kind of link/button on the Checkout pages to show ALL available payment methods for the selected currency?
no need to create new threads when you have one open
before moving to your new question
let me give you a definite answer on your original question
what you're seeing is the expected behavior
the name that is collected on the checkout page is more related to the PaymentMethod rather than the customer
In payment mode, Stripe prefills the Checkout page’s email address, name, card details, and billing address with the customer’s most recent card payment method. Customers can’t update their prefilled email address in the Checkout page.
I did notice that when choosing card it prefills the previous used card. But not for any other methods.
But... there's no real need to collect the name for things like Paypal or iDeal etc. So I am curious why Stripe requires this and prohibits pre-filling it.
For example. Another PSP (Mollie) just redirects to the page where you choose your bank without asking for any extra information. In this case for iDeal.
I did notice that when choosing card it prefills the previous used card. But not for any other methods.
correct
So maybe this could be a feature request? 🙂
yes that's correct
I think it's best if you send an email to https://support.stripe.com/?contact=true with more examples and a comparison with other PSP
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
this could drive more the feature request
Okay will do that. Cheers.
let me know if you need any more help
What about the payment methods shown. Can I enable something so the user can see all methods available and not just the ones Stripe deems best based on their location?
you mean the ordering? or what exactly?
Well it shows a subset of all available methods AFAIK. Based on where the customer is. So I am thinking that if an American is visiting Spain for example. It would show European payment methods. And vice versa. Is there a way to make it show every method available for the selected currency?
Or is my thinking just wrong lol
it's not just about the IP
it's a more intricate algorithm
and no you can't override it
even if you pass a list of what payment method types you want the customer to see, we will filter down to what we (Stripe) think is appropriate
I used to just list every method on my website and force the method when making the Checkout session. But now with auto currency I cannot do that, since you cant make an iDeal payment while providing USD at the currency.
Although now that I say that out loud I think something like that should be supported with auto currency. Where it will just convert the USD to EUR and show that to the customer.
And can't use Cashapp for example when telling checkout to use EUR. It only works when you dont specify a payment method so the customer gets the currencies he can pick from.
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
list every method on my website
Where do you want to show this? Is it like for a preview of what payment methods will be allowed on the checkout? Or you make the customer select the payment method on your website, and then allow just that one on the checkout?
I used to do this on my own checkout form. It showed the price, all avail. methods and then I redirected to Stripe with the payment_method set in the Checkout session.
But now that I use auto currency that doesn't work. Because creating an iDeal, Bancontact etc. payment with USD set as the currency is not allowed.
So then I figured if there's a setting in Stripe that just always shows all payment methods for the selected currency on the hosted Checkout pages... that would work too. But perhaps I am overcomplicating stuff.
I'm worried about people trying to checkout while not being in their own countries or using English for the OS/Browser will be missing payment method options they'd normally use. Like iDeal, Giropay etc.
It's best to let Stripe select and display the payment method types, rather than doing it manually, since it will defeat the purpose of all the conversion optimisations. You can force the country on the checkout by creating a Customer object and setting the country attribute on it.
Ah that last bit might be useful. Thanks.
Last question. How do I get the fee that I pay Stripe for the transaction?
I used to get the balance_transaction ID from the payment intent webhook and then perform an API call. But In the latest API version that balance_transaction ID doesnt seem to exist.
$balanceTransaction = $stripe->balanceTransactions->retrieve(
$this->balanceObjectId,
[]
);
This is what I used to do basically.
What event type have you been listening to?
This used to be present on the payment_intent.succeeded webhook
Now I am listening for checkout.session.completed and checkout.session.async_payment_succeeded on the 2024 API version. I used 2020 verson before (diff project/website)
I see balance_transacton being present on charge.updated but not sure if that's the way. It feels like I need to do way more work by making multiple API calls just to get some basic transaction info.
Because then I listen for charge.updated, grab the balance_transaction and then do another API call to Balance API.
Same thing for grabbing the payment method used. I need to do an API call to the payment intents API with the pi_ ID from the checkout.session.completed just to see the actual method used.
If you listened to payment_intent.succeeded webhook, you might have been looking at charges parameter, which recently changed to latest_charge.
Indeed $balanceObjectId = $data->charges->data[0]->balance_transaction;
I recommend you to still listen to payment_intent.succeeded or checkout.session.completed to be sure. Then you can expand either of those (the PaymentIntent object, or Checkout Session, respectively), to get to the Charge and then Balance Transaction.
So I guess I should start listening for that webhook again, grab the ID and do a second API call right?
Just feels wrong though 😛 All this info could be present in one single webhook. Things look more complicated than back in 2020 when I created this haha. Not complaining, just me not grasping it probably.
Ah yes. How can I expand a webhook? I thought that was only possible when doing an API call TO Stripe.
What programming language are you using?
PHP
I guess I could do an API call to the PaymentIntents API and expand that to include the fee
Yes, that would be the best way forward.
Okay. Is this example wrong? https://docs.stripe.com/expand/use-cases
The PHP version of it shows an array being passed in the retrieve() function. But my install complains it's expecting 2 arguments, first being a string with the pi_
Looks like it is.
Anyway. I got it working using expand. Thanks for the help!
Happy to help.