#Malte
1 messages ยท Page 1 of 1 (latest)
Do you have a request ID for the payment that failed in that second screenshot?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Thank you for your quick reply @orchid hollow I suppose that I do not have a request ID for the failed payment, since this is a recurring payment from Stripe and should be automatically debited from the customer. However, I can send you the API request of the "Subscription creation", which we do from our backend.
Ah sorry, those were the logs from the test mode of course. Here are the ones from production. However, those are not related to the recurring payment.
Can you copy/paste the Subscription ID then and I can try to dig on my own?
Sure
sub_1MM5o3DbcvJPRjnSH6tp4Xf3
The problem basically applies to all customers: The first payment worked without any problems, after we send the subscription to Stripe, but from the second payment onwards, the recurring payment, this is not debited by Stripe.
Is this a new problem? In other words, did it break suddenly after subsequent payments were working?
We basically tested the API in the test mode and afterwards rolled out our product on something like 3rd January 2023. The first payments all went fine as expected, when the subscription from our backend is created and sent to Stripe. However, from the second payment onwards, which shall be debited automatically, all payments failed.
But I possibly found something! I just noticed that the "intial payment method" is not set to default by default? ๐
So maybe this could be the issue here?
Or is it set as default and the option appears "always"?
Hmmm, I don't think that's it, but set it to default and retry the payment to see if it works
Now it's greyed out when I manually set it as default.
Yup. Now go to the Invoice and click "Retry charge"
Cool, seems to be working when manually setting the payment method to default! ๐ But is this an expected behaviour by Stripe? When creating the subscription, do I have to indicate somehow that the passed on payment method should be the default?
I thought it did that on its own in most cases, but this might be an edge-case that's specific to how you're integrated. You can specify the default PM via this method here: https://stripe.com/docs/api/subscriptions/update#update_subscription-default_payment_method
Ah! @fickle venture here: https://stripe.com/docs/billing/subscriptions/sepa-debit?platform=web#set-default-payment-method
I forgot for SEPA you have to explicitly set the default at the Customer level
I have to take a look on our implementation to be honest, since I did it some time ago. But we use React.js in the Frontend and Express in the backend.
PaymentElement,
useStripe,
useElements
} from "@stripe/react-stripe-js";```
We have Visa and SEPA customers currently. But the behaviour is identical: Neither Visa nor SEPA are "default" by default ๐
The API call to set the default payment method on the Customer is a server-side API call, so you would likely be using fetch() somewhere to make that call in step 5
Ahhh
email: decrypt(user.mail),
name: decrypt(user.firstname) + " " + decrypt(user.lastname),
phone: decrypt(user.phone),
address: {
line1: decrypt(user.street),
postal_code: decrypt(user.postal),
city: decrypt(user.city),
country: decrypt(user.country)
},
metadata: {
kosmeda_id: req.user.id
}
});```
Do you know happen to now where I can get the payment method "pm_"? If not, it's no problem, you've already helped me a lot.
This will be delivered from the frontend then I think
- happen to know
Yeah, so if you have already created the Payment Method at the time of this call โ๏ธ then only you know where it is. It's likely not associated with any other objects and might be cached on the front-end (since step 4 is to accept the payment method details and step 5 is to update the customer with them)
The payment is handled on the frontend with the "PaymentElement" as far as I recall and then sent to the backend with "all information". I have to investigate this on my own I think. If everything goes wrong and I do not find any solution, can I post again in this thread here possibly?
But anyway thank you very much for the help so far. This is really the best (developer) support here at Stripe that I have ever experienced! ๐
Thanks for the positive feedback! We're pretty proud of what we do here (most of the time).
But yeah, post in the main channel, as we archive threads after a while