#alx8523

1 messages · Page 1 of 1 (latest)

hollow lodgeBOT
misty sable
#

Hi, what questions do you have?

random nest
#

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).
misty sable
#

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.

random nest
#

but didn't payment_intent pay money to the account?

#

These payments were made, where did the money go?

misty sable
#

Funds are not immediately available on the account

#

The funds need to process then become available..

random nest
#

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?

misty sable
#

'Available to pay out to your bank'

#

If you use this card, 4000 0000 0000 0077 the fund should move there

random nest
#

i see

misty sable
#

and you can make the above request given that it's less than the amount you charged with the card.

random nest
#

i understand

#

okay, you can close the chat

#

thank you very very much!

misty sable
#

Happy to help!

random nest
#

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

misty sable
#

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.

#

So on this stripe.Transfer.create call, you'd want to add the source_transaction parameter.

random nest
#

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?

misty sable
#

Let me read through your flow here

#

Why are you creating a customer, stripe.Customer.create(),?

#

What is user in this case?

#
  1. 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.

random nest
#

Yes, and the same account can do both, be a payer and a receiver

misty sable
#

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

random nest
#

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?

misty sable
#

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

random nest
#

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.

misty sable
#

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?

random nest
#

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 😄 .

misty sable
#

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

random nest
#

let me quickly modify the code and try

misty sable
#

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.

random nest
#

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?

misty sable
#

Ah, in that case yes. You can charge the customer, and the when the job completed transfer the funds.

random nest
#

yep yep

#

Good lord i didnt proceed to change all the code 😄

misty sable
#

On the transfer request, you'd want to pass source_transaction` parameter to avoid the error you were initially seeing.

random nest
#

problem with source_transaction is that the source is the PaymentIntent, and if that PaymentIntent isn't cleared, payout fails to the worker

blazing shoal
#

@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?

random nest
#

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

blazing shoal
#

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

random nest
#

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),
        )
blazing shoal
#

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?

random nest
#

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()

blazing shoal
#

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!

random nest
#

Sorry Koopajah for keeping you waiting, yes, thank you very much

blazing shoal
#

Sure thing, I hope our team can help you further if you are stil blocked!