Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACL-80] Signup Plus auth uri #72

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
.phpunit.cache
.phpunit.result.cache
.php-cs-fixer.cache
vendor/
Expand Down
8 changes: 8 additions & 0 deletions config/bindings.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Interfaces\HppInterface::class => 'makeHpp',

Interfaces\AddressInterface::class => Entities\Address::class,
Interfaces\AddressRetrievedInterface::class => Entities\AddressRetrieved::class,
Interfaces\UserInterface::class => Entities\User::class,

Interfaces\Payment\Beneficiary\BeneficiaryBuilderInterface::class => Entities\Payment\Beneficiary\BeneficiaryBuilder::class,
Expand Down Expand Up @@ -109,5 +110,12 @@
Interfaces\Webhook\Beneficiary\ExternalAccountBeneficiaryInterface::class => Entities\Webhook\Beneficiary\ExternalAccountBeneficiary::class,
Interfaces\Webhook\Beneficiary\BeneficiaryInterface::class => Entities\Webhook\Beneficiary\Beneficiary::class,

Interfaces\SignupPlus\SignupPlusBuilderInterface::class => Entities\SignupPlus\SignupPlusBuilder::class,
Interfaces\SignupPlus\SignupPlusAuthUriRequestInterface::class => Entities\SignupPlus\SignupPlusAuthUriRequest::class,
Interfaces\SignupPlus\SignupPlusAuthUriCreatedInterface::class => Entities\SignupPlus\SignupPlusAuthUriCreated::class,
Interfaces\SignupPlus\SignupPlusAccountDetailsInterface::class => Entities\SignupPlus\SignupPlusAccountDetails::class,
Interfaces\SignupPlus\SignupPlusUserDataRequestInterface::class => Entities\SignupPlus\SignupPlusUserDataRequest::class,
Interfaces\SignupPlus\SignupPlusUserDataRetrievedInterface::class => Entities\SignupPlus\SignupPlusUserDataRetrieved::class,

Interfaces\RequestOptionsInterface::class => Entities\RequestOptions::class,
];
3 changes: 3 additions & 0 deletions src/Constants/Endpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ class Endpoints

public const PAYOUTS_CREATE = '/v3/payouts';
public const PAYOUTS_RETRIEVE = '/v3/payouts/{id}';
public const SIGNUP_PLUS_AUTH = '/signup-plus/authuri';
public const SIGNUP_PLUS_PAYMENTS = '/signup-plus/payments?payment_id={id}';
public const SIGNUP_PLUS_MANDATES = '/signup-plus/mandates?mandate_id={id}';
}
92 changes: 1 addition & 91 deletions src/Entities/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,8 @@

use TrueLayer\Interfaces\AddressInterface;

