#ckoiusername_api
1 messages · Page 1 of 1 (latest)
đź‘‹ 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.
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.
- ckoiusername_code, 2 days ago, 8 messages
- ckoiusername_api, 3 days ago, 19 messages
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€"
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
Is it okay to pay for a subscription? I thought it was just to set up payment methods.
https://docs.stripe.com/payments/paypal/set-up-future-payments - I believe you haven't enabled that in production yet
Can I just use the feature to register a payment method?
you need to enable this feature to save (or in your terms, "register" a payment method)
Okay, and will I have the "Configure" button instead of "Pay" like in the "Test" mode?
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)
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 };
};
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?
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
It's not possible that SetupIntent would require you to pay 10 EUR, there must be something else going on.
I am indeed using a SetupIntent
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.
I see an error here, so a SetupIntent wasn't created.
And I see the error banner on your screenshot. Where does it come from? And how are you rendering the Mobile Payment Element then?
Ok for my usage i think i need to disable the recurring payment
I am not sure what you mean by this.
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
Actually, I just want to set up payment methods so that I can save the client's credit card or PayPal information, but I don't want them to have to pay.
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?
"You can either remove setup_future_usage or enable recurring payments for PayPal using these instructions: https://stripe.com/docs/payments/paypal/set-up-future-payments."
But why does it tell me to enable recurring payments with PayPal? As you understand, I just want to set this up to configure the payments.
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.
For the PayPal problem, do you actually want to use PayPal? If so, you should contact Stripe Support and ask them to enable it for you: https://support.stripe.com/?contact=true
It is enabled for one-time payments, but to make future/recurring payments in Live mode, you will need to ask Stripe Support for permission: https://support.stripe.com/?contact=true