-
Notifications
You must be signed in to change notification settings - Fork 14
[ACL-69] Merchant account transactions #81
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
Draft
stefandanaita
wants to merge
8
commits into
main
Choose a base branch
from
acl-69/merchant-account-transactions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
42013a4
[ACL-69] Merchant account transactions foundation
stefandanaita 5acbe57
[ACL-69] Add arrayFields and casts to the entities
stefandanaita c891eac
[ACL-69] Make integration test more specific
stefandanaita 46473ba
[ACL-69] PHPStan fix
stefandanaita a127916
[ACL-69] Acceptance test
stefandanaita 3ab7cc7
[ACL-69] Readme and Changelog
stefandanaita 0d8ebd7
[ACL-69] Bind MerchantAccountTransactionRetrieved base class
stefandanaita 86f5dfc
Merge branch 'main' into acl-69/merchant-account-transactions
stefandanaita File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,11 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace TrueLayer\Constants; | ||
|
|
||
| class MerchantAccountPayoutStatuses | ||
| { | ||
| public const EXECUTED_PAYOUT = 'executed'; | ||
| public const PENDING_PAYOUT = 'pending'; | ||
| } |
This file contains hidden or 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,13 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace TrueLayer\Constants; | ||
|
|
||
| class MerchantAccountTransactionTypes | ||
| { | ||
| public const MERCHANT_ACCOUNT_PAYMENT = 'merchant_account_payment'; | ||
| public const EXTERNAL_PAYMENT = 'external_payment'; | ||
| public const PAYOUT = 'payout'; | ||
| public const REFUND = 'refund'; | ||
| } |
This file contains hidden or 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
47 changes: 47 additions & 0 deletions
47
src/Entities/MerchantAccount/Transactions/MerchantAccountExecutedPayout.php
This file contains hidden or 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,47 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace TrueLayer\Entities\MerchantAccount\Transactions; | ||
|
|
||
| use TrueLayer\Interfaces\MerchantAccount\Transactions\MerchantAccountExecutedPayoutInterface; | ||
|
|
||
| class MerchantAccountExecutedPayout extends MerchantAccountPayout implements MerchantAccountExecutedPayoutInterface | ||
| { | ||
| /** | ||
| * @var string | ||
| */ | ||
| protected string $returnedBy; | ||
|
|
||
| /** | ||
| * @var string | ||
| */ | ||
| protected string $schemeId; | ||
|
|
||
| /** | ||
| * @return string[] | ||
| */ | ||
| protected function arrayFields(): array | ||
| { | ||
| return \array_merge(parent::arrayFields(), [ | ||
| 'returned_by', | ||
| 'scheme_id', | ||
| ]); | ||
| } | ||
|
|
||
| /** | ||
| * @return string|null | ||
| */ | ||
| public function getReturnedBy(): ?string | ||
| { | ||
| return $this->returnedBy ?? null; | ||
| } | ||
|
|
||
| /** | ||
| * @return string|null | ||
| */ | ||
| public function getSchemeId(): ?string | ||
| { | ||
| return $this->schemeId ?? null; | ||
| } | ||
| } |
55 changes: 55 additions & 0 deletions
55
src/Entities/MerchantAccount/Transactions/MerchantAccountExternalPayment.php
This file contains hidden or 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,55 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace TrueLayer\Entities\MerchantAccount\Transactions; | ||
|
|
||
| use TrueLayer\Interfaces\MerchantAccount\Transactions\MerchantAccountExternalPaymentInterface; | ||
| use TrueLayer\Interfaces\MerchantAccount\Transactions\Returns\MerchantAccountExternalPaymentReturnInterface; | ||
|
|
||
| class MerchantAccountExternalPayment extends MerchantAccountTransactionRetrieved implements MerchantAccountExternalPaymentInterface | ||
| { | ||
| /** | ||
| * @var \DateTimeInterface | ||
| */ | ||
| protected \DateTimeInterface $settledAt; | ||
|
|
||
| /** | ||
| * @var MerchantAccountExternalPaymentReturnInterface | ||
| */ | ||
| protected MerchantAccountExternalPaymentReturnInterface $returnedFor; | ||
|
|
||
| /** | ||
| * @var array|string[] | ||
| */ | ||
| protected array $casts = [ | ||
| 'settled_at' => \DateTimeInterface::class, | ||
| ]; | ||
|
|
||
| /** | ||
| * @return string[] | ||
| */ | ||
| protected function arrayFields(): array | ||
| { | ||
| return \array_merge(parent::arrayFields(), [ | ||
| 'settled_at', | ||
| 'returned_for', | ||
| ]); | ||
| } | ||
|
|
||
| /** | ||
| * @return \DateTimeInterface | ||
| */ | ||
| public function getSettledAt(): \DateTimeInterface | ||
| { | ||
| return $this->settledAt; | ||
| } | ||
|
|
||
| /** | ||
| * @return MerchantAccountExternalPaymentReturnInterface|null | ||
| */ | ||
| public function getRefundFor(): ?MerchantAccountExternalPaymentReturnInterface | ||
| { | ||
| return $this->returnedFor ?? null; | ||
| } | ||
| } |
84 changes: 84 additions & 0 deletions
84
src/Entities/MerchantAccount/Transactions/MerchantAccountPayment.php
This file contains hidden or 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,84 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace TrueLayer\Entities\MerchantAccount\Transactions; | ||
|
|
||
| use TrueLayer\Interfaces\MerchantAccount\Transactions\MerchantAccountPaymentInterface; | ||
| use TrueLayer\Interfaces\Payout\Beneficiary\PaymentSourceBeneficiaryInterface; | ||
|
|
||
| class MerchantAccountPayment extends MerchantAccountTransactionRetrieved implements MerchantAccountPaymentInterface | ||
| { | ||
| /** | ||
| * @var \DateTimeInterface | ||
| */ | ||
| protected \DateTimeInterface $settledAt; | ||
|
|
||
| /** | ||
| * @var PaymentSourceBeneficiaryInterface | ||
| */ | ||
| protected PaymentSourceBeneficiaryInterface $paymentSource; | ||
|
|
||
| /** | ||
| * @var string | ||
| */ | ||
| protected string $paymentId; | ||
|
|
||
| /** | ||
| * @var array<string, string> | ||
| */ | ||
| protected array $metadata; | ||
|
|
||
| /** | ||
| * @var array|string[] | ||
| */ | ||
| protected array $casts = [ | ||
| 'settled_at' => \DateTimeInterface::class, | ||
| 'payment_source' => PaymentSourceBeneficiaryInterface::class, | ||
| ]; | ||
|
|
||
| /** | ||
| * @return string[] | ||
| */ | ||
| protected function arrayFields(): array | ||
| { | ||
| return \array_merge(parent::arrayFields(), [ | ||
| 'settled_at', | ||
| 'payment_id', | ||
| 'payment_source', | ||
| 'metadata', | ||
| ]); | ||
| } | ||
|
|
||
| /** | ||
| * @return \DateTimeInterface | ||
| */ | ||
| public function getSettledAt(): \DateTimeInterface | ||
| { | ||
| return $this->settledAt; | ||
| } | ||
|
|
||
| /** | ||
| * @return PaymentSourceBeneficiaryInterface | ||
| */ | ||
| public function getPaymentSource(): PaymentSourceBeneficiaryInterface | ||
| { | ||
| return $this->paymentSource; | ||
| } | ||
|
|
||
| /** | ||
| * @return string | ||
| */ | ||
| public function getPaymentId(): string | ||
| { | ||
| return $this->paymentId; | ||
| } | ||
|
|
||
| /** | ||
| * @return string[] | ||
| */ | ||
| public function getMetadata(): array | ||
| { | ||
| return $this->metadata ?? []; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.