Skip to content

Commit

Permalink
Change return value to OrderPaymentInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
sekulich-mygento authored Oct 23, 2024
1 parent 8791283 commit 0c9f9c2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Helper/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public function __construct(
* @param string $transactionId
* @param float $amount
* @param array $transData
*
* @return \Magento\Sales\Api\Data\OrderPaymentInterface
*/
public function proceedAuthorize($order, $transactionId, $amount, $transData = [])
{
Expand All @@ -80,13 +82,17 @@ public function proceedAuthorize($order, $transactionId, $amount, $transData = [
$transData
);
}

return $payment;
}

/**
* @param \Magento\Sales\Api\Data\OrderInterface $order
* @param string $transactionId
* @param float $amount
* @param array $transData
*
* @return \Magento\Sales\Api\Data\OrderPaymentInterface
*/
public function proceedCapture($order, $transactionId, $amount, $transData = [])
{
Expand All @@ -108,13 +114,17 @@ public function proceedCapture($order, $transactionId, $amount, $transData = [])
$transData
);
}

return $payment;
}

/**
* @param \Magento\Sales\Api\Data\OrderInterface $order
* @param string $transactionId
* @param string $parentTransactionId
* @param float $amount
*
* @return \Magento\Sales\Api\Data\OrderPaymentInterface
*/
public function proceedRefund($order, $transactionId, $parentTransactionId, $amount)
{
Expand All @@ -128,13 +138,17 @@ public function proceedRefund($order, $transactionId, $parentTransactionId, $amo
$payment->registerRefundNotification($amount);

$this->orderRepository->save($order);

return $payment;
}

/**
* @param \Magento\Sales\Api\Data\OrderInterface $order
* @param string $transactionId
* @param string $parentTransactionId
* @param float $amount
*
* @return \Magento\Sales\Api\Data\OrderPaymentInterface
*/
public function proceedVoid($order, $transactionId, $parentTransactionId, $amount)
{
Expand All @@ -144,13 +158,17 @@ public function proceedVoid($order, $transactionId, $parentTransactionId, $amoun
$payment->registerVoidNotification($amount);

$this->orderRepository->save($order);

return $payment;
}

/**
* @param \Magento\Sales\Api\Data\OrderInterface $order
* @param string $transactionId
* @param string $parentTransactionId
* @param mixed $transData
*
* @return \Magento\Sales\Api\Data\OrderPaymentInterface
*/
public function proceedReceipt($order, $transactionId, $parentTransactionId, $transData)
{
Expand Down Expand Up @@ -189,13 +207,17 @@ public function proceedReceipt($order, $transactionId, $parentTransactionId, $tr
);

$this->orderRepository->save($order);

return $payment;
}

/**
* @param \Magento\Sales\Api\Data\OrderInterface $order
* @param string $transactionId
* @param string $parentTransactionId
* @param mixed $transData
*
* @return \Magento\Sales\Api\Data\OrderPaymentInterface
*/
public function proceedRefundReceipt($order, $transactionId, $parentTransactionId, $transData)
{
Expand Down Expand Up @@ -234,6 +256,8 @@ public function proceedRefundReceipt($order, $transactionId, $parentTransactionI
);

$this->orderRepository->save($order);

return $payment;
}

/**
Expand Down

0 comments on commit 0c9f9c2

Please sign in to comment.