#ejazmusavi
1 messages · Page 1 of 1 (latest)
its Payment Element.
ok
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.
you need to deactivate LINK from
https://dashboard.stripe.com/settings/payment_methods
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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'
}
}
}
},
});
you can use the Address element https://docs.stripe.com/elements/address-element
actually I dont want to create address elements. the firstname, lastname and email coming from database, I just need to submit with payment.
oh ok then you just add those to the billing_details
i am confused in adding those fields. can you guide me please?
they are the same object as this https://docs.stripe.com/api/payment_methods/create#create_payment_method-billing_details
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so under billing_details you add email and name props
thank you so much. it worked.