#venkateshjsoft
1 messages ยท Page 1 of 1 (latest)
Yeah it means you need to provide a return_url parameter, since a sofort Payment Method needs one
but this is recurring payment
where user involment is not needed here
first time user is authenticated then for the recurring payments we will be taking money without user to provide authorisation again
I tried the same step with ideal payment it was working fine
im following as per this link
That outlined how to use Sofort for the first Payment, and then obtain the generated_sepa_debit , a different Payment Method Id, to use later on when your customer is off session
{
"customer_id" : "cus_OPvwjG7CylH03Z",
"paymentMethod_id" : "pm_sofort_generatedSepaDebitIntentsSucceedNetherlands",
"paymentMethod_type" : 5,
"amount" : 3500
}
I used this sofort payment test data available
Step 1: Initiated paymet with sofort
Step 2: Confirmed the payment with return URL from the frontend.
Step 3: Initiated recurring payment with the generated_sepa_debit (test data available on Stripe website)
please confirm if the steps im following is correct
Yes correct
im getting error in the step 3
it ask me to provide return url again
for the recurring payments, we dont provide return url as there is no user is involed in this step
I can try
i get response "required_Action"
looks like its expecting user to authenticate again
req_WqxrX0IPcqHigc
i dont want our customers to authenticate again and again for recurring payments
can you check and confirm if im doing something wrong in the flow
In step 2 when you confirmed the Payment on frontend, what PaymentIntent object did it give you?
const {error} = stripe.confirmSofortPayment(
clientSecret.value,
{
payment_method: {
sofort: {
country: "NL"
},
billing_details: {
name: accountholderName.value,
email: accountholderEmail.value,
},
},
return_url: 'https://example.com/checkout/complete',
}
Yes, which PaymentIntent Id you got?
And after you do PaymentIntent Retrieve here https://stripe.com/docs/payments/sofort/save-during-payment?platform=web#charge-sepa-pm, what exactly the response looks like?
pi_3Nd6KtDEdWHgNJda0NaxOidS
And this please
Can you paste the payment_method_details block as the Doc mentioned?
I believe it should have
payment_method_details: {
sofort: {
bank_code: "DEUT",
bank_name: "Deutsche Bank",
bic: "DEUTDE2H",
country: "NL",
generated_sepa_debit: "pm_1Nd6QbDEdWHgNJdaO95tBwSp",
generated_sepa_debit_mandate: "mandate_1Nd6QbDEdWHgNJdakHGNyJFO",
iban_last4: "3000",
preferred_language: null,
verified_name: "Jenny Rosen"
},
my response doesnt have this object
I can see that object in your screenshot though, at the bottom.
but the object you have shared exists under charges
ah yeah
then retrieve the charge ๐
the PaymentIntent has a latest_charge field, that's the ID of the charge. You can use expand:["latest_charge"] too
but i dont understand why I need to use latest charge field, what im trying to do is making new payment for the same customer
I charged the customer initially and I want to charge them again for the recurring payment using sofort
is the recurring payment happening off-session(initiated from your server automatically like on a monthly cron job)?
yes thats our plan but not cron job, our internal job which initiate recurring payment
is it clear?
yep
so that payment can not happen through SOFORT
SOFORT is only for on-session payments.
so instead, you make the recurring payment as a SEPA Debit payment, where you are charging the SEPA IBAN that the customer used through SOFORT on the first payment. That's why you need to access the Charge to get that generated paymentmethod that has the IBAN. It's all described clearly in the docs.
let me check