You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On events: customer.subscription.created
The webhook handleWebHook keeps overwriting with empty value the customer phone to the customer profile.
In my stripe API call to create a checkout i run correctly with
phone_number_collection: {
enabled: true,
},
Indeed my payment page does force you to insert phone number.
In details, this is what's going wrong, i've spotted the error in the soure code:
functions/src/index.ts
// NOTE: This is a costly operation and should happen at the very end.// Copy the billing deatils to the customer object.if(createAction&&subscription.default_payment_method){awaitcopyBillingDetailsToCustomer(subscription.default_payment_methodasStripe.PaymentMethod);}
// the copyBillingDetailsToCustomer implementation, the bug is easily spotted once you go live, the phone from billing_details is always empty even if you have constcopyBillingDetailsToCustomer=async(payment_method: Stripe.PaymentMethod): Promise<void>=>{constcustomer=payment_method.customerasstring;const{ name, phone, address }=payment_method.billing_details;awaitstripe.customers.update(customer,{ name, phone, address });};
Just give it a try, whatever payment that requires phone ends up with a empty phone field on customer page on stripe and in firebase payment. The only place where it doesn't get erased is inside the invoice.
Expected behavior
It is expected that the phone number gets updated when it's available; if for some reasons the phone number is empty (due to stripe errors or stripe delay in the update), it should not overwrite the pre-existing value.
Screenshots
Kind Regards
The text was updated successfully, but these errors were encountered:
Bug report
Describe the bug
On events:
customer.subscription.created
The webhook handleWebHook keeps overwriting with empty value the customer phone to the customer profile.
In my stripe API call to create a checkout i run correctly with
Indeed my payment page does force you to insert phone number.
In details, this is what's going wrong, i've spotted the error in the soure code:
functions/src/index.ts
Code
To Reproduce
Just give it a try, whatever payment that requires phone ends up with a empty phone field on customer page on stripe and in firebase payment. The only place where it doesn't get erased is inside the invoice.
Expected behavior
It is expected that the phone number gets updated when it's available; if for some reasons the phone number is empty (due to stripe errors or stripe delay in the update), it should not overwrite the pre-existing value.
Screenshots
Kind Regards
The text was updated successfully, but these errors were encountered: