-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Payutc\Service; | ||
|
||
/** | ||
* TRANSFER.php | ||
* | ||
* Ce service permet d'effectuer des virements. | ||
* | ||
*/ | ||
|
||
class TRANSFER extends \ServiceBase { | ||
|
||
/** | ||
* Faire un virement à quelqu'un | ||
* @param int $amount en centimes | ||
* @param int $userID userID a qui on vire l'argent | ||
* @param string $message message a mettre avec le virement | ||
* @return 1 or exception | ||
*/ | ||
public function transfer($amount, $userID, $message="") { | ||
// On a une appli qui a les droits ? | ||
$this->checkRight(false, true, true, null); | ||
// on a un user ? | ||
if(!$this->user()) { | ||
throw new \Payutc\Exception\CheckRightException("Vous devez connecter un utilisateur ! (method loginCas)"); | ||
} | ||
|
||
return $this->user()->transfer($amount, $userID, $message); | ||
} | ||
} |