-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PLUG-106: Add support for refund failed webhook, refund transaction t…
…able, refactoring.
- Loading branch information
Showing
43 changed files
with
1,556 additions
and
1,180 deletions.
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
This file was deleted.
Oops, something went wrong.
86 changes: 86 additions & 0 deletions
86
Api/Transaction/Payment/PaymentTransactionDataInterface.php
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,86 @@ | ||
<?php | ||
/** | ||
* Copyright © TrueLayer Ltd. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace TrueLayer\Connect\Api\Transaction\Payment; | ||
|
||
use TrueLayer\Connect\Api\Transaction\BaseTransactionDataInterface; | ||
|
||
/** | ||
* Interface for transaction model | ||
* @api | ||
*/ | ||
interface PaymentTransactionDataInterface extends BaseTransactionDataInterface | ||
{ | ||
/** | ||
* Constants for keys of data array. | ||
*/ | ||
public const QUOTE_ID = 'quote_id'; | ||
public const UUID = 'uuid'; | ||
public const TOKEN = 'token'; | ||
public const INVOICE_UUID = 'invoice_uuid'; | ||
public const PAYMENT_URL = 'payment_url'; | ||
|
||
/** | ||
* Returns the quote ID. | ||
* | ||
* @return int|null quote ID. | ||
*/ | ||
public function getQuoteId(): ?int; | ||
|
||
/** | ||
* Sets the quote ID. | ||
* | ||
* @param int $quoteId | ||
* @return $this | ||
*/ | ||
public function setQuoteId(int $quoteId): self; | ||
|
||
/** | ||
* Return token. | ||
* | ||
* @return string|null | ||
*/ | ||
public function getToken(): ?string; | ||
|
||
/** | ||
* Set token. | ||
* | ||
* @param string $value | ||
* @return $this | ||
*/ | ||
public function setToken(string $value): self; | ||
|
||
/** | ||
* Return invoice_uuid. | ||
* | ||
* @return string|null | ||
*/ | ||
public function getInvoiceUuid(): ?string; | ||
|
||
/** | ||
* Set invoice_uid. | ||
* | ||
* @param string $invoiceUuid | ||
* @return $this | ||
*/ | ||
public function setInvoiceUuid(string $invoiceUuid): self; | ||
|
||
/** | ||
* Return payment_url. | ||
* | ||
* @return string|null | ||
*/ | ||
public function getPaymentUrl(): ?string; | ||
|
||
/** | ||
* Set payment_url. | ||
* | ||
* @param string $paymentUrl | ||
* @return $this | ||
*/ | ||
public function setPaymentUrl(string $paymentUrl): self; | ||
} |
72 changes: 72 additions & 0 deletions
72
Api/Transaction/Payment/PaymentTransactionRepositoryInterface.php
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,72 @@ | ||
<?php | ||
/** | ||
* Copyright © TrueLayer Ltd. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace TrueLayer\Connect\Api\Transaction\Payment; | ||
|
||
use Magento\Framework\Exception\InputException; | ||
use Magento\Framework\Exception\LocalizedException; | ||
use Magento\Framework\Exception\NoSuchEntityException; | ||
|
||
/** | ||
* Transaction repository interface | ||
* @api | ||
*/ | ||
interface PaymentTransactionRepositoryInterface | ||
{ | ||
/** | ||
* Exception text | ||
*/ | ||
public const INPUT_EXCEPTION = 'An "%1" is needed. Set the "%1" and try again.'; | ||
public const NO_SUCH_ENTITY_EXCEPTION = 'The transaction with id "%1" does not exist.'; | ||
public const COULD_NOT_DELETE_EXCEPTION = 'Could not delete the transaction: %1'; | ||
public const COULD_NOT_SAVE_EXCEPTION = 'Could not save the transaction: %1'; | ||
|
||
/** | ||
* Loads a specified quote | ||
* | ||
* @param int $entityId | ||
* | ||
* @return PaymentTransactionDataInterface | ||
* @throws LocalizedException | ||
*/ | ||
public function get(int $entityId): PaymentTransactionDataInterface; | ||
|
||
/** | ||
* Return quote object | ||
* | ||
* @return PaymentTransactionDataInterface | ||
*/ | ||
public function create(): PaymentTransactionDataInterface; | ||
|
||
/** | ||
* Perform persist operations for one entity | ||
* | ||
* @param PaymentTransactionDataInterface $entity | ||
* | ||
* @return PaymentTransactionDataInterface | ||
* @throws LocalizedException | ||
*/ | ||
public function save(PaymentTransactionDataInterface $entity): PaymentTransactionDataInterface; | ||
|
||
/** | ||
* @param int $orderId | ||
* | ||
* @return PaymentTransactionDataInterface | ||
* @throws InputException | ||
* @throws NoSuchEntityException | ||
*/ | ||
public function getByOrderId(int $orderId): PaymentTransactionDataInterface; | ||
|
||
/** | ||
* @param string $uuid | ||
* | ||
* @return PaymentTransactionDataInterface | ||
* @throws InputException | ||
* @throws NoSuchEntityException | ||
*/ | ||
public function getByPaymentUuid(string $uuid): PaymentTransactionDataInterface; | ||
} |
Oops, something went wrong.