I'm creating a Checkout session and it's working fine, but when the customer is redirected to our app, his invoices do not mention the address that was collected throughout the Checkout process. It makes no sense to me, but that's how Stripe works...
Any idea what we are supposed to do to correct that (get the billing address from the customer that was filled by him during Checkout, than modifying the invoice).
Here's how we're creating the session :
return stripe.checkout.Session.create(
customer_email=userEmail,
billing_address_collection='required', =>>> REQUIRED !
payment_method_types=['card'],
subscription_data=subscription_data,
line_items=[{
'price': priceId,
'quantity': 1,
}],
metadata={
'vatNumber': vatNumber,
'accountId': accountData['accountId'],
},
mode='subscription',
success_url='https://xxx/home/account',
cancel_url='https://xxx/home/upgrade',
)
And than here's the result from the Webhooks :
{
"object": {
"id": "cs_test_pNl9BXBCAtTEoXmTD1Ii2e8e34DK28MyUZSBZrqHjz6ZNPvft0",
"object": "checkout.session",
"allow_promotion_codes": null,
"amount_subtotal": 19000,
"amount_total": 22990,
"billing_address_collection": "required",
"cancel_url": "https://www.xxxxx/home/upgrade",
"client_reference_id": null,
"currency": "eur",
"customer": "cus_xxxxxxhL00at",
"customer_email": "xxxxxm",
"livemode": false,
"locale": null,
"metadata": {
"accountId": "f88e5bfc-3a2a-4103-bd3e-33d3ebbe2963"
},
"mode": "subscription",
"payment_intent": null,
"payment_method_types": [
"card"
],
"payment_status": "paid",
"setup_intent": null,
"shipping": null,
"shipping_address_collection": null,
"submit_type": null,
"subscription": "sub_Hxxxx",
"success_url": "https://www.xxxx/home/account",
"total_details": {
"amount_discount": 0,
"amount_tax": 3990
}
}
}
No billing addresss anywhere in the response... I would love to understand the logic behind creating an API that collects the billing address but doesn't use it, or make it easily available, because I'm a bit lost.