stripe / react-stripe-js

React components for Stripe.js and Stripe Elements
https://stripe.com/docs/stripe-js/react
MIT License
1.75k stars 267 forks source link

[BUG]: Canno suppress the `name` field of `Address` element, particularly when using `afterpay_clearpay` #447

Closed atrauzzi closed 7 months ago

atrauzzi commented 1 year ago

What happened?

image

This is the default form that Stripe presents for Afterpay. Unfortunately, I can't create a payment intent server-side using the captured payment method without address information.

I would like to capture the address information prior to submitting the payment method to my server, but now when I try to make use of the Stripe Address element, I end up getting the "name" field twice!

image

As a sidenote: In general, the DX for the Afterpay element feels a bit disjointed, are we sure it can't be improved some? Perhaps just have the regular Stripe payment element incorporate these required fields instead of requiring me to splice it in? Would make for a much simpler experience, similar to Klarna.

Environment

No response

Reproduction

No response

stale[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

atrauzzi commented 11 months ago

Not stale, would love to see it addressed!

singh-sidharth commented 11 months ago

I'll try contributing to this when I have time. I am looking to close some react js issues or my skills might go stale :-D Whom do I talk to about contributing?

brendanm-stripe commented 11 months ago

Hey @atrauzzi -- apologies for not replying sooner, having missed the initial challenge for the Afterpay & Payment Element feedback at the end.

While you cannot currently hide the name field of the address element, you can hide the name field of the Payment Element. You can do this using the fields option (ref):

fields: {
        billingDetails: { 
          name: 'never',
        }
    },

Note the remark that when doing this, you'll need to provide the values from the hidden fields with confirmPayment within billing_details (ref), and you'll encounter an error if this is not provided.

As for the higher level feedback, thanks for sharing that! We're currently looking at ways to make the Payment Element and Address Element more flexible for different use cases and integration preferences.

atrauzzi commented 11 months ago

I guess it's just the hassle of having to manage all that wiring then based on the type of payment selected. It would make more sense if the element could just re-design itself according to the bare minimum needs of the payment method selected?

brendanm-stripe commented 11 months ago

In mode=billing I'd agree, and have filed feedback internally to address that. The Shipping address name though isn't necessary the same name as the name for the payment.

stale[bot] commented 10 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

atrauzzi commented 10 months ago

Not stale.

stale[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

atrauzzi commented 9 months ago

Not stale.

stale[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

atrauzzi commented 9 months ago

Not stale.

stale[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

atrauzzi commented 8 months ago

Bad bot, not stale.

stale[bot] commented 7 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

atrauzzi commented 7 months ago

@brendanm-stripe Can we disable this bot?

atrauzzi commented 7 months ago

Er...