Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"balancePlatform": "YOUR_BALANCE_PLATFORM",
"description": "Account holder used for international payments and payouts",
"legalEntityId": "LE322JV223222D5GG42KN6869",
"reference": "S.Eller-001",
"additionalAttributes": "something",
"capabilities": {
"receiveFromPlatformPayments": {
"enabled": true,
"requested": true,
"allowed": false,
"verificationStatus": "pending"
},
"receiveFromBalanceAccount": {
"enabled": true,
"requested": true,
"allowed": false,
"verificationStatus": "pending"
},
"sendToBalanceAccount": {
"enabled": true,
"requested": true,
"allowed": false,
"verificationStatus": "pending"
},
"sendToTransferInstrument": {
"enabled": true,
"requested": true,
"allowed": false,
"transferInstruments": [
{
"enabled": true,
"requested": true,
"allowed": false,
"id": "SE322KH223222F5GXZFNM3BGP",
"verificationStatus": "pending"
}
],
"verificationStatus": "pending"
}
},
"id": "AH3227C223222C5GXQXF658WB",
"status": "active"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"balancePlatform": "YOUR_BALANCE_PLATFORM",
"description": "Account holder used for international payments and payouts",
"legalEntityId": "LE322JV223222D5GG42KN6869",
"reference": "S.Eller-001",
"capabilities": {
"receiveFromPlatformPayments": {
"enabled": true,
"requested": true,
"allowed": false,
"verificationStatus": "this is unknown"
},
"receiveFromBalanceAccount": {
"enabled": true,
"requested": true,
"allowed": false,
"verificationStatus": "pending"
},
"sendToBalanceAccount": {
"enabled": true,
"requested": true,
"allowed": false,
"verificationStatus": "pending"
},
"sendToTransferInstrument": {
"enabled": true,
"requested": true,
"allowed": false,
"transferInstruments": [
{
"enabled": true,
"requested": true,
"allowed": false,
"id": "SE322KH223222F5GXZFNM3BGP",
"verificationStatus": "pending"
}
],
"verificationStatus": "pending"
}
},
"id": "AH3227C223222C5GXQXF658WB",
"status": "active"
}
43 changes: 43 additions & 0 deletions tests/Resources/BalancePlatform/get-account-holder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"balancePlatform": "YOUR_BALANCE_PLATFORM",
"description": "Account holder used for international payments and payouts",
"legalEntityId": "LE322JV223222D5GG42KN6869",
"reference": "S.Eller-001",
"capabilities": {
"receiveFromPlatformPayments": {
"enabled": true,
"requested": true,
"allowed": false,
"verificationStatus": "pending"
},
"receiveFromBalanceAccount": {
"enabled": true,
"requested": true,
"allowed": false,
"verificationStatus": "pending"
},
"sendToBalanceAccount": {
"enabled": true,
"requested": true,
"allowed": false,
"verificationStatus": "pending"
},
"sendToTransferInstrument": {
"enabled": true,
"requested": true,
"allowed": false,
"transferInstruments": [
{
"enabled": true,
"requested": true,
"allowed": false,
"id": "SE322KH223222F5GXZFNM3BGP",
"verificationStatus": "pending"
}
],
"verificationStatus": "pending"
}
},
"id": "AH3227C223222C5GXQXF658WB",
"status": "active"
}
1 change: 1 addition & 0 deletions tests/Unit/AccountHolderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public function testAccountHolderCreateSuccess($jsonFile, $httpStatus)
);
}


/**
* @return array
*/
Expand Down
55 changes: 55 additions & 0 deletions tests/Unit/BalancePlatformTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,61 @@

class BalancePlatformTest extends TestCaseMock
{

public function testGetAccountHolder()
{
$client = $this->createMockClientUrl(
'tests/Resources/BalancePlatform/get-account-holder.json'
);

$service = new AccountHoldersApi($client);
$response = $service->getAccountHolder('AH00AH3227C223222C5GXQXF658WB00000001');
self::assertEquals('AH3227C223222C5GXQXF658WB', $response->getId());
self::assertEquals(AccountHolder::STATUS_ACTIVE, $response->getStatus());
self::assertEquals("pending", $response['capabilities']['receiveFromPlatformPayments']['verificationStatus']);
}

public function testGetAccountHolderAdditionalAttributesDoesNotThrow()
{

$client = $this->createMockClientUrl(
'tests/Resources/BalancePlatform/get-account-holder-additional-attributes.json'
);

$service = new AccountHoldersApi($client);

try {
$response = $service->getAccountHolder('AH00AH3227C223222C5GXQXF658WB00000001');

self::assertEquals('AH3227C223222C5GXQXF658WB', $response->getId());
self::assertEquals(AccountHolder::STATUS_ACTIVE, $response->getStatus());
self::assertEquals("pending", $response['capabilities']['receiveFromPlatformPayments']['verificationStatus']);
} catch (\Throwable $e) {
$this->fail('An unexpected exception was thrown: ' . $e->getMessage());
}
}

public function testGetAccountHolderUnknownEnum()
{
$this->markTestSkipped('This test should be enable when enum parsing is fixed.');

$client = $this->createMockClientUrl(
'tests/Resources/BalancePlatform/get-account-holder-unknown-enum.json'
);

$service = new AccountHoldersApi($client);

try {
$response = $service->getAccountHolder('AH00AH3227C223222C5GXQXF658WB00000001');

self::assertEquals('AH3227C223222C5GXQXF658WB', $response->getId());
self::assertEquals(AccountHolder::STATUS_ACTIVE, $response->getStatus());
self::assertEquals("pending", $response['capabilities']['receiveFromPlatformPayments']['verificationStatus']);
} catch (\Throwable $e) {
$this->fail('An unexpected exception was thrown: ' . $e->getMessage());
}
}

/**
* @throws AdyenException
*/
Expand Down
Loading