#cecily_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/1308457951551426653
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
The Payment Element has automatic mandate text built in for SEPA, which you can see in the docs example by switch the customer location to Germany: https://docs.stripe.com/payments/payment-element
You need to ensure that you enable SEPA for the Billing payment methods and then initialize elements with mode=subscription to collect payment details for starting subscriptions.
Are there any toher adjustments I need to make to enable SEPA payments?
For example, do I need to enable the payment type or anything, or is this all taken care of by Stripe?
You need to enable the payment method in your Dashboard billing payment method settings and ensure you're using dynamica payment methods. Can you share with me how you initialize the Payment Element?
So we're using paymentIntents in the backend
We're using stripe.js to initialise the paymentElements on the frontend
Can you share the code you use to do that?
So we're using paymentIntents in the backend
Can you say more about this? You also said above:
My payment flow is based on subscriptions
Are you doing your own recurring payments instead of using Stripe Subscriptions?
This is where we initialise the payment elements:
import React, { FC } from 'react';
import { PaymentElement } from '@stripe/react-stripe-js';
import { StripePaymentElementChangeEvent } from '@stripe/stripe-js';
import { CardDetailsWrapper } from './PaymentElementsForm.styles';
interface Props {
setPaymentElementEvent?: (event: StripePaymentElementChangeEvent) => void;
}
const PaymentElements: FC<Props> = ({ setPaymentElementEvent }) => {
const handleOnChange = (event: StripePaymentElementChangeEvent) => {
if (setPaymentElementEvent) {
setPaymentElementEvent(event);
}
};
return (
<CardDetailsWrapper>
<PaymentElement onChange={(event) => handleOnChange(event)} />
</CardDetailsWrapper>
);
};
export default PaymentElements;
We are using Stripe subscriptions
And can you also show your <Elements /> provider + options?
This is where my elements is initialised:
const ElementsStripeWrapper: React.FC<Props> = ({ children, options = {} }) => {
const { appData } = useContext(AppContext);
const [stripePromise] = useState(() =>
loadStripe(appData.stripeKey, { locale: getLang() as StripeElementLocale }),
);
return stripePromise ? (
<Elements
stripe={stripePromise}
options={{
...options,
fonts: [
{
src: "url('https://fonts.googleapis.com/css?family=Roboto:400,500&display=swap')",
family: 'Roboto Regular',
weight: '400',
},
],
loader: 'always',
}}
>
{children}
</Elements>
) : null;
};
export default ElementsStripeWrapper;
And what are the options you pass in for this subscription flow?
Are you using mode=subscription?
Yes
And what about payment methods, how are you determining those?
These are turned on my stripe dashboard
Ok, but can you show the full options you use so i can confirm the flow here?
But assuming you use dynamic payment methods and mode=subscription, then you'll need to ensure Sepa is enabled in your Billing payment method configuration.
If you share an example subscription you created recently, we can look more closely
I think I understand, I was under the impression that we would need to integrate some sort of mandate mechanism so thank you for clarifying that we don't
I have another question with regards to a disputed payment. How would that be handled? Would this be handled by the payment_failed webhook, and managed on our dashboard? Or is there another event which is triggered in this case?
Hello! I'm taking over and catching up...
We have documentation here that explains how SEPA disputes work: https://docs.stripe.com/payments/sepa-debit#disputed-payments
Could you also tell me a little bit about testing SEPA functionality?
Is there a test mandate which we can use? And would we want to use the stripe A/B testing tool?
We have information about testing here: https://docs.stripe.com/payments/sepa-debit/accept-a-payment?web-or-mobile=web&payments-ui-type=elements#web-test-integration
I'm not sure what you mean by a "test mandate", can you provide more details?
If i were to simulate the behaviours of making a SEPA payment, am I able to simulate a test mandate to accept? In order to test that the payment intent status changes to processing?
Yes. I recommend you go through this guide and build a test integration so you can see how it works in practice: https://docs.stripe.com/payments/sepa-debit/accept-a-payment?web-or-mobile=web&payments-ui-type=elements