#lcottingham_code

1 messages ¡ Page 1 of 1 (latest)

steep pawnBOT
#

👋 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/1329115795409731668

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

deft sky
#

The IP address of the customer viewing the webpage is considered

#

So if you are in GB, then that could explain it

#

Also country isn't a param that you can pass to elements afaik

#

Currency is

ebon beacon
#

Correct - but you can pass default values to a payment element.
I'm working in angular rn, so using ngx-angular as the conduit between angular and stripe.js

protected readonly elementsOptions = computed<StripeElementsOptions>(() => ({
        mode: "payment",
        amount: this.amount(),
        currency: this.currency().toLowerCase(),
        appearance: {
            //...
        },
        loader: "auto",
    }))
protected readonly paymentElementOptions = computed<StripePaymentElementOptions>(() => ({
        defaultValues: {
            billingDetails: {
                email: this.email(),
                address: {
                    country: this.countryISO().toUpperCase(),
                },
            },
        },
        layout: {
            type: "accordion",
            radios: false,
            defaultCollapsed: false,
            spacedAccordionItems: true,
        },
        // ... other general options
    }))
#

If it's using IP to determine country and assuming that is the billing country, it's problematic given this could differ from the payment billing details

#

Which may mean I can't use a deferred workflow for this, and require the PI's client secret to help me decide on the payment methods

#

Or, I guess I could just throw some client-side logic into it for basic validation?

deft sky
#

IP doesn't select billing address/country

#

How payment methods are shown/available is complicated and depends on the individual payment method types. But IP address/physical location is the biggest determining factor