#parisholley - create source

1 messages ยท Page 1 of 1 (latest)

normal granite
#

Why are you calling createSource with the Payment Element? If you use the integration guide, a payment method will be created for you

noble laurel
#

We may have spoke before ๐Ÿ™‚ Trying to work around use case where I have to have two customers and I want to collect bank info once

#

If I can generate two sources/tokens/payment methods using the same PaymentsElement, would be more intuitive to user than going through connection flow twice

#

collectFinancialConnectionsAccounts: A session must be tied to a customer, so I cannot save bank info across two accounts without user connecting twice

#

collectBankAccountForSetup: Automatically creates a payment method, which cannot be attached to more than one customer

#

recap: I need to have two customers, one for prepaid charges and another for saas (i don't want prepaid credits to cover saas fee, hence the two accounts)

#

event id (elements.create_source_with_element) from browser = 7df4732b-10bf-4963-b8c4-a6e4a00fa38e

#

event id (elements.fatal.uncaught_error) = 26b5c44a-ec2b-4c26-a8cd-04d6527bb41b

normal granite
#

Ah ok yeah I remember this convo

#

To be honest I'm not sure off the top of my head. Do you have a request ID I can take a look at?

noble laurel
#

where would i find request id?

normal granite
noble laurel
#

no entry in log, this seems like a stripe.js error

#

if it helps, i'm debugging through the stripe.js code, it appears to be an error with communication with the iframe

#
{
    "message": {
        "action": "stripe-controller-action-request",
        "payload": {
            "nonce": "createSourceWithElement25026",
            "actionName": "createSourceWithElement",
            "request": {
                "frameId": "__privateStripeFrame2507",
                "elementName": "payment",
                "type": "ach_debit",
                "sourceData": {},
                "mids": {
                    "guid": "bade3523-e547-4ac8-9fe4-91f91aa455394c66e4",
                    "muid": "229e99da-30f9-49c7-b4fb-655c15a2c960df3fa6",
                    "sid": "af54c02e-75b4-4b75-9112-50da490a7a06318637"
                }
            }
        }
    },
    "type": "outer",
    "frameId": "__privateStripeController2501",
    "controllerId": "__privateStripeController2501"
}
#

here is the reply from post message

#
{
    "message": {
        "action": "stripe-controller-action-error",
        "payload": {
            "nonce": "createSourceWithElement25026",
            "actionName": "createSourceWithElement",
            "error": {}
        }
    },
    "type": "inner",
    "frameId": "__privateStripeController2501",
    "controllerId": "__privateStripeController2501",
    "__stripeJsV3": true
}
crude surge
#

Can you send your Stripe.js code here for when you try to create a source like this?

#

As far as I know, the payment element can only be used to confirm payment intents and setup intents

noble laurel
#
const element = elements.getElement(PaymentElement);

await stripe.createSource(element, { type: 'ach_debit' });
#

(react)

crude surge
#

Thanks, still checking in to if this is possible. Are you following a specific doc from us on this that says that PaymentElement can create sources?

crude surge
#

Ah okay, that doc doesn't specify it but that call does not support the payment element

#

If you want the same bank account on two different accounts, you can create it with a setup intent and then copy it down to both of them

#

Or are you talking about making this the account that payouts go to on both accounts?

noble laurel
#

no, i need two "Customers" in same stripe account to use the same bank account

crude surge
#

As a payment method?

noble laurel
#

yes

crude surge
#

Checking if copying like that is possible...

crude surge
#

Are you using Connect here? It is looking like this is currently not possible across Customers on the same account, but something like this might be possible on connect though I am still checking that out

noble laurel
#

no not using connect, i've seen that it is supported via connect though

#

but i'd assume that means connecting ourselves :p

#

think only solution is to use a service like Plaid which can generate bank tokens

crude surge
noble laurel
#

right, but Plaid can generate multiple tokens for same account

crude surge
#

Taking a step back, can you talk about the need to separate the prepaid and saas fees here?

noble laurel
#

invoice credits apply to saas charge when on the same customer account

#

if someone pays 1K/m in subscription, and deposits 10K in ad credits, and then spends 8K the first month, i don't want to use the 2K in their balance to pay for subscription

#

stripe doesn't allow me to control when credit balance is applied

bronze idol
#

๐Ÿ‘‹ stepping in here as Pompey had to step away

#

Can you summarize how I can help here?

noble laurel
#

don't think you can