#_andriiko

1 messages ยท Page 1 of 1 (latest)

pulsar swiftBOT
mellow haven
#

Hi ๐Ÿ‘‹ our Elements can't be used to collect custom data that they don't already collect. You will need to include your own fields to collect and provide those details.

#

With regards to part 1, what does your flow look like currently? When do you surface the address element, and where are you hoping to put the information that it collects?

pulsar swiftBOT
tacit jetty
#

Hi ๐Ÿ‘‹ our Elements can't be used to collect custom data that they don't already collect. You will need to include your own fields to collect and provide those details.
Sure, if I create my custom field, how can I send its value to Stripe when confirming payment using stripe.confirmPayment()?

#

Right now, I'm exposing an AddressElement with the Billing type. In the Stripe dashboard, I can see this address in the Payment method section, but it's not appearing in the downloaded invoice.

mellow haven
#

It depends on the information the field is collecting. If it's supporting by billing_details then you can provide it when confirming the payment:
https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method_data-billing_details
If the data is directly related to a payment though, such as the VAT number you referenced, additional flows will need to be built.

Are you hoping to collect VAT details to influence the amount of the Invoice you're processing a payment for? If so, that data will need to collected sooner, because once the Invoice is finalized it can't be updated.

tacit jetty
#

Checking

#

Are you hoping to collect VAT details to influence the amount of the Invoice you're processing a payment for?
No, I just want to display a custom field in invoice file after customer payment

#

I can't figure out how to use the entered information from AddressElement in stripe.confirmPayment() so that it reflects in the invoice after payment.

mellow haven
#

Gotcha, in that case, you will need to take the value you collected from your custom VAT field, provide it to your backend server, and then make a request to update the associated Invoice's custom fields with that value:
https://stripe.com/docs/api/invoices/update#update_invoice-custom_fields

I don't recall offhand if custom_fields are still editable for a finalized Invoice, and you may encounter an error if that field does get locked on finalization. If that is the case, those values will need to be provided before the Invoice is finalized.

tacit jetty
#

Okay, and what about Address Element in billing mode. How to get data from AddressElement in invoice?

mellow haven
#

I don't believe the Address Element is able to pump the data it collects into an Invoice directly, because Invoices pull billing details from Customer objects but the Address Element provides the information it collects to Payment Methods.

I would recommend trying the following: