PaylineTransferCommand
extends ContainerAwareCommand
in package
uses
LockableTrait
Class PaylineTransferCommand
Handles transferring transactions to the escrow account for sales processed through the Payline payment method. This command ensures that unprocessed transactions are fetched, processed, and logged appropriately.
Table of Contents
Properties
- $entityManager : mixed
- $escrowService : mixed
- $paylineService : mixed
- $transactionLogService : PaylineTransactionLogService
Methods
- __construct() : void
- Constructor method for initializing dependencies.
- configure() : mixed
- execute() : mixed
- fetchUnprocessedSales() : array<string|int, Sale>
- Fetch unprocessed sales from the mz_sale table.
- getAccountRecipient() : mixed
- prepareRefundTransferPayload() : array<string|int, mixed>
- Prepare the payload for the transferFunds call based on transaction details.
- prepareTransferPayload() : array<string|int, mixed>
- Prepare the payload for the transferFunds call based on transaction details.
- processSaleTransaction() : void
- Processes a sale transaction by transferring funds to an escrow account, marking the sale as processed, fetching transaction details from Payline, and saving the log.
- saveTransactionLog() : mixed
- Save transaction details into the PaylineTransactionLog entity.
- sendFullTransferPayload() : void
- Sends the full transfer payload using the refactored methods in EzynessEscrowService.
- testRefund() : mixed
Properties
$entityManager
private
mixed
$entityManager
$escrowService
private
mixed
$escrowService
$paylineService
private
mixed
$paylineService
$transactionLogService
private
PaylineTransactionLogService
$transactionLogService
Methods
__construct()
Constructor method for initializing dependencies.
public
__construct(EntityManagerInterface $entityManager, EzynessEscrowService $escrowService, PaylineService $paylineService, PaylineTransactionLogService $transactionLogService) : void
Parameters
- $entityManager : EntityManagerInterface
-
The entity manager instance.
- $escrowService : EzynessEscrowService
-
The escrow service instance.
- $paylineService : PaylineService
-
The payline service instance.
- $transactionLogService : PaylineTransactionLogService
-
The transaction log service instance.
configure()
protected
configure() : mixed
execute()
protected
execute(InputInterface $input, OutputInterface $output) : mixed
Parameters
- $input : InputInterface
- $output : OutputInterface
fetchUnprocessedSales()
Fetch unprocessed sales from the mz_sale table.
private
fetchUnprocessedSales() : array<string|int, Sale>
Return values
array<string|int, Sale>getAccountRecipient()
private
getAccountRecipient() : mixed
prepareRefundTransferPayload()
Prepare the payload for the transferFunds call based on transaction details.
private
prepareRefundTransferPayload(mixed $refundId, array<string|int, mixed> $transactionDetails) : array<string|int, mixed>
Parameters
- $refundId : mixed
- $transactionDetails : array<string|int, mixed>
Return values
array<string|int, mixed>prepareTransferPayload()
Prepare the payload for the transferFunds call based on transaction details.
private
prepareTransferPayload(array<string|int, mixed> $transactionDetails) : array<string|int, mixed>
Parameters
- $transactionDetails : array<string|int, mixed>
Return values
array<string|int, mixed>processSaleTransaction()
Processes a sale transaction by transferring funds to an escrow account, marking the sale as processed, fetching transaction details from Payline, and saving the log.
private
processSaleTransaction(Sale $sale, OutputInterface $output) : void
Parameters
- $sale : Sale
-
The sale entity to process.
- $output : OutputInterface
-
The output interface for logging success or error messages.
saveTransactionLog()
Save transaction details into the PaylineTransactionLog entity.
private
saveTransactionLog(Sale $sale, mixed $transactionId, mixed $status, mixed $message) : mixed
Parameters
- $sale : Sale
- $transactionId : mixed
- $status : mixed
- $message : mixed
Tags
sendFullTransferPayload()
Sends the full transfer payload using the refactored methods in EzynessEscrowService.
private
sendFullTransferPayload(array<string|int, mixed> $transferPayload) : void
Parameters
- $transferPayload : array<string|int, mixed>
-
The full prepared payload.
testRefund()
private
testRefund(mixed $output) : mixed
Parameters
- $output : mixed