#timothy-hahn-grow-therapy_best-practices

1 messages ¡ Page 1 of 1 (latest)

west zincBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1229525461709885520

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

wicked helmBOT
north herald
#

For context, for our use case, we want to collect as little information about the Customer as possible when collecting payment information.

For cards collected, because we are only using the PaymentElement, we can easily only collect the billing postal code.

To match this for Apple Pay (and potentially Google Pay, I need to test this more), seems to be a bit more tricky

rich briar
#

That first link is Terminal but the second two are for an Elements page. Are you using both of these integrations here? I can look in to both but just wanted to double check

north herald
#

Sorry, mislinked, Elements for all of them!

rich briar
#

No worries, happens to me too which is exactly why I checked

north herald
#

Augh, sorry, my history is a mess

#

That one

rich briar
north herald
#
    const options: StripePaymentElementOptions = {
        fields: {
            billingDetails: {
                name: 'never',
                email: 'never',
                address: {
                    postalCode: 'auto'
                }
            }
        }
    }
    <PaymentElement options={options} />
        const {error} = await stripe.confirmSetup({
            elements,
            confirmParams: {
                return_url: "return_url",
                payment_method_data: {
                    billing_details: {
                        name: '',
                        address: {
                            line1: '',
                            city: '',
                            state: '',
                        },
                        email: '',
                    }
                }
            },
        })


For Apple Pay specifically, this appears to clear out the address/e-mail that Apple return successfully, since we don't need the billing address.

The name, however, remains on the Payment Method.

I can set the name to ' ' or '-', or something similar to "redact" the name, but was wondering if there was a best practice way to not store the name on the Payment Method

north herald
rich briar
#

Gotcha, unfortunately I'm not seeing a way to do this with Apple or Google Pay from the Payment Element at the moment. I will put in a feature request for this but I don't think it is currently possible to use Apple or Google Pay without also collecting the name like this if that is the behavior that you are seeing right now.

north herald
#

I can change the name to something else. I just can't change it to null or the empty string, if that makes sense, which I can do with the other fields. So if we can find a way to align behavior (although I'm aware there may be extenuating circumstances on Stripe or Apple's end), I think that'd be ideal.

rich briar
#

What error do we give you when you set null or an empty string? I'm not sure what Apple allows here, I can try to look in to it now but if I can't find it you may need to write in so I can consult more colleagues on if there is an acceptable dummy value for Apple here.

north herald
#

If I set the empty string, it uses the name returned by Apple.

For null, the type is name?: string, so there's a mismatch, since only string or undefined will work here.

And sounds good! Is there a proper way to "write in"?

west zincBOT
rich briar
#

You can write in via https://support.stripe.com/?contact=true and then DM me your email. I'm not finding a good answer on this at point still unfortunately

north herald
#

Got it, thanks! Will do

#

Sent, DM-ing you my e-mail now.

rich briar
#

Thank you, grabbed that email thread. I will consult my colleagues and get back to you through there.