-
Notifications
You must be signed in to change notification settings - Fork 132
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
Hugo Bailey
committed
Apr 12, 2016
1 parent
fb533d8
commit 06bdc06
Showing
15 changed files
with
374 additions
and
14 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
namespace MangoPay; | ||
|
||
/** | ||
* Class to management MangoPay API for mandates | ||
*/ | ||
class ApiMandates extends Libraries\ApiBase | ||
{ | ||
/** | ||
* Create new mandate | ||
* @param Mandate $mandate | ||
* @return \MangoPay\Mandate Mandate object returned from API | ||
*/ | ||
public function Create($mandate, $idempotencyKey = null) | ||
{ | ||
return $this->CreateObject('mandates_create', $mandate, '\MangoPay\Mandate', null, null, $idempotencyKey); | ||
} | ||
|
||
/** | ||
* Get mandate | ||
* @param int $mandateId Mandate identifier | ||
* @return \MangoPay\Mandate Mandate object returned from API | ||
*/ | ||
public function Get($mandateId) | ||
{ | ||
return $this->GetObject('mandates_get', $mandateId, '\MangoPay\Mandate'); | ||
} | ||
|
||
/** | ||
* Cancel mandate | ||
* @param Mandate $mandateId Id of mandate object to cancel | ||
* @return \MangoPay\Mandate Mandate object returned from API | ||
*/ | ||
public function Cancel($mandateId) | ||
{ | ||
$mandate = new \MangoPay\Mandate(); | ||
$mandate->Id = $mandateId; | ||
|
||
return $this->SaveObject('mandates_save', $mandate, '\MangoPay\Mandate'); | ||
} | ||
|
||
/** | ||
* Get all mandates | ||
* @param \MangoPay\Pagination $pagination Pagination object | ||
* @param \MangoPay\FilterTransactions $filter Object to filter data | ||
* @param \MangoPay\Sorting $sorting Object to sorting data | ||
* @return array Array with mandates | ||
*/ | ||
public function GetAll(& $pagination = null, $filter = null, $sorting = null) | ||
{ | ||
return $this->GetList('mandates_all', $pagination, 'MangoPay\Mandate', null, $filter, $sorting); | ||
} | ||
} |
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,81 @@ | ||
<?php | ||
namespace MangoPay; | ||
|
||
/** | ||
* Direct debit mandate entity. | ||
*/ | ||
class Mandate extends Libraries\EntityBase | ||
{ | ||
/** | ||
* The bank account ID to associate this mandate against | ||
* @var string | ||
*/ | ||
public $BankAccountId; | ||
|
||
/** | ||
* The type of mandate – it will be « SEPA » or « BACS » | ||
* but will only be completed once the mandate has been submitted | ||
* @var string | ||
*/ | ||
public $Scheme; | ||
|
||
/** | ||
* The language to use for the confirmation web page presented to your user | ||
* @var string | ||
*/ | ||
public $Culture; | ||
|
||
/** | ||
* The URL to view/download the mandate document | ||
* @var string | ||
*/ | ||
public $DocumentURL; | ||
|
||
/** | ||
* Redirect URL | ||
* @var string | ||
*/ | ||
public $RedirectURL; | ||
|
||
/** | ||
* Return URL | ||
* @var string | ||
*/ | ||
public $ReturnURL; | ||
|
||
/** | ||
* ID of the user to which this mandate belongs | ||
* @var string | ||
*/ | ||
public $UserId; | ||
|
||
/** | ||
* Status of the mandate: CREATED, SUBMITTED, ACTIVE, FAILED | ||
* @var string | ||
*/ | ||
public $Status; | ||
|
||
/** | ||
* The mandate result code | ||
* @var string | ||
*/ | ||
public $ResultCode; | ||
|
||
/** | ||
* The mandate result Message | ||
* @var string | ||
*/ | ||
public $ResultMessage; | ||
|
||
/** | ||
* The type of mandate: DIRECT_DEBIT | ||
* @var string | ||
*/ | ||
public $MandateType; | ||
|
||
/** | ||
* How the mandate has been created: WEB | ||
* @var string | ||
*/ | ||
public $ExecutionType; | ||
} |
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
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
Oops, something went wrong.