-
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.
Merge pull request #580 from Mangopay/feature/deposits
Feature/deposits
- Loading branch information
Showing
14 changed files
with
547 additions
and
11 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,40 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
/** | ||
* Class to management MangoPay API for users | ||
*/ | ||
class ApiDeposits extends Libraries\ApiBase | ||
{ | ||
/** | ||
* Create Deposit | ||
* @param CreateDeposit $deposit Deposit object to save | ||
* @return Deposit Deposit object returned from API | ||
*/ | ||
public function Create(CreateDeposit $deposit) | ||
{ | ||
return $this->CreateObject('deposits_create', $deposit, '\MangoPay\Deposit'); | ||
} | ||
|
||
/** | ||
* Get Deposit | ||
* @param string $depositId Deposit identifier | ||
* @return Deposit Deposit object returned from API | ||
*/ | ||
public function Get($depositId) | ||
{ | ||
return $this->GetObject('deposits_get', '\MangoPay\Deposit', $depositId); | ||
} | ||
|
||
/** | ||
* Cancel Deposit | ||
* @param string $depositId Deposit identifier | ||
* @param CancelDeposit $dto Cancel deposit body | ||
* @return Deposit Deposit object returned from API | ||
*/ | ||
public function Cancel($depositId, CancelDeposit $dto) | ||
{ | ||
return $this->SaveObject('deposits_cancel', $dto, '\MangoPay\Deposit', $depositId); | ||
} | ||
} |
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,21 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
class CancelDeposit extends Libraries\Dto | ||
{ | ||
/** | ||
* @var string | ||
* @see CardPreAuthorizationPaymentStatus | ||
*/ | ||
public $PaymentStatus; | ||
|
||
/** | ||
* Get array with mapping which property is object and what type of object | ||
* @return array | ||
*/ | ||
public function GetSubObjects() | ||
{ | ||
return parent::GetSubObjects(); | ||
} | ||
} |
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,49 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
class CreateCardPreAuthorizedDepositPayIn extends Libraries\EntityBase | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $AuthorId; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $CreditedWalletId; | ||
|
||
/** | ||
* @var Money | ||
*/ | ||
public $DebitedFunds; | ||
|
||
/** | ||
* @var Money | ||
*/ | ||
public $Fees; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $DepositId; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $Tag; | ||
|
||
/** | ||
* Get array with mapping which property is object and what type of object | ||
* @return array | ||
*/ | ||
public function GetSubObjects() | ||
{ | ||
$subObjects = parent::GetSubObjects(); | ||
$subObjects['DebitedFunds'] = '\MangoPay\Money'; | ||
$subObjects['Fees'] = '\MangoPay\Money'; | ||
|
||
return $subObjects; | ||
} | ||
} |
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,72 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
class CreateDeposit extends Libraries\Dto | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $AuthorId; | ||
|
||
/** | ||
* @var Money | ||
*/ | ||
public $DebitedFunds; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $CardId; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $SecureModeReturnURL; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $StatementDescriptor; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $Culture; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $IpAddress; | ||
|
||
/** | ||
* BrowserInfo | ||
* @var BrowserInfo | ||
*/ | ||
public $BrowserInfo; | ||
|
||
/** | ||
* @var Billing | ||
*/ | ||
public $Billing; | ||
|
||
/** | ||
* @var Shipping | ||
*/ | ||
public $Shipping; | ||
|
||
/** | ||
* Get array with mapping which property is object and what type of object | ||
* @return array | ||
*/ | ||
public function GetSubObjects() | ||
{ | ||
$subObjects = parent::GetSubObjects(); | ||
$subObjects['DebitedFunds'] = '\MangoPay\Money'; | ||
$subObjects['BrowserInfo'] = '\MangoPay\BrowserInfo'; | ||
$subObjects['Billing'] = '\MangoPay\Billing'; | ||
$subObjects['Shipping'] = '\MangoPay\Shipping'; | ||
|
||
return $subObjects; | ||
} | ||
} |
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,135 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
class Deposit extends Libraries\EntityBase | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $AuthorId; | ||
|
||
/** | ||
* @var Money | ||
*/ | ||
public $DebitedFunds; | ||
|
||
/** | ||
* @var string | ||
* @see DepositStatus | ||
*/ | ||
public $Status; | ||
|
||
/** | ||
* @var string | ||
* @see CardPreAuthorizationPaymentStatus | ||
*/ | ||
public $PaymentStatus; | ||
|
||
/** | ||
* @var PayinsLinked | ||
*/ | ||
public $PayinsLinked; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $ResultCode; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $ResultMessage; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $CardId; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $SecureModeReturnURL; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $SecureModeRedirectURL; | ||
|
||
/** | ||
* @var boolean | ||
*/ | ||
public $SecureModeNeeded; | ||
|
||
/** | ||
* @var int Unix timestamp | ||
*/ | ||
public $ExpirationDate; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $PaymentType; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $ExecutionType; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $StatementDescriptor; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $Culture; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $IpAddress; | ||
|
||
/** | ||
* BrowserInfo | ||
* @var BrowserInfo | ||
*/ | ||
public $BrowserInfo; | ||
|
||
/** | ||
* @var Billing | ||
*/ | ||
public $Billing; | ||
|
||
/** | ||
* @var Shipping | ||
*/ | ||
public $Shipping; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $Requested3DSVersion; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $Applied3DSVersion; | ||
|
||
/** | ||
* Get array with mapping which property is object and what type of object | ||
* @return array | ||
*/ | ||
public function GetSubObjects() | ||
{ | ||
$subObjects = parent::GetSubObjects(); | ||
$subObjects['PayinsLinked'] = '\MangoPay\PayinsLinked'; | ||
$subObjects['DebitedFunds'] = '\MangoPay\Money'; | ||
$subObjects['BrowserInfo'] = '\MangoPay\BrowserInfo'; | ||
$subObjects['Billing'] = '\MangoPay\Billing'; | ||
$subObjects['Shipping'] = '\MangoPay\Shipping'; | ||
|
||
return $subObjects; | ||
} | ||
} |
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,14 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
final class DepositStatus | ||
{ | ||
const Created = 'CREATED'; | ||
const Succeeded = 'SUCCEEDED'; | ||
const Failed = 'FAILED'; | ||
|
||
private function __construct() | ||
{ | ||
} | ||
} |
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.