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,5 @@
{
"description": "Account holder used for international payments and payouts",
"reference": "S.Eller-001",
"legalEntityId": "LE322JV223222D5GG42KN6869"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"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,
"requestedSettings": {
"interval": "daily",
"maxAmount": {
"currency": "EUR",
"value": 0
}
},
"verificationStatus": "pending"
}
},
"id": "AH3227C223222H5J4DCLW9VBV",
"status": "active"
}
20 changes: 16 additions & 4 deletions tests/Resources/Checkout/donations-success.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
{
"additionalData": {
"merchantReference": "YOUR_DONATION_REFERENCE"
"id": "UNIQUE_RESOURCE_ID",
"status": "completed",
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"amount": {
"currency": "EUR",
"value": 1000
},
"pspReference": "853589530367661E",
"response": "[donation-received]"
"reference": "YOUR_DONATION_REFERENCE",
"payment": {
"pspReference": "1234567890",
"resultCode": "Authorised",
"amount": {
"currency": "EUR",
"value": 1000
},
"merchantReference": "YOUR_DONATION_REFERENCE"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"type": "individual",
"individual": {
"residentialAddress": {
"city": "Sydney",
"country": "AU",
"postalCode": "1122",
"stateOrProvince": "NSW",
"street": "Winfield Avenue",
"street2": "12"
},
"name": {
"firstName": "Shelly",
"lastName": "Eller"
},
"identificationData": {
"issuerState": "NSW",
"number": "1234567891",
"type": "driversLicense",
"cardNumber": "112327"
},
"birthData": {
"dateOfBirth": "1991-01-01"
},
"email": "s.hopper @example.com"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"individual": {
"email": "s.hopper @example.com",
"birthData": {
"dateOfBirth": "1991-01-01"
},
"identificationData": {
"cardNumber": "112327",
"issuerState": "NSW",
"number": "1234567891",
"type": "driversLicense"
},
"name": {
"firstName": "Shelly",
"lastName": "Eller"
},
"residentialAddress": {
"city": "Sydney",
"country": "AU",
"postalCode": "1122",
"stateOrProvince": "NSW",
"street": "Winfield Avenue",
"street2": "12"
}
},
"type": "individual",
"id": "LE00000000000000000000001"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"entityAssociations": [
{
"legalEntityId": "LE00000000000000000000002",
"type": "settlor",
"entityType": "individual",
"settlorExemptionReason": [
"deceased",
"professionalServiceProvider"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"entityAssociations": [
{
"associatorId": "LE00000000000000000000001",
"legalEntityId": "LE00000000000000000000002",
"type": "settlor",
"entityType": "individual",
"settlorExemptionReason": [
"deceased",
"professionalServiceProvider"
]
}
],
"trust": {
"name": "Example Trust",
"type": "fixedUnitTrust",
"doingBusinessAs": "West's Store",
"countryOfGoverningLaw": "AU",
"taxInformation": [
{
"country": "AU",
"type": "ABN",
"number": "12345678901"
}
],
"registeredAddress": {
"street": "Winfield Avenue",
"city": "Sydney",
"postalCode": "1197",
"stateOrProvince": "NSW",
"country": "AU"
},
"undefinedBeneficiaryInfo": [
{
"description": "My future children"
}
]
},
"type": "trust",
"id": "LE00000000000000000000001"
}
30 changes: 25 additions & 5 deletions tests/Unit/BalancePlatformTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Adyen\Tests\Unit;

use Adyen\AdyenException;
use Adyen\Client;
use Adyen\Environment;
use Adyen\Model\BalancePlatform\AccountHolder;
use Adyen\Model\BalancePlatform\AccountHolderUpdateRequest;
Expand All @@ -15,9 +14,7 @@
use Adyen\Service\BalancePlatform\PaymentInstrumentGroupsApi;
use Adyen\Service\BalancePlatform\PlatformApi;
use Adyen\Service\BalancePlatform\TransferLimitsBalanceAccountLevelApi;
use http\Env;
use PharIo\Manifest\Url;
use function PHPUnit\Framework\assertEquals;
use Adyen\Model\BalancePlatform\AccountHolderInfo;

class BalancePlatformTest extends TestCaseMock
{
Expand All @@ -37,7 +34,7 @@ public function testGetAccountHolder()

public function testGetAccountHolderAdditionalAttributesDoesNotThrow()
{

$client = $this->createMockClientUrl(
'tests/Resources/BalancePlatform/get-account-holder-additional-attributes.json'
);
Expand Down Expand Up @@ -219,4 +216,27 @@ public function testGetCurrentTransferLimits()
$this->requestUrl
);
}

public function testCreateAccountHolder()
{
$client = $this->createMockClient(
'tests/Resources/BalancePlatform/create-account-holder-response.json',
200
);

$service = new AccountHoldersApi($client);

$accountHolderInfo = new AccountHolderInfo();
$accountHolderInfo->setDescription('Account holder used for international payments and payouts');
$accountHolderInfo->setReference('S.Eller-001');
$accountHolderInfo->setLegalEntityId('LE322JV223222D5GG42KN6869');

$response = $service->createAccountHolder($accountHolderInfo);

self::assertEquals('AH3227C223222H5J4DCLW9VBV', $response->getId());
self::assertEquals('YOUR_BALANCE_PLATFORM', $response->getBalancePlatform());
self::assertEquals('LE322JV223222D5GG42KN6869', $response->getLegalEntityId());
self::assertEquals('S.Eller-001', $response->getReference());
self::assertEquals('active', $response->getStatus());
}
}
Loading
Loading