richnologies / ngx-stripe

Angular 6+ wrapper for StripeJS
MIT License
221 stars 75 forks source link

[BUG] Unable to display name, phone & email is payment form using the billingDetails in defaultValues #243

Closed ahmadallw closed 7 months ago

ahmadallw commented 9 months ago

Describe the bug We are trying to display name, phone & email is the payment form (pre filled data) - where the options object is set to

options: any = {
        defaultValues: {
            billingDetails: {
                name: 'Name',
                email: 'name@name.com',
                phone: '000000000',
                address: {
                    country: 'DE',
                },
            },
        },
        fields: {
            billingDetails: {
                address: {
                    country: 'auto',
                },
                name: 'auto',
                email: 'auto',
                phone: 'auto',
            },
        },
    }

the available options for billingDetails in fields object are 'auto' | 'never' when setting fields to auto fields still not showing in the payment form

When setting fields to auto they should show on the payment form or maybe it should add new option as 'always'

image

we are using the following version for "ngx-stripe": "^17.0.1", "@stripe/stripe-js": "^3.0.0",

check the following docs https://stripe.com/docs/payments/link/add-link-elements-integration?link-integration-type=before-payment&client=html#web-collect-payment-details

richnologies commented 9 months ago

Hey @ahmadallw, after checking this, I believe the problem is in the payment method. This is what the docs says:

Specify customer's billing details, which lets you pre-fill a customer’s name, email, phone number and address if required by payment method. Pre-filling as much information as possible streamlines the checkout process.

Notice how it says, if required by payment method. I assume that is not the case for card payment. Feel free to raise this with Stripe support. If it works with StripeJS should with ngx-stripe