#Nick

1 messages · Page 1 of 1 (latest)

potent kayakBOT
timber breach
#

Main reason I'm asking is the onboard flow in the dashboard is asking for a lot of information like company logo, support email, privacy policy, ensuring some compliance like SOC2, etc

night pier
#

I'm not sure I understand. The only difference between test and production is which API keys you use to make the API calls.

timber breach
#

So basically going through the confirm flow here:

#

Will result in it being enabled for both production and test?

#

Or is it environment specific like the api keys

night pier
#

That will turn it on for both

timber breach
#

Yeah ok I went through the flow and it configured for both but I seem to be able to disable/enable it per environment by flipping between test and prod

#

Happy to ask here but the question isn't related to this thread

In our test environment customers I'm creating a customer, and a default source of US Bank account is being added. Based on the logs, the customer.source.created event is being fired with source Automatic? How do I prevent this? evt_1N8oYvI67GP2qpb43nayAUMg

night pier
#

I don't see automatic in the payload for that request. Where are you seeing it and what are you hoping to achieve by disallowing it/

timber breach
#

I'm trying to create the subscription with a deferred payment via the send invoice. Then I send the customer a custom invoice with a link to pay, and I'd like to capture an ACH payment at that time.

But because this bank account is being added I get an error trying to fire off the collectBankAccountForPayment call because that bank account isn't compatible

barren trellis
#

👋 Hey Nick! I'm taking over to try and help but I'm a little bit lost overall with what you are doing, which doc(s) you are following, etc. It's extremely rare for new integrations to ever see customer.source.created as an Event as it was mostly deprecated years ago. It's not impossible if you have some really old code but I would like to get some high level information about what you are really trying to do here

#

That specific event seems also totally unrelated, it's about an ACH Credit Transfer Source object which is used when you create an Invoice and want your customer to wire you money directly from their bank account @timber breach

timber breach
#

Here's what's happening:
I'm creating a customer event
Subscribing them to a plan with collection_method send_invoice and days_until_due 30
This action generates an invoice - I use that invoice and send a link to our users that brings them to our portal where we can capture their credit card via setup intents (configuring off session payments), and then pay that invoice with the API for paying an invoice: https://stripe.com/docs/api/invoices/pay

Somehow in doing that, the customer.source.created event is adding a US Bank account to the customer. I don't have any code that's doing it, so I'm just trying to track down how that's happening

#

Just to clarify when I say source is automatic I'm referring to the dashboard telling me that the source of the event was automatic. ie, the Source of the customer.source.created event is automatic

barren trellis
#

yeah okay you are mixing things up a lot here

#

When you create a Subscription with collection_method: 'send_invoice', the whole point of this is to email an Invoice to your customer to pay later. Usually this is for businesses who want to pay via wire transfers later. That's why we (Stripe) create what we call an ACH Credit Transfer Source. This has a virtual bank account number that the end customer can wire money into for us to reconcile with their own invoice

#

You're talking about paying this with a card, which usually means you should not be using send_invoice at all here. Same for using ACH Debit where you (the merchant) collect your customer's bank account details to debit them automatically monthly

#

so with what I explained: what are you really trying to do?

potent kayakBOT
timber breach
#

I'm trying to email an invoice to the customer for them to pay later.

We have a sales team that can create subscriptions for customers that go through the "white glove" sales experience. Those customers don't have any existing account in Stripe, so there isn't a payment method. When the sales person creates the subscription they enter in the plan, quantity, etc and the email of the customer.

We create a customer for them, and then the subscription with the send_invoice paramteer, pass them an email with a link to a page in our portal that summarizes the invoice that was generated for their subscription, and allows them to enter a credit card, which pays the invoice.

Once Stripe sends the invoice.payment_succeeded event for that invoice to our systems, we email a license to the customer.

All of that already works

What I'm now trying to do is in addition to accepting a credit card on our "payment page" I want to also allow the customers to pay via ACH/Wire. I am retrieving the payment intent client secret from the payment intent, via expanding the subscription's latest_invoice.payment_intent, and returning it to the front-end. I'm then calling the stripe lib

        const object = {
            clientSecret: subscription?.last_invoice?.payment_intent_client_secret || '',
            params: {
                payment_method_type: 'us_bank_account',
                payment_method_data: {
                    billing_details: {
                        name: `${customer?.contact_first_name} ${customer?.contact_last_name}`,
                        email: `${customer?.email}`,
                    },
                },
            },
        };
        stripe?.collectBankAccountForPayment(object)
    }

Based on the documentation here: https://stripe.com/docs/payments/ach-debit/accept-a-payment?platform=web&ui=API#web-collect-details

That's causing a 400, with error

#
The PaymentMethod provided (us_bank_account) is not allowed for this PaymentIntent. Please attach a PaymentMethod of one of the following types: ach_credit_transfer, card, cashapp, link, wechat_pay. Alternatively, update the allowed payment_method_types for this PaymentIntent to include "us_bank_account

As far as I can tell, it's just automatically trying to use that existing automatically added payment method, instead of capturing new account details

timber breach
#

Even when following the guidance that it says there and switching to ach_credit_transfer I get a different error

Invalid payment_method_data[type]: must be one of acss_debit, affirm, afterpay_clearpay, alipay, au_becs_debit, bacs_debit, bancontact, blik, boleto, card, cashapp, customer_balance, eps, fpx, giropay, grabpay, ideal, klarna, konbini, link, oxxo, p24, paynow, paypal, pix, promptpay, sepa_debit, sofort, us_bank_account, or wechat_pay", param: "payment_method_data[type]

Which seems to contradict the first error as it mentions us_bank_account

wraith walrus
#

Sorry for the delay just reading the history here ⏳

timber breach
#

All good!

#

I think as koopajah mentioned stuff around the customer.source.created is a red herring. I think the real problem I'm running into is just either setup in Stripe or how I'm calling the collectBankAccountForPayment function (or both)

wraith walrus
#

Yes, ok

#

As koopajah explain that source creation is related to the fact that you enabled ach_credit_transfer for your invoice payment methods. This is the customer-initiated (push) payment to the virtual account that was described.

#

For now if you want the customer to push funds, that ACH Credit Transfer source is needed. If you don't need the customer to push, you only need the us bank account payment method.

#

so you're trying to confirm using a payment method type that the invoice is not configured to expect

#

If you intent to pay invoice with ACH Debits like that, you need to enable that in the template, or explicitly specify it as a payment method type when creating the invoice

#

The "dashboard" tab in the docs above also walk through this template setting:
https://stripe.com/docs/invoicing/ach-debit?dashboard-or-api=dashboard

To set ACH Direct Debit as a default payment method type, use the Invoice template. Click Manage under Payment methods, then use the toggle to enable ACH Direct Debit. After your customer creates an invoice, they receive a prompt to enter their bank information through the Hosted Invoice Page.

Note
All default payment methods are available on the Hosted Invoice Page for invoices that don’t have a specified payment method.

When you create a one-off invoice through the Dashboard, you can specify ACH Direct Debit under Payment options. To learn more about creating and sending invoices through the Dashboard, see Create an invoice.

timber breach
#

Yeah ok been digging a little in parallel and I think the PaymentSettings object to enable us_bank_account was what I needed to pass - I can open it now

#

At least, I can see the Stripe UI for connecting the bank account and such, and see the linked account as a payment method on that specific payment intent

#

Ok, I think I can take it from here. Thanks for your help and patience

wraith walrus
#

NP - likewise!

#

Thanks for clarifying and bearing with us while we walked through it

potent kayakBOT