#tomb_checkout-overwrite-customer-address
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/1437515373875560518
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- tomb_customer-address-checkout-session, 1 hour ago, 9 messages
Before, loading the checkout page, in both the billing details and the shipping details were similar. Once the checkout payment is selected, only the country code remains
Sorry but the screenshot doesn't provide sufficient context here.
Can you share an example Customer ID where you expect to see these details but don't?
So my main question is:
If the shipping address is connected to the payment method, it doesn't make sense to ask the the customer for their billing details in our own application as Stripe requires it during the checkout session
cus_TOndUf2oYIPy9n
Billing addresses are saved to the Payment Method, not the Customer
Shipping address is saved to the Customer
I think the main reason you might want to collect addresses in your own system is that Stripe dynamically determines how much information to collect based on the Customer country & payment method type.
Some payment methods require the full billing address but others don't.
The code I use during creation of the customer:
$data = [
'name' => $company->name,
'business_name' => $company->name,
'email' => $company->billing_email ?? $company->email,
'description' => $company->subtitle,
'phone' => $company->phone,
'address' => [
'line1' => $billing ? $company->billing_address : $company->address,
'city' => $billing ? $company->billing_city : $company->city,
'postal_code' => $billing ? $company->billing_postalcode : $company->postalcode,
'country' => $billing ? $company->billing_country : $company->country,
'state' => $billing ? $company->billing_state : $company->state,
],
'shipping' => [
'name' => $company->name,
'phone' => $company->phone,
'address' => [
'line1' => $billing ? $company->billing_address : $company->address,
'city' => $billing ? $company->billing_city : $company->city,
'postal_code' => $billing ? $company->billing_postalcode : $company->postalcode,
'country' => $billing ? $company->billing_country : $company->country,
'state' => $billing ? $company->billing_state : $company->state,
],
],
'tax' => [
'validate_location' => 'immediately',
],
];
Stripe Dashboard puts that information both under Billing details (Facturatiegegevens as translation and Shipping details (Verzendgegevens in the picture)
As Stripe does NOT ask for any addresses in the checkout, why does it remove the Billing details on the customer model?
Yes I was able to find/review the creation request which shows all this data
Both addresses are still present on the Customer object
I cannot speak to why the display on the Dashboard changes
Also in the 'edit customer' popup, all details are gone, but the country
While the shipping details remain the same
We focus on Stripe APIs and product behaviors (Payment Element, Express Checkout Element, etc).
If you retrieve the Customer via the API, do you see missing data?
I cannot speak to the Dashboard issues
https://dashboard.stripe.com/acct_1PxukzKJ93WyUBoD/test/workbench/inspector/cus_TOndUf2oYIPy9n
The Inspector of this customer model also shows NULL on address of the customer
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Can you retrieve it via the API?
Ah, wait I see it now. address only includes country: NL
But shipping.address has the full details
Let me examine the customer.updated events associated with this object
Indeed. As shown in the code above, both the customer 'address' and 'shipping_address' were filled during initialization of the customer model in my own application before checkout
So something inside the checkout removes all address details
Alright, I found the event where this occurs. You can see in the previous_attributes that the full address was present but is unset here.
Sorry, the translation on the dashboard is a bit confusing:
It says Billingdetails in dutch, but the Customer->address attributes are shown;
If I manually update the address fields, it updates in the dashboard and in the API Customer retrieve; so the 'address' parameters are translated to billingdetails here
So the customer is updated during the checkout, as the name and company name given during checkout (for example iDEAL) are directly inserted into the customer model.
But as I don't include any address input fields in the checkout of stripe, why does it unset it here/
That seems like a bug to me. Let me try to reproduce on my end
Okay I can confirm I see the same thing. I do see one option in your Checkout session that might be impacting this.
No
@manic ferry is this individual involved in your deployment?
Okay I do think this is still a bug and I will file with the team. However, there is a way around it for you. In your Checkout Session creation request, you specify customer_update.address: "auto". If you remove this, the customer's address will not get reset to just the country when confirming the Checkout Session.
@proven elbow looks like you're in the wrong place, this thread is for someone else's question.
- If you have your own thread please chat there.
- If you have a question or a followup to a closed thread use one of the buttons in https://discord.com/channels/841573134531821608/842637025524842496 to get help (we don't reopen closed threads).
Note that posting inappropriate messages in other people's threads is against the rules. No worries if this was just an honest mistake, but anyone who violates the rules multiple times will be removed from this server.
So that has to be set in:
$checkout = $company->newSubscription('main', $price->id)
->allowPromotionCodes()
->checkout([
'automatic_tax' => ['enabled' => true],
'success_url' => route('checkout.step', ['step' => 'confirmation']),
'cancel_url' => route('checkout.step', ['step' => 'payment']),
]);
In your request log, I do see:
"customer_update": {
"address":
"auto",
"name":
"auto",
},
How do I manually remove this from the checkout API request?
It's your code that generates all the parameters for that API request
Unless this is something the laravel cashier package is doing for you
But the parameter is here
Okay perfect, that should prevent the Checkout session from overwriting the address details you have set
Happy to shed what ๐ก I can ๐
Perfect! Good to hear it was a bug, I couldn't find anything on the internet about people that had issues with this; but thanks a lot!
I will flag internally. The problem is that the Checkout UI collects the minimum amount of the billing address for confirmation. In this case it only required the country. And since the session params had customer_update.country: "auto", it was automatically updating the Customer.address with that value
In cases where you are already collecting that info, you don't want to update the values in the Checkout Session