#bentley-ach-mandate

1 messages ยท Page 1 of 1 (latest)

vivid whaleBOT
hushed arch
#

bentley-ach-mandate

queen cradle
#

Hello

hushed arch
#

Do you have more details like an exact request id req_123?

queen cradle
#

We're working on an integration and created the bank pm using the API. I'm seeing that message when I attempt to create the payment via the Stripe dashboard.

#

{ "id": "mandate_1LuJ4lAIEGRSPHp6NfltP1WK", "object": "mandate", "customer_acceptance": { "accepted_at": 1666112135, "online": { "ip_address": "108.213.203.44", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36" }, "type": "online" }, "livemode": false, "multi_use": {}, "payment_method": "pm_1LuJ4kAIEGRSPHp62eh52L1h", "payment_method_details": { "type": "us_bank_account", "us_bank_account": {} }, "status": "active", "type": "multi_use" }

#

That's the mandate that got created for the bank PM

#

lemme see if I can pull more info from the webhook events

hushed arch
#

You have an error, that error should return detailed information including request_log_url

queen cradle
#

Looks like "invalid request", but I didn't build the request.

rough compass
#

Hi there ๐Ÿ‘‹ taking over for @hushed arch

Give me a couple minutes to get caught up.

queen cradle
#

Sorry, here's the request id. req_jdsymvCy9zOY9p

#

Oh, I should add that if I create the bank account PM through the dashboard it will create the mandate as offline and i'm able to make payments with it.

rough compass
queen cradle
#

We're not processing a payment. We're only confirming a SetupIntent at this point. I then went into the dashboard to make sure that I could use the payment method after I verified it. That's when I get that error.

rough compass
#

It's the same issue, just in a different place. You still need to collect the mandate as though you were creating a payment

queen cradle
rough compass
#

Which part is confusing?

queen cradle
#

I guess it's confusing because we're already doing step 5. It created the mandate I posted above.

#

Although, the code looks a bit different. I'm guessing because we're using our own UI to gather the bank account info.

#

That code results in a SetupIntent with a status of requires_action which is the micro-deposit verification. I've done that step as well as if I'm the owner of the bank account using the verification url or dashboard.

rough compass
#

Or the Payment Intent, depending on which is giving you the error

queen cradle
#

The SetupIntent is initially created server-side and the client_secret is sent up to the client-side. Client-side code is what I posted above. I'm not creating the PaymentIntent. I'm using the dashboard to create a payment.

#

This is the payment method that gets created. The associated mandate indicates that the customer accepted the mandate.

#

Everything seems fine, so I'm not sure what more we can do. ๐Ÿ˜ฉ

rough compass
#

Ahhh, okay. I don't think that's possible. The Setup Intent's client-secret needs to be passed into the Payment Intent during creation in order to indicate that the Payment Intent has been authenticated already and should be charged off-session. You can only do that via the API.

queen cradle
#

So I have to persist the client secret? The docs explicitly say not to do that.

#

I see a mandate field on the PaymentIntent. Do I set that using the id of the mandate associated with my saved bank payment method?

rough compass
queen cradle
#

We're using the secret then.

#

const createSetupIntent = async () => { const variables = { communityId: lease.community.id }; const response = await createSetupIntentMutation({ variables }); setClientSecret(response.data.createSetupIntent.setupIntent.clientSecret); };

rough compass
queen cradle
#

The problem with that is that we're only saving payment method. The payment intent will happen way later and is not part of this use case.

#

Okay, I got it to work. In PostMan I'm able to call {{baseUrl}}/v1/payment_intents and use the mandate associated with my saved bank account payment method. Just have to set confirm to true.

rough compass
#

That makes sense. The error seemed to indicate that would work, so I'm glad that's the case

queen cradle
#

Yup, thank you for help and patience! Is there anyone I can contact to let them know how grateful I am?

rough compass
#

I appreciate the feedback! I can surface it via this thread, if you like (positive and critical feedback alike)