Jump to content

payTo: split payment for two members


Recommended Posts

@Mark,

I'm working a resource that will allow purchases. Fine. The commission and fee goes to board account and I will use $item->payTo so the money goes to someone else.

And here is the issue. This particular resource will introduce a third user to receive a slice of the money. An example? Something like a club:

  • The board will receive 10%
  • The user who is selling will receive 80%
  • The club owner SHOULD receive the other 10%

I actually didn't try yet so probably I'm making a dumb question without even try.. is it enough to use 2 payTo? Will this work? If so, how/where can I set the % for the seller and the "club" owner?

Tks.

Link to comment
Share on other sites

4 minutes ago, Adriano Faria said:

@Mark,

I'm working a resource that will allow purchases. Fine. The commission and fee goes to board account and I will use $item->payTo so the money goes to someone else.

And here is the issue. This particular resource will introduce a third user to receive a slice of the money. An example? Something like a club:

  • The board will receive 10%
  • The user who is selling will receive 80%
  • The club owner SHOULD receive the other 10%

I actually didn't try yet so probably I'm making a dumb question without even try.. is it enough to use 2 payTo? Will this work? If so, how/where can I set the % for the seller and the "club" owner?

Tks.

can you not run something via onPaid or somewhere like that to transfer it from x member to club owner? that way the member will receive say 80% then you will work out the owners 10% and take it from the member to add to the owner credit

Link to comment
Share on other sites

Just now, TheJackal84 said:

can you not run something via onPaid or somewhere like that to transfer it from x member to club owner? that way the member will receive say 80% then you will work out the owners 10% and take it from the member to add to the owner credit

Seems a bit weird but may work. Probably will do that if it hasn't a "clean" way.

Link to comment
Share on other sites

3 minutes ago, Adriano Faria said:

Seems a bit weird but may work. Probably will do that if it hasn't a "clean" way.

yeah it is not really the best way, but it could work if there is no other, you could send both emails in the onPaid as well so the member will not get one saying they got x $$$ then another saying x has been took

Link to comment
Share on other sites

1 hour ago, Adriano Faria said:

Any suggestions, Mark?

I think I can’t run something in onPaid, as suggested by @TheJackal84, because the money is already deducted (tax and fee) and the rest goes to the payTo I indicate. Right?

What if say the user gets 80% the board get 10% and the club owner gets 10%,

via the invoice etc you would take 10% and payTo the club owner, pay 90% to the seller, under the $invoice->save(); add something like

$extra = $invoice->status_extra;
$extra['sitemoney'] = $The10PercentinTheirDefaultCurrency;
$invoice->status_extra = $extra;
$invoice->save();

now on the onPaid you will write a code to call the $invoice->status_extra['sitemoney'] and to remove it from the sellers account?,

you will probably be sending emails for the amount gained etc but again write a code what calculates the 10% x2 then add that amount to the commission earned email.

Link to comment
Share on other sites

3 hours ago, Adriano Faria said:

Any suggestions, Mark?

I think I can’t run something in onPaid, as suggested by @TheJackal84, because the money is already deducted (tax and fee) and the rest goes to the payTo I indicate. Right?

OK so I figured out a way, ( I was bored and intrested in this lol )

Do the invoice normally and then payTo the club owner his 10%, ( you can just use 90% as commission for the site as that is what it will be ) now under invoice save do something like this

$totalPercent = \IPS\Settings::i()->club_owner_percent + \IPS\Settings::i()->sites_percent;
$getTotal = $price->amount->percentage( $totalPercent );
$toPayOwner = new \IPS\nexus\Money( $price->amount->subtract( $getTotal ), $currency ); 
$extra = $invoice->status_extra;
$extra['sellerscut'] = $toPayOwner;
$invoice->status_extra = $extra;
$invoice->save();

now if the item was $12 and the both % were set to 10% it will save as {"amount":"9.6","currency":"USD"} as 20% of $12 is $2.40, take $2.40 away from $12 is $9.60.

In the onPaid call

$invoice->status_extra['sellerscut']

and there you have the $9.60 to pay to the seller

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...