-
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 #660 from Mangopay/feature/virtual-accounts
Feature/virtual accounts
- Loading branch information
Showing
18 changed files
with
428 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,56 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
class ApiVirtualAccounts extends Libraries\ApiBase | ||
{ | ||
/** | ||
* Create new Virtual Account | ||
* @param String $walletId | ||
* @param VirtualAccount $virtualAccount | ||
* @return \MangoPay\VirtualAccount Virtual Account object returned from API | ||
*/ | ||
public function Create($virtualAccount, $walletId, $idempotencyKey = null) | ||
{ | ||
return $this->CreateObject('virtual_account_create', $virtualAccount, '\MangoPay\VirtualAccount', $walletId, $idempotencyKey); | ||
} | ||
|
||
/** | ||
* @param string $walletId | ||
* @param string $virtualAccountId | ||
* @return \MangoPay\VirtualAccount | ||
*/ | ||
public function Get($walletId, $virtualAccountId) | ||
{ | ||
return $this->GetObject('virtual_account_get', '\MangoPay\VirtualAccount', $walletId, $virtualAccountId); | ||
} | ||
|
||
/** | ||
* @param \MangoPay\Pagination $pagination Pagination object | ||
* @param string $walletId | ||
* @return \MangoPay\VirtualAccount[] | ||
*/ | ||
public function GetAll($walletId, $pagination = null, $sorting = null) | ||
{ | ||
return $this->GetList('virtual_account_get_all', $pagination, '\MangoPay\VirtualAccount', $walletId, $sorting); | ||
} | ||
|
||
/** | ||
* @param string $walletId | ||
* @param string $virtualAccountId | ||
* @return \MangoPay\VirtualAccount | ||
*/ | ||
public function Deactivate($walletId, $virtualAccountId) | ||
{ | ||
$empty_object = new VirtualAccount(); | ||
return $this->SaveObject('virtual_account_deactivate', $empty_object, '\MangoPay\VirtualAccount', $walletId, $virtualAccountId); | ||
} | ||
|
||
/** | ||
* @return \MangoPay\VirtualAccountAvailabilities | ||
*/ | ||
public function GetAvailabilities() | ||
{ | ||
return $this->GetObject('virtual_account_get_availabilities', '\MangoPay\VirtualAccountAvailabilities'); | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
class InternationalAccount extends Libraries\Dto | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $Iban; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $Bic; | ||
} |
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,18 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
class InternationalAccountDetails extends Libraries\Dto | ||
{ | ||
/** | ||
* Information about the address associated with the international IBAN account. | ||
* @var VirtualAccountAddress | ||
*/ | ||
public $Address; | ||
|
||
/** | ||
* The IBAN and BIC of the account. | ||
* @var InternationalAccount | ||
*/ | ||
public $Account; | ||
} |
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,18 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
class LocalAccount extends Libraries\Dto | ||
{ | ||
/** | ||
* The account number of the account | ||
* @var string | ||
*/ | ||
public $AccountNumber; | ||
|
||
/** | ||
* The sort code of the account. | ||
* @var string | ||
*/ | ||
public $SortCode; | ||
} |
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,18 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
class LocalAccountDetails extends Libraries\Dto | ||
{ | ||
/** | ||
* Information about the address associated with the local IBAN account. | ||
* @var VirtualAccountAddress | ||
*/ | ||
public $Address; | ||
|
||
/** | ||
* Information about the address associated with the local IBAN account. | ||
* @var LocalAccount | ||
*/ | ||
public $Account; | ||
} |
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,76 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
/** | ||
* Virtual Account entity | ||
*/ | ||
class VirtualAccount extends Libraries\EntityBase | ||
{ | ||
/** | ||
* The ID of the wallet | ||
* @var string | ||
*/ | ||
public $WalletId; | ||
|
||
/** | ||
* The credited user ID | ||
* @var string | ||
*/ | ||
public $CreditedUserId; | ||
|
||
/** | ||
* The type of the virtual account | ||
* Allowed values: `COLLECTION`, `USER_OWNED` | ||
* @var string | ||
* @see \MangoPay\VirtualAccountPurpose | ||
*/ | ||
public $VirtualAccountPurpose; | ||
|
||
/** | ||
* The country of the IBAN. The country must correspond to the currency of the wallet | ||
* ISO 3166-1 alpha-2 format is expected | ||
* @var string | ||
*/ | ||
public $Country; | ||
|
||
/** | ||
* The status of the virtual account creation | ||
* Allowed values: `COLLECTION`, `USER_OWNED` | ||
* @var string | ||
* @see \MangoPay\VirtualAccountStatus | ||
*/ | ||
public $Status; | ||
|
||
/** | ||
* Whether the banking alias is active or not | ||
* @var bool | ||
*/ | ||
public $Active; | ||
|
||
/** | ||
* The current Status of the Virtual Account | ||
* Allowed values: `COLLECTION`, `USER_OWNED` | ||
* @var string | ||
* @see \MangoPay\VirtualAccountOwner | ||
*/ | ||
public $AccountOwner; | ||
|
||
/** | ||
* The current Status of the Virtual Account | ||
* @var \MangoPay\LocalAccountDetails | ||
*/ | ||
public $LocalAccountsDetails; | ||
|
||
/** | ||
* The current Status of the Virtual Account | ||
* @var \MangoPay\InternationalAccountDetails | ||
*/ | ||
public $InternationalAccountDetails; | ||
|
||
/** | ||
* The current Status of the Virtual Account | ||
* @var \MangoPay\VirtualAccountCapabilities | ||
*/ | ||
public $Capabilities; | ||
} |
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 MangoPay; | ||
|
||
class VirtualAccountAddress extends Libraries\Dto | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $StreetName; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $PostCode; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $TownName; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $CountrySubDivision; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $Country; | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
class VirtualAccountAvailabilities extends Libraries\Dto | ||
{ | ||
/** | ||
* * @var VirtualAccountAvailability[] | ||
*/ | ||
public $Collection; | ||
|
||
/** | ||
* * @var VirtualAccountAvailability[] | ||
*/ | ||
public $UserOwned; | ||
} |
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,24 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
class VirtualAccountAvailability extends Libraries\EntityBase | ||
{ | ||
/** | ||
* ISO 3166-1 alpha-2 format is expected | ||
* * @var string | ||
*/ | ||
public $Country; | ||
|
||
/** | ||
* Whether international bank wires can be made to this account | ||
* @var Boolean | ||
*/ | ||
public $Available; | ||
|
||
/** | ||
* List of currencies supported by the account | ||
* @var CurrencyIso[] | ||
* */ | ||
public $Currencies; | ||
} |
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,24 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
class VirtualAccountCapabilities extends Libraries\Dto | ||
{ | ||
/** | ||
* Whether local bank wires can be made to this account. | ||
* @var bool | ||
*/ | ||
public $LocalPayInAvailable; | ||
|
||
/** | ||
* Whether international bank wires can be made to this account | ||
* @var bool | ||
*/ | ||
public $InternationalPayInAvailable; | ||
|
||
/** | ||
* List of currencies supported by the account | ||
* @var CurrencyIso[] | ||
*/ | ||
public $Currencies; | ||
} |
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,9 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
class VirtualAccountOwner | ||
{ | ||
const Collection = "COLLECTION"; | ||
const UserOwned = "USER_OWNED"; | ||
} |
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,9 @@ | ||
<?php | ||
|
||
namespace MangoPay; | ||
|
||
class VirtualAccountPurpose | ||
{ | ||
const Collection = "COLLECTION"; | ||
const UserOwned = "USER_OWNED"; | ||
} |
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 MangoPay; | ||
|
||
/** | ||
* Virtual Account statuses | ||
*/ | ||
class VirtualAccountStatus | ||
{ | ||
const Pending = "PENDING"; | ||
const Active = "ACTIVE"; | ||
const Failed = "FAILED"; | ||
const Blocked = "BLOCKED"; | ||
const Closed = "CLOSED"; | ||
} |
Oops, something went wrong.