#bazylh-invalid-request

1 messages · Page 1 of 1 (latest)

hearty coral
#

Hi there! Can you share the request ID that you redacted?

#

It isn't sensitive

#

Then I can look at exactly what is happening

#

However, that error isn't related to automatic_payment_methods at all

#

It is simply saying you are confirming a PaymentIntent without there being a PaymentMethod associated

#

Are you confirming server-side?

cedar mirage
#

req_rh3zej6FbIx1NA

hearty coral
#

Yep so you see how you have confirm=true

#

That means you are trying to create a charge, but there is no PaymentMethod

cedar mirage
#
def create_stripe_intent(stripe_account_id, customer_id, metadata):
amount.
    return stripe.setupIntent(
        customer=customer_id,
        metadata=metadata,
        on_behalf_of=stripe_account_id,
    )```
hearty coral
#

Let's step back.

#

What are you trying to do exactly?

#

Are you following a guide?

cedar mirage
#

So we need to get the users card info so that if they run off with a rental we can charge their card. Before we were using the hold system, but realized their are too many cases where the price goes over the initially held amount. So we decided to use future payment intents scheme instead. We want to save a generated customer id to store card info, require they go through checkout on a setup intent, and then charge them the final calculated amount from our backend directly post transaction

hearty coral
#

Okay and where in that flow are you running into issues above?

cedar mirage
hearty coral
#

Like is that when you have the Customer and PaymentMethod and are trying to charge them?

cedar mirage
#

We are getting this error when we end the transaction with our apis

#

is this because no one has gone through checkout in the mobile app on them yet?

#

Is that the piece that assigns payment_methods?

hearty coral
#

The initial collection of the PaymentMethod using the SetupIntent is what creates the PaymentMethod itself.

#

Then, you pass that PaymentMethod ID to the PaymentIntent when attempting to actually charge the PaymentMethod

#

So yeah it sounds like you haven't actually collected a PaymentMethod yet

cedar mirage
#

PaymentMethod can be collected directly through the Stripe mobile SDK?

hearty coral
#

Yep

#

You shared the guide above that walks through how to do that

#

When you say "directly through", you do still need a backend but you would collect the PaymentMethod itself on the frontend using the SDK

cedar mirage
#

Got it. Yes but after the got through PaymentSheet on the mobile app we will then have the payment mehtod we need for the backend