Is there a way to specify the billing address of a payment intent with Node.js? Using the Stripe.js browser-side framework, I am able to do this by using Stripe elements and the stripe.confirmPayment function which automatically takes information passed through Stripe elements.
I want to specify the billing address of a payment intent from the backend using TypeScript and Node.js to write unit tests and store the billing address in another database.
Using the stripe.paymentIntents.confirm method, I could find no parameters that allow me to set the billing_details address property in the payment intent in the Stripe API docs.
I tried working around this by creating a customer, assigning that customer an address and a payment intent, then confirming the payment intent, but this would not update the payment intent's billing_details address property. What is the best practice for assigning a payment intent an address in its billing_details property in Node.js from the backend?
Thanks
I don't believe Payment Intents have a billing_details property (unless it's on an old API version somewhere). If you're talking about the billing_details property on the Charge object, the fields are inherited from the associated Payment Method (see here).
If you need them for something, you can either make a separate retrieve API call to get the Payment Method's billing_details hash, or simply get it from the response that gets sent back after you create the Payment Method.