class Address extends Entity implements AddressInterface
class Address extends AddressRetrieved implements AddressInterface
{
/**
* @var string
*/
protected string $addressLine1;

/**
* @var string
*/
protected string $addressLine2;

/**
* @var string
*/
protected string $city;

/**
* @var string
*/
protected string $state;

/**
* @var string
*/
protected string $zip;

/**
* @var string
*/
protected string $countryCode;

/**
* @var string[]
*/
protected array $arrayFields = [
'address_line1',
'address_line2',
'city',
'state',
'zip',
'country_code',
];

/**
* @return string|null
*/
public function getAddressLine1(): ?string
{
return $this->addressLine1 ?? null;
}

/**
* @param string $addressLine1
*
Expand All @@ -70,14 +20,6 @@ public function addressLine1(string $addressLine1): AddressInterface
return $this;
}

/**
* @return string|null
*/
public function getAddressLine2(): ?string
{
return $this->addressLine2 ?? null;
}

/**
* @param string $addressLine2
*
Expand All @@ -90,14 +32,6 @@ public function addressLine2(string $addressLine2): AddressInterface
return $this;
}

/**
* @return string|null
*/
public function getCity(): ?string
{
return $this->city ?? null;
}

/**
* @param string $city
*
Expand All @@ -110,14 +44,6 @@ public function city(string $city): AddressInterface
return $this;
}

/**
* @return string|null
*/
public function getState(): ?string
{
return $this->state ?? null;
}

/**
* @param string $state
*
Expand All @@ -130,14 +56,6 @@ public function state(string $state): AddressInterface
return $this;
}

/**
* @return string|null
*/
public function getZip(): ?string
{
return $this->zip ?? null;
}

/**
* @param string $zip
*
Expand All @@ -150,14 +68,6 @@ public function zip(string $zip): AddressInterface
return $this;
}

/**
* @return string|null
*/
public function getCountryCode(): ?string
{
return $this->countryCode ?? null;
}

/**
* @param string $countryCode
*
Expand Down
100 changes: 100 additions & 0 deletions src/Entities/AddressRetrieved.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?php

declare(strict_types=1);

namespace TrueLayer\Entities;

use TrueLayer\Interfaces\AddressRetrievedInterface;

class AddressRetrieved extends Entity implements AddressRetrievedInterface
{
/**
* @var string
*/
protected string $addressLine1;

/**
* @var string
*/
protected string $addressLine2;

/**
* @var string
*/
protected string $city;

/**
* @var string
*/
protected string $state;

/**
* @var string
*/
protected string $zip;

/**
* @var string
*/
protected string $countryCode;

/**
* @var string[]
*/
protected array $arrayFields = [
'address_line1',
'address_line2',
'city',
'state',
'zip',
'country_code',
];

/**
* @return string|null
*/
public function getAddressLine1(): ?string
{
return $this->addressLine1 ?? null;
}

/**
* @return string|null
*/
public function getAddressLine2(): ?string
{
return $this->addressLine2 ?? null;
}

/**
* @return string|null
*/
public function getCity(): ?string
{
return $this->city ?? null;
}

/**
* @return string|null
*/
public function getState(): ?string
{
return $this->state ?? null;
}

/**
* @return string|null
*/
public function getZip(): ?string
{
return $this->zip ?? null;
}

/**
* @return string|null
*/
public function getCountryCode(): ?string
{
return $this->countryCode ?? null;
}
}
73 changes: 73 additions & 0 deletions src/Entities/SignupPlus/SignupPlusAccountDetails.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php

declare(strict_types=1);

namespace TrueLayer\Entities\SignupPlus;

use TrueLayer\Entities\Entity;
use TrueLayer\Interfaces\SignupPlus\SignupPlusAccountDetailsInterface;

class SignupPlusAccountDetails extends Entity implements SignupPlusAccountDetailsInterface
{
/**
* @var string
*/
protected string $accountNumber;

/**
* @var string
*/
protected string $sortCode;

/**
* @var string
*/
protected string $iban;

/**
* @var string
*/
protected string $providerId;

/**
* @var string[]
*/
protected array $arrayFields = [
'account_number',
'sort_code',
'iban',
'provider_id',
];

/**
* @return string
*/
public function getAccountNumber(): string
{
return $this->accountNumber;
}

/**
* @return string
*/
public function getSortCode(): string
{
return $this->sortCode;
}

/**
* @return string
*/
public function getIban(): string
{
return $this->iban;
}

/**
* @return string
*/
public function getProviderId(): string
{
return $this->providerId;
}
}
31 changes: 31 additions & 0 deletions src/Entities/SignupPlus/SignupPlusAuthUriCreated.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace TrueLayer\Entities\SignupPlus;

use TrueLayer\Entities\Entity;
use TrueLayer\Interfaces\SignupPlus\SignupPlusAuthUriCreatedInterface;

class SignupPlusAuthUriCreated extends Entity implements SignupPlusAuthUriCreatedInterface
{
/**
* @var string
*/
protected string $authUri;

/**
* @var string[]
*/
protected array $arrayFields = [
'auth_uri',
];

/**
* @return string
*/
public function getAuthUri(): string
{
return $this->authUri;
}
}
Loading
Loading