View
 

Auto ApprovingRejecting Commissions

This page describes how to synchronize the actions in your system with 2Performant Commissions. For example if a sale went through to auto approve the commission, or otherwise to reject it.

 

Download the API Wrapper

 

Visit the dedicated API page and download the wrapper for your desired programming language.

 

Used Methods

 

There are two methods you have to use: commissions_search() and commission_update().

 

Code

 

Commissions can be found via the unique transaction id:

 

// Code

// initialize the $tperformant object and then...

$options = { "search_transaction_id" => "your action transaction id" };

$commission = $tperformant->commissions_search($options);

 

Next you have to change it's status:

 

// Code

$commission->{'status'} = 'accepted'; // or 'rejected'

$tperformant->commission_update($commission->{'id'}, $commission);  

 

// If Rejecting

$commission->{'status'} = 'rejected';

$commission->{'current_reason'} = 'Credit Card didn't go through';

$tperformant->commission_update($commission->{'id'}, $commission); 

 

// If changing the amount

$commission->{'status'} = 'accepted';

$commission->{'amount'} = '30'; // new commission amount

$commission->{'current_reason'} = 'The client returned an item.';

$tperformant->commission_update($commission->{'id'}, $commission);

 

And that's it. Your commission is now synchronized.