#jogui_best-practices

1 messages ¡ Page 1 of 1 (latest)

lament minnowBOT
#

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

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

arctic kiln
#

Thank you for all your assistence, two years ago we implemented in our website stripe and has been working wonderfully

#

To give more information, we have a fully working single currency checkout page that only allows to purchase in euros from the eurozone (countries that uses euro) and we want now to expand the checkout page worldwide to all possible types of currencies.

copper sluiceBOT
arctic kiln
#

Ive found that after the frontend:

actionResult = stripe.confirmCardPayment(response.json.cs, {
                        payment_method: {
                            card: cardElement,
                            billing_details: {
                                name: nameInput.value,
                            },
                        },
                    });

and before the backend:

SubscriptionCreateParams.Builder subCreateParams =
        createCommonParamsSubscription(priceId, customer, metadata, taxId, addAutomaticTax);
    subCreateParams.setPaymentBehavior(SubscriptionCreateParams.PaymentBehavior.DEFAULT_INCOMPLETE);

    return Subscription.create(subCreateParams.build());

I should be able to check the intent credit card country, but this requires the user to submit the paywall. In this case, i would be able to before subscription.create() to throw and exception and the frontend manage it changing the currency

strange crow
#

Hi @arctic kiln apologies for the delay, the server is quite busy at the moment. If you want to get a Payment Method that you can inspect before processing an intent, you'll want to follow this guide:
https://docs.stripe.com/payments/build-a-two-step-confirmation

With that approach, you should be able to inspect payment_method_preview.card.country on the Confirmation Token that is created:
https://docs.stripe.com/api/confirmation_tokens/object#confirmation_token_object-payment_method_preview-card-country

Add an optional review page or run validations after a user enters their payment details.

arctic kiln
#

Thank you, i will investigate this and answer appropietly in the next hours. You are the best @strange crow !