How to use the stripe topups api to fund a connected account issuing balance through payments api - stripe-payments

I am currently using the stripe issuing api with connect and have the case that I want to add a funds by pulling from the connect owner's bank account a certain amount of money (they specify in a form).
I am currently following this guide, but to top up the financial account it seems that you can only use it with a source or token created through Plaid not with a payment method (which I collect through the payments element form).
Do you know if a payment method is possible to be used to create topups?

Related

Stripe Connect - share customers without payment method

I am currently hitting a roadblock implementing Stripe Connect into our platform. We want to allow multiple connected accounts to use our platform to sell some sort of tickets. For this we wanted to use Standard accounts with Direct Charges (since we want to take a cut and also not have to deal with refunds/disputes etc.).
On our end the end-user has to either select or create a customer on our platform (created in our Stripe account) and then provide their payment method details through Stripe Elements. The documentation states that you need to create a PaymentIntent for the connected account, but this is not possible while also supplying the previously saved customer (because the customer only exists on our platform).
Now another documentation outlines that it is possible to share customers between connected accounts. The issue with this is that for this step you already seem to need a payment method attached to the customer:
If your platform uses the Payment Methods API, you must create a PaymentMethod from that customer.
The linked documentation outlines how to clone payment methods of customers between linked accounts, but this once again assumes that we already have a confirmed/attached payment method.
So my question is: How can we allow customers to be shared between all connected accounts without having to supply a payment method first? After the first payment (and if the customer chooses to do so) we want to save (and later clone if necessary) this payment method for future payments on all connected accounts.
For normal payments you can create a PaymentIntent with a customer but without a payment method and only supply the latter on the client (in our case stripe.js)
Since you're using Standard accounts, you have to use Direct Charges when accepting payments on behalf of that connected account. This means that the PaymentIntent has to live on the connected account, alongside the Customer and the PaymentMethod if any.
If you want to re-use the payment method details for other accounts in the future though, the PaymentMethod itself and its associated Customer has to live on the platform account.
Unfortunately, there's no way to "clone" a PaymentMethod from the connected account back to the platform today. This means that you have to change your integration logic slightly and approach the overall flow differently.
The idea is that you first need to collect payment method details in the platform. Since you're not taking an immediate payment during that step, you want to use the SetupIntent API. This is the flow documented here that will let you create the SetupIntent on the platform and collect card details securely client-side.
Once you have this information, you will now have a Customer cus_A in the platform, with the PaymentMethod pm_123 attached to it. That is the first step of the flow.
Now, you want to accept a payment on the connected account. So you first need to clone the PaymentMethod on that account as documented here. That will give you a brand new PaymentMethod pm_xyz that lives on that connected account. You can then use that PaymentMethod to confirm a new PaymentIntent on that connected account and passing payment_method: 'pm_xyz' to attempt to charge that saved card.
Note that it is possible this requires a "next action" such as doing 3D Secure as it's on a different account which could come with different restrictions.
In the future, if that customer comes back and wants to pay another connected account, you'd do a new clone of the PaymentMethod on that account and a new PaymentIntent for that cloned card and you can repeat it each time they pay a new business.
It can seem a bit convoluted at first, but once you grasp the flow of all the objects it does make sense overall!

When receiving a `payout.created` Stripe webhook, what is the easiest way to determine which Stripe Connect Custom account it is for?

(Stripe api version: 2020-08-27)
I am working on setting up Stripe to create payouts automatically each week to our Stripe Connect accounts with earnings.
I want my own api to listen for the payout.created Stripe webhook, so I can record and track the event data in my local database. However, I don't see any easy way to tell which Stripe Connect account the newly created payout is for, by looking at the object's properties (API reference).
I was going to try and make the determination by looking at the $payout->destination property, which would give me the bank account the payout was for. I could then retrieve that bank account and see which user it relates to. However, in order to retrieve a bank account, I have to already know the customer id, and I don't have that info. I'm not even dealing with a customer here, I'm dealing with a service provider that has earnings that we need to pay. The bank account is not the same thing as the stripe connect account.
How do I deal with this? Seems weird that it would be so difficult to figure out who the payout is for.

How to Transfer funds to non-connected Stripe account

I am charging a using through stripe.Later i want to transfer winning amount to their stripe account as i already got their stripe_user_id while creating a charge.Now i am using stripe transfer API to transfer amount to their account but i am getting error that you cannot transfer to a non-connected stripe account . Currently i am using the flow of connected account but that is long process in which user fills forms and provide their business details but they are just normal user?How to make the transfers to non-connected stripe account?

Testing with Stripe's test account with real(live) created stripe tokens

I have to use a live database to test stripe payments using customer stripe tokens that are already stored in the database. This are real customer stripe tokens based on real credit cards. But I am using the test account credentials to make payments to. I don't want to make real payments to the stripe account.
My question is can I and how can I use this live tokens to make test payments to my test account.
You cannot use live resources in test mode or vice-versa. The "test" and "live" parts of your Stripe accounts are two different environments that cannot communicate with each other.
You'd need to create customers in test mode, using the testing card numbers that Stripe provides, in order to use them in test payments.

User to user payment on stripe

My requirement is, from my application I want my user to transfer the amount to another user of my application. Assume that both user have stripe account. I have gone through stripe docs, and I understood that in order to do transfer from one user account to another I need to use stripe connect. I could able to do authentication and I'm getting access token successfully for the sender. How can I make a transfer to a recipient ? I have only recipient's email id with me. Should I need to create a recipient through code and do the transfer using that recipient id returns from stripe ?
Im using php. Please help me.
Stripe Connect doesn't work like that. Instead, Connect allows an application to make card charges on behalf of a user and take a portion of the amount. The rest is automatically and immediately put into the user's Stripe account, where it's subject to the normal bank account transfer rules (2-7 day rolling transfers or API-driven manual transfers).
Another way to do this is using Stripe Recipients and Transfers. For example, your application charges a customer $10. You create a Recipient for your user using their bank account information (account number and routing number). Then, you can create a Transfer from your Stripe account to their bank account. Note that this only works for US bank accounts as of today.
If you really want to do user to user transfers, unfortunately Stripe isn't the platform for you. You could use PayPal or you could possibly use Balanced Payments, although again you can only transfer money to and from US bank accounts.

Resources