#Kalluste
1 messages · Page 1 of 1 (latest)
Hi there!
I just set the email field to "never" and provide the email when confirming payment in my front-end.
Yes this is the correct approach when using the Payment Element
but I see that it's also possible to send the email when creating the payment Intent. Would it be possible to handle this on the api side with that request or is the front-end solution the only way?
Would it be possible to handle this on the api side
What do you mean by "this"?
prefill the email for the customer so that they wouldn't have to enter it in elements
when creating a payment intent
It's possible to prefill values in the PaymentElement: https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-defaultValues
Yes, that I read aswell. But can it be done so that when creating a payment intent with stripe nodejs package in my backend I already provide the billingAddress.email so that when the end customer sees the payment element in front-end Stripe would be smart enough to not ask them their email again
Unfortunately that's doesn't work like this for the Payment Element. So either hide the field or prefill the field.
okay. thank you very much!
I have one more question regarding external accounts
if I can
return this.stripe.accounts.createExternalAccount(stripeAccountId, {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @minor fossil-ignore
external_account: {
object: 'bank_account',
country: iban.slice(0, 2),
currency: data.currency,
account_holder_name: data.bankAccountHolderName || undefined,
account_number: iban,
},
default_for_currency: true,
});
I have to use @minor fossil-ignore here because stripe.accounts.createExternalAccount does not allow sending external_account as object
I just updated my nodejs package
but the weird thing is that it works and stripe documentation says that this is the way to do it
Give me a few minutes to look into this.
but the weird thing is that it works and stripe documentation says that this is the way to do it
Can you share a link to the documentation that mention this?
And which version of stripe-node are you using?
stripe version is 12.2
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
DOCS says: Either a token, like the ones returned by Stripe.js, or a dictionary containing a user’s bank account details (with the options shown below).
And the code you shared is working as expected?
yes
I have to leave for half an hour but if you find anything I'll keep this thread open! 🙂 thanks in advance!
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!