fix: optionally add name to customer creation (#43486)
This commit is contained in:
@ -184,7 +184,7 @@ export async function createStripeCardDonation(req, res, stripe) {
|
||||
user
|
||||
} = req;
|
||||
|
||||
if (!tokenId || !amount || !duration || !name || !userId || !email) {
|
||||
if (!tokenId || !amount || !duration || !userId || !email) {
|
||||
throw {
|
||||
message: 'Request is not valid',
|
||||
type: 'InvalidRequest'
|
||||
@ -203,7 +203,7 @@ export async function createStripeCardDonation(req, res, stripe) {
|
||||
const customer = await stripe.customers.create({
|
||||
email,
|
||||
card: tokenId,
|
||||
name
|
||||
...(name && { name })
|
||||
});
|
||||
customerId = customer?.id;
|
||||
} catch {
|
||||
|
Reference in New Issue
Block a user