#KoRnoliX

1 messages ยท Page 1 of 1 (latest)

karmic questBOT
slim grove
#

Hello ๐Ÿ‘‹
What Stripe SDK are you using?

sand tapir
#

Hello!
Im using JavaScript Stripe SDK, versioned
"stripe": "^11.15.0",

slim grove
#

Are you using Stripe Checkout?

sand tapir
#

yes

#

I can provide you sample of my code that is used to create payment links

slim grove
#

Sure

The idea behind payment links is that anyone accessing it can pay for it.
If you only need to collect billing_address for some users then you'd need to create separate payment links for them

sand tapir
#

well, im currently creating different payment link for each user (because of metadata under the hood). however, exactly during checkout, i want user to be able to type billing address informations, but i dont want to make it required.

#
            const paymentLink = await this.stripeClient.paymentLinks.create({
                line_items: [{ price: XXX], quantity: 1 }],
                metadata,
                payment_method_types: ['blik', 'card'],
                automatic_tax: { enabled: true },
                allow_promotion_codes: true,
                currency: 'pln',
                billing_address_collection: 'auto',
                tax_id_collection: {
                    enabled: true,
                },
                invoice_creation: {
                    enabled: true,
                },
                customer_creation: 'always',
                after_completion: {
                    redirect: {
                        url: 'XXXX',
                    },
                    type: 'redirect',
                },
            });

there is a line

            `billing_address_collection: 'auto',`

which i can set to "required", and then billing info shows up, buts unfortunately its required. if the mode is "auto", actually i dont see any address fields (according to Stripe docs, you want to provide as simple checkouts as possible, however i want a little bit more)

slim grove
sand tapir
#

Hmm, okay, thanks for the information and help!