#ejazmusavi

1 messages · Page 1 of 1 (latest)

lofty wadiBOT
round blaze
#

👋 happy to help

#

is this embedded checkout or Payment Element?

cunning pagoda
#

its Payment Element.

round blaze
#

ok

cunning pagoda
#

const elements = stripe.elements({ clientSecret });
const expressCheckoutElement = elements.create('payment', {
allowRememberMe: false,
allow_promotion_codes: false, // Disable one-click option
billing_address_collection: 'required', // Hide one-click link
fields: {
billingDetails: {
address: {
country: 'never'
}
}
},
});
here is my code to create element.

round blaze
cunning pagoda
#

thank you so much,

#

another question
how to add the customer" first name and last name" fields and customer "email" fields on the stripe checkout. This is because stripe informed me on their platform its for security reasons, they say it is best to have these fields whenever possible.

#

I am submiting the payment using this code
const { error: stripeError } = await stripe.confirmPayment({
elements,
confirmParams: {
return_url: ${window.location.origin}/BrainTree/SuccessStrip.aspx,
payment_method_data: {
billing_details: {
address: {
country: 'us'
}
}
}
},

});

round blaze
cunning pagoda
#

actually I dont want to create address elements. the firstname, lastname and email coming from database, I just need to submit with payment.

round blaze
#

oh ok then you just add those to the billing_details

cunning pagoda
#

i am confused in adding those fields. can you guide me please?

round blaze
#

so under billing_details you add email and name props

cunning pagoda
#

thank you so much. it worked.