#ckoiusername_api

1 messages · Page 1 of 1 (latest)

brazen vaporBOT
#

đź‘‹ 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/1266298607808806923

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

stuck vaporBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

split heart
#

Mode production (SK/PK) Production too :

#

Mode Test (SK/PK) Test :

#

My button text is "Configurate" in TEST mode, but in Production, it says "Pay 10€"

teal swallow
#

SetupIntents are in essence saving a payment method for future / recurring payments. Paypal requires you to enable this feature, and this feature also needs to be approved before you can use PayPal for future / recurring payments

split heart
#

Is it okay to pay for a subscription? I thought it was just to set up payment methods.

teal swallow
split heart
#

Can I just use the feature to register a payment method?

teal swallow
#

you need to enable this feature to save (or in your terms, "register" a payment method)

split heart
#

Okay, and will I have the "Configure" button instead of "Pay" like in the "Test" mode?

teal swallow
#

If you're saying that in Production it says Pay - you'll probably want to check / verify if you're using a PaymentIntent (when instead, it sounds like you want to use SetupIntents instead)

brazen vaporBOT
split heart
#

Actually, I am using a SetupIntent:

#
const initializePaymentSheet = async () => {
    const { setupIntent, ephemeralKey, customer } = await fetchPaymentSheetParams();

    const { error } = await initPaymentSheet({
        customerEphemeralKeySecret: ephemeralKey,
        merchantDisplayName: "BOGS",
        setupIntentClientSecret: setupIntent,
        googlePay: {
            currencyCode: "EUR",
            merchantCountryCode: "FR",
            testEnv: true,
        },
        applePay: {
            merchantCountryCode: "FR",
        },
        customerId: customer,
        style: "alwaysDark",
        returnURL: "bogs://paypal-redirect",
    });

    if (!error) {
        console.log("PaymentSheet initialized successfully");
    } else {
        console.error("Error initializing PaymentSheet", error);
    }
};

const fetchPaymentSheetParams = async () => {
    const { data } = await createPaymentMethod();
    const { setupIntent, ephemeralKey, customer } = data;
    return { setupIntent, ephemeralKey, customer };
};
glad totem
#

How the code running on the screenshots differs beteen Test mode and Live mode?
It seems like in one you use a SetupIntent and in the other you use PaymentIntent.
Or are you creating a Subscription object actually?

split heart
#

In both production and test modes, it's the same code, and I am using a SetupIntent for setting up a payment method, for configure payment

glad totem
#

It's not possible that SetupIntent would require you to pay 10 EUR, there must be something else going on.

split heart
#

I send you a screenshot from my phone showing that I did this at 17:03, and the log at 17:03 corresponds to a SetupIntent.

glad totem
glad totem
# split heart

And I see the error banner on your screenshot. Where does it come from? And how are you rendering the Mobile Payment Element then?

split heart
glad totem
#

I am not sure what you mean by this.

split heart
# glad totem And I see the error banner on your screenshot. Where does it come from? And how ...

    const initializePaymentSheet = async () => {
        const { setupIntent, ephemeralKey, customer } =
            await fetchPaymentSheetParams();

        const { error } = await initPaymentSheet({
            customerEphemeralKeySecret: ephemeralKey,
            merchantDisplayName: "BOGS",
            setupIntentClientSecret: setupIntent,
            googlePay: {
                currencyCode: "EUR",
                merchantCountryCode: "FR",
                testEnv: false,
            },
            applePay: {
                merchantCountryCode: "FR",
            },
            customerId: customer,
            style: "alwaysDark",
            returnURL: "bogs://paypal-redirect",
        });

        if (!error) {
            console.log("PaymentSheet initialized successfully");
        } else {
            console.error("Error initializing PaymentSheet", error);
        }
    };

    const fetchPaymentSheetParams = async () => {
        const { data } = await createPaymentMethod();
        const { setupIntent, ephemeralKey, customer } = data;
        return { setupIntent, ephemeralKey, customer };
    };

    const openPaymentSheet = async () => {
        const { error } = await presentPaymentSheet();
        console.log("ici open payment sheet");
        if (error) {
            console.log("error open payment sheet");
        } else {
            showToast(
                "success",
                "Succès",
                "Votre moyen de paiement a été ajouté avec succès"
            );
        }

With open payment sheet

split heart
glad totem
#

That is clear to me. But there's something in your code that creates a PaymentIntent for 10 EUR, when SetupIntent fails to create.

#

Is there more code related to payments in your app?

split heart
glad totem
#

There's 2 separate problems:

  • Why SetupIntent creation fails? Probably due to PayPal being not configured correctly.
  • Why your app shows a Mobile Payment Element with 10 EUR, when SetupIntent creation fails? This is a bigger mystery that I am trying to understand first.
split heart
#

Hm

#

its only with the mode Production

glad totem