#Malte

1 messages ยท Page 1 of 1 (latest)

clear otterBOT
orchid hollow
#

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

fickle venture
#

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.

orchid hollow
#

Can you copy/paste the Subscription ID then and I can try to dig on my own?

fickle venture
#

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.

orchid hollow
#

Is this a new problem? In other words, did it break suddenly after subsequent payments were working?

fickle venture
#

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"?

orchid hollow
#

Hmmm, I don't think that's it, but set it to default and retry the payment to see if it works

fickle venture
#

Now it's greyed out when I manually set it as default.

orchid hollow
#

Yup. Now go to the Invoice and click "Retry charge"

fickle venture
#

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?

orchid hollow
fickle venture
#

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 ๐Ÿ˜„

orchid hollow
#

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

fickle venture
#

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
orchid hollow
#

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)

fickle venture
#

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! ๐Ÿ˜„

orchid hollow
#

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