Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Transfer credits from one account to another account, using the username to specify the target account.

Code Block
themeRDark
languagephp
titleExample
linenumberstrue
$result = $tmClient->transferCreditsToUser(3, 'targetusername', 'targetpassword');
echo "Transfered 3 credits (leaving {$result['source_credits_after']}), to 
targetusername, which now has {$result['target_credits_after']} credits";

Arguments:

 

integer $quantity: 

The number of credits to transfer from the source account to the target account.

string $target_username:

The username of the account to transfer the credits to.

string $target_password:

The password of the account to transfer the credits to.

Returns:

an array with four keys: 'source_credits_before', 'source_credits_after',
'target_credits_before' and 'target_credits_after' e.g. $result['source_credits_after']

Array KeyValue
source_credits_before The number of credits on the source account before the transfer.
source_credits_after

The number of credits on the source account after the transfer.

target_credits_beforeThe number of credits on the target account before the transfer.
target_credits_after

The number of credits on the target account after the transfer.

Specific error codes:

CodeMeaning
0

There are insufficient credits available to transfer the specified quantity, or the specified quantity is not a positive number

1

The target account number specified is not a valid number or username/password combination does not refer to any known account

 

Panel
title
  • Next
Panel
titleAll Functions
Panel
titleDownload

 

 

Warning
titleYou must know!

Our example code is an illustration of how you might integrate with our systems and is not certified for production environments. You are responsible for testing and QA.