#alx8523
1 messages · Page 1 of 1 (latest)
Hi, what questions do you have?
Yes, so I am setting up a job platform. Poster advertises a job, worker creates an offer. Poster pays the Platform. Then when job is done Platform pays the worker.
To pay the platform, this is executed
payment_intent = stripe.PaymentIntent.create(
amount=int(Decimal(str(offer.price)) * Decimal("1.1") * Decimal("100")),
currency="ron",
transfer_group="Task" + str(offer.job.id),
customer=user.userprofile.stripe_customer_id,
payment_method=user.userprofile.stripe_payment_method_id,
description="Plată pentru task " + str(offer.job.id),
confirm=True,
)
To pay the worker, this is executed
release_payment_to_tasker = stripe.Transfer.create(
amount=int(Decimal(str(offer.price)) * Decimal("0.9") * Decimal("100")),
currency="ron",
destination=stripe_account_id,
transfer_group="Job" + str(offer.job.id),
)
But when I release the payment to tasker/worker. I get the following error:
Request req_M2Bv6M1kEQoFDm: Insufficient funds in Stripe account. In test mode, you can add funds to your available balance (bypassing your pending balance) by creating a charge with 4000 0000 0000 0077 as the card number. You can use the /v1/balance endpoint to view your Stripe balance (for more details, see stripe.com/docs/api#balance).
That means that the Balance on our account is not enough, you can use this 4000 0000 0000 0077 to have fund available on the account immediately.
but didn't payment_intent pay money to the account?
These payments were made, where did the money go?
Funds are not immediately available on the account
The funds need to process then become available..
These payment intents add money to 'Available to pay out soon' and not 'Available to pay out to your bank'
Which field is for funds available?
'Available to pay out to your bank'
If you use this card, 4000 0000 0000 0077 the fund should move there
i see
and you can make the above request given that it's less than the amount you charged with the card.
Happy to help!
Sorry, last one
For my payment scenario, do I pay out of Stripe Platform account or Stripe Platform's Connect account
It's a little confusing
I thought you were trying to transfer funds from your Platform Account to the Connected Account which means that your Platform account needs to have the funds.
Correcting myself here. I think you're wanting to transfer funds from the payment that have not beed added to the balance yet. In this case, you can pass in this source_transaction parameter: https://stripe.com/docs/api/transfers/create#create_transfer-source_transaction when creating the tranfer.
So on this stripe.Transfer.create call, you'd want to add the source_transaction parameter.
Honestly, I am so confused at this point. Let me try and explain the flow.
Step 1) For each person signing up to taskuri.ro, I am creating a stripe.Customer.create(), stripe.Account.create() and stripe.AccountLink.create().
If user posts a job, accepts an offer, and pays for that offer: stripe.PaymentIntent.create() with a transfer_group
If user is the worker and needs to receive the payment (he already has Stripe Connect from Step 1, I believe), then: stripe.Transfer.create(destination=workers_stripe_account_id)
Is my flow/logic here correct?
In regards to source_transaction #1141670274044018820 message vanya_stripe said that i can use transfer_group
That, https://stripe.com/docs/api/transfers/create#create_transfer-transfer_group is bit different.
Let me read through your flow here
Why are you creating a customer, stripe.Customer.create(),?
What is user in this case?
- For each person signing up to taskuri.ro, I am creating a stripe.Customer.create(), stripe.Account.create() and stripe.AccountLink.create().
stripe.Customer.create() - should be used when trying to create a customer who is paying. The end customer.
stripe.Account.create() and stripe.AccountLink.create() - are for your Connected Accounts, to integrate payments into your platform or marketplace.
Yes, and the same account can do both, be a payer and a receiver
stripe.Customer.create() can't the reciever
Can you share your business use case with me?
Let's back up and write out what you're exactly trying to do
but destination is stripe_account_id which is the Connect account, it has nothing to do with Customer
release_payment_to_tasker = stripe.Transfer.create(
amount=int(Decimal(str(offer.price)) * Decimal("0.9") * Decimal("100")),
currency="ron",
destination=stripe_account_id,
transfer_group="Job" + str(offer.job.id),
)
Can we jump on a call?
There is not a way for me to jump on a call.
'but destination is stripe_account_id which is the Connect account, it has nothing to do with Customer' is correct. Here you said, 'For each person signing up to taskuri.ro, I am creating a stripe.Customer.create()' so I'm trying to better understand what you're trying to do
Yeah, it is very simple, the business model is the same as Airtasker from Australia.
In django I create an account, it has an ID lets say 8. Then this account can act as a job advertiser (person who posts jobs) and a worker. If he is a job advertiser, he posts a job, then receives a bunch of offers from potential workers. If he is happy with an offer he received, he accepts the offer and pays. When the job is done by the worker. Job poster clicks a button and then the money is transferred to the worker.
If he wants to be the worker, the same account with ID 8. Can create an offer to someone, then do the work and then be paid.
I see. So when a job is accepted, this job can only be done by one person? Or are there instances where multiple people can do the same work and then split the payment?
One person
You know what i am thinking. I might have confused charge types with Destination charges and Separate charges and transfer. Different Stripe devs suggest different and i mixing two. But today is the day we put an end to it 😄 .
Ha! Yeah. If it's one person, then you can use Destination charges.
I would read through this and let me know what questions you have
let me quickly modify the code and try
You need to make a decision on what works best for you
Don't just modify things by my saying it
My recommendation would be that you just make one request and use Destination charges given that only one person can accept the job and get paid.
Yeah, but do you know what i am thinkin
The job poster pays when the job starts. But money is transferred to the worker only when job poster marks the job as 'complete'
With destination charges PaymentIntent is instant and transfer is made instantaneously to CONNECTED_ACCOUNT_ID
So we are back to separate charges and trasnfers, aren't we?
Ah, in that case yes. You can charge the customer, and the when the job completed transfer the funds.
On the transfer request, you'd want to pass source_transaction` parameter to avoid the error you were initially seeing.
problem with source_transaction is that the source is the PaymentIntent, and if that PaymentIntent isn't cleared, payout fails to the worker
@random nest but that's still the way
Like either you float the money for everyone as a company or you wait for the money to be paid
Are you going to float all the money to all your contractors/workers?
For everyone as a company
I don't want when job poster marks the job as complete, for the payment to fail because his initial payment hasn't been cleared
How are you going to fund all of that money in the first place? That's really not how most businesses like yours would ever do that. Someone would pay before the job is done
How am I going to fund? Using this (below is when job poster accepts an offer he makes the payment for that offer):
payment_intent = stripe.PaymentIntent.create(
amount=int(Decimal(str(offer.price)) * Decimal("1.1") * Decimal("100")),
currency="ron",
transfer_group="Task" + str(offer.job.id),
customer=user.userprofile.stripe_customer_id,
# payment_method=user.userprofile.stripe_payment_method_id,
payment_method="pm_1NgWn3IBT6PXARQEBImV4g75",
description="Plată pentru task " + str(offer.job.id),
confirm=True,
)
then when job poster marks the job as complete
release_payment_to_tasker = stripe.Transfer.create(
amount=int(Decimal(str(offer.price)) * Decimal("0.9") * Decimal("100")),
currency="ron",
destination=stripe_account_id,
transfer_group="Job" + str(offer.job.id),
)
yeah you copy-pasted that a few times
why would a job poster mark a job as complete if they haven't paid for it? How are you going to find the money to pay that worker if you don't have the money from the job poster?
why would a job poster mark a job as complete if they haven't paid for it? - they have paid for it when they accepted the offer which executed Payment.Intent.create()
well then why can't you use source_transaction then?
I'm sorry we're going a bit in circles here
1/ Create and confirm a PaymentIntent
2/ Later create a Transfer to send the money to that connected account and tie that Transfer to the PaymentIntent using source_transaction
@random nest I have to run! I really think you need to talk to our support team, explain your overal business model and flow of funds and have them guide you towards buiding this right!
You can contact them at https://support.stripe.com/contact
Sorry Koopajah for keeping you waiting, yes, thank you very much
Sure thing, I hope our team can help you further if you are stil blocked!