-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
118 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace Myckhel\Paystack\Http\Controllers; | ||
|
||
use Myckhel\Paystack\Support\Recipient; | ||
|
||
class RecipientController extends Controller | ||
{ | ||
function __call($method, $args) | ||
{ | ||
return $args | ||
? Recipient::$method($args[0], request()->all()) | ||
: Recipient::$method(request()->all()); | ||
} | ||
} |
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,77 @@ | ||
<?php | ||
|
||
namespace Myckhel\Paystack\Support; | ||
|
||
use Myckhel\Paystack\Traits\Request; | ||
|
||
/** | ||
* The Transfer Recipients API allows you create | ||
* and manage beneficiaries that you send money to | ||
* | ||
*/ | ||
class Recipient | ||
{ | ||
use Request; | ||
|
||
/** | ||
* Creates a new recipient. A duplicate account number | ||
* will lead to the retrieval of the existing record. | ||
* | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
static function create($params = []) | ||
{ | ||
return self::post("/transferrecipient", $params); | ||
} | ||
|
||
/** | ||
* Create multiple transfer recipients in batches. | ||
* A duplicate account number will lead to the retrieval of the existing record. | ||
* | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
static function bulkCreate($params = []) | ||
{ | ||
return self::post("/transferrecipient", $params); | ||
} | ||
|
||
/** | ||
* List transfer recipients available on your integration. | ||
* | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
static function list($params = []) | ||
{ | ||
return self::get("/transferrecipient", $params); | ||
} | ||
|
||
/** | ||
* Get details of a transfer recipients on your integration. | ||
* | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
static function fetch($recipient, $params = []) | ||
{ | ||
return self::get("/transferrecipient/$recipient", $params); | ||
} | ||
|
||
/** | ||
* Update a transfer recipients details on your integration | ||
* | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
static function update($recipient, $params = []) | ||
{ | ||
return self::put("/transferrecipient/$recipient", $params); | ||
} | ||
|
||
/** | ||
* Deletes a transfer recipient (sets the transfer recipient to inactive) | ||
* | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
static function remove($recipient, $params = []) | ||
{ | ||
return self::delete("/transferrecipient/$recipient", $params); | ||
} | ||
} |
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