Skip to content

Commit

Permalink
Blik fix
Browse files Browse the repository at this point in the history
  • Loading branch information
krzGablo committed Jan 17, 2024
1 parent a8c9531 commit 75f5e91
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions Controller/tpay/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ class Create extends Action
private $cache;

public function __construct(
Context $context,
TpayInterface $tpayModel,
TpayService $tpayService,
Session $checkoutSession,
Context $context,
TpayInterface $tpayModel,
TpayService $tpayService,
Session $checkoutSession,
CacheInterface $cache
)
{
) {
$this->tpay = $tpayModel;
$this->tpayService = $tpayService;
$this->checkoutSession = $checkoutSession;
Expand Down Expand Up @@ -70,14 +69,14 @@ public function execute(): ResponseInterface

$this->handleOpenApiTrId($paymentData, $transaction);

$this->tpayService->addCommentToHistory($orderId, 'Transaction title ' . $transaction['title']);
$this->tpayService->addCommentToHistory($orderId, 'Transaction title ' .$transaction['title']);
$transactionUrl = $transaction['url'];

if (true === $this->tpay->redirectToChannel()) {
$transactionUrl = str_replace('gtitle', 'title', $transactionUrl);
}

$this->tpayService->addCommentToHistory($orderId, 'Transaction link ' . $transactionUrl);
$this->tpayService->addCommentToHistory($orderId, 'Transaction link ' .$transactionUrl);
$paymentData['additional_information']['transaction_url'] = $transactionUrl;
$payment->setData($paymentData)->save();

Expand Down Expand Up @@ -132,8 +131,8 @@ private function prepareTransaction($orderId, array $additionalPaymentInformatio
$data['channel'] = null;
$this->handleBlikData($data, $additionalPaymentInformation['blik_code']);
} else {
$data['group'] = (int)($additionalPaymentInformation['group'] ?? null);
$data['channel'] = (int)($additionalPaymentInformation['channel'] ?? null);
$data['group'] = (int) ($additionalPaymentInformation['group'] ?? null);
$data['channel'] = (int) ($additionalPaymentInformation['channel'] ?? null);

if ($this->tpay->redirectToChannel()) {
$data['direct'] = 1;
Expand Down

0 comments on commit 75f5e91

Please sign in to comment.