0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-25 02:31:59 -05:00

Removed empty customer email from checkout session payload

- removes customerEmail sent as empty string when missing in some cases, which causes Stripe error in checkout session creation
This commit is contained in:
Rishabh 2022-05-24 20:14:51 +05:30
parent 25f9c852b2
commit cd76b9fb6d

View file

@ -335,9 +335,13 @@ function setupGhostApi({siteUrl = window.location.origin, apiUrl, apiKey}) {
identity: identity,
metadata: metadataObj,
successUrl,
cancelUrl,
customerEmail: customerEmail
cancelUrl
};
if (customerEmail) {
body.customerEmail = customerEmail;
}
if (tierId && cadence) {
delete body.priceId;
body.tierId = offerId ? null : tierId;