#prasun_code

1 messages ¡ Page 1 of 1 (latest)

hidden riverBOT
#

👋 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/1326934524436676639

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

cinder geyser
#

If collecting both billing and shipping address you can't

finite sparrow
finite sparrow
cinder geyser
#

If only collecting a billing address that checkbox won't be there

finite sparrow
#

what needs to change in the api parameter here?

cinder geyser
#

To not collect shipping?

finite sparrow
cinder geyser
#

You can only opt out of shipping

#

Don't pass shipping_address_collection or shipping_options in the request

finite sparrow
cinder geyser
#

You can't

finite sparrow
#

Can I allow only US in the billing country and also prepopulate value?

cinder geyser
finite sparrow
#

$customer = $this->stripe->customers->create([
'address' => [
'city' => $customerData['city'],
'country' => 'US',
'line1' => $customerData['address1'],
'line2' => $customerData['address2'] ?? null,
'postal_code' => $customerData['zip'],
'state' => $customerData['state'],
],
'email' => $customerData['email'],
'name' => $customerData['first_name'] . " " . $customerData['last_name'],
'phone' => "+1" . $customerData['homephone'],
'shipping' => [
'address' => [
'city' => $customerData['city'],
'country' => 'US',
'line1' => $customerData['address1'],
'line2' => $customerData['address2'] ?? null,
'postal_code' => $customerData['zip'],
'state' => $customerData['state'],
],
'name' => $customerData['first_name'] . " " . $customerData['last_name'],
'phone' => "+1" . $customerData['homephone'],
],
]);
$customerId = $customer->id;

#

I am creating the customer record first then assigning the customer ID in the checkout session
API
'customer' => $customerId,

#

Is it enough to prefill in the checkout form?

#

email and phone number are already prefilled.