Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Mark blik payments as basic transaction instead of card transaction; …
Browse files Browse the repository at this point in the history
…fix refunds of on site blik payments
  • Loading branch information
piotrjozwiak committed Jul 22, 2020
1 parent 1363bff commit 87a73e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions tpay/controllers/front/payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,22 @@ private function processPayment($cart, $customer, $orderTotal, $surcharge)
$this->tpayClientConfig['crc'] = $crc;
$type = Tools::getValue('type');
$isInstallment = $type === TPAY_PAYMENT_INSTALLMENTS;
$paymentType = $type === TPAY_PAYMENT_BASIC ? 'basic' : 'card';
$this->midId = TpayHelperClient::getCardMidNumber(
$this->context->currency->iso_code,
_PS_BASE_URL_ . __PS_BASE_URI__
);
if (in_array($type, [TPAY_PAYMENT_BASIC, TPAY_PAYMENT_BLIK, TPAY_PAYMENT_INSTALLMENTS], false)) {
$paymentType = 'basic';
} else {
$paymentType = 'card';
}
TpayModel::insertOrder($orderId, $crc, $paymentType, false, $surcharge, $this->midId);
$this->initBasicClient($isInstallment, $cart, $customer);
$this->context->cookie->last_order = $orderId;
unset($this->context->cookie->id_cart);
if (Tools::getValue('type') === TPAY_PAYMENT_CARDS) {
if ($type === TPAY_PAYMENT_CARDS) {
$this->processCardPayment($orderId);
} elseif (Tools::getValue('type') === TPAY_PAYMENT_BLIK && is_numeric(Tools::getValue('blik_code'))) {
} elseif ($type === TPAY_PAYMENT_BLIK && is_numeric(Tools::getValue('blik_code'))) {
$this->processBlikPayment();
} else {
$this->redirectToPayment();
Expand Down
2 changes: 1 addition & 1 deletion tpay/tpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct()
{
$this->name = 'tpay';
$this->tab = 'payments_gateways';
$this->version = '1.7.1';
$this->version = '1.7.2';
$this->author = 'Krajowy Integrator Płatności S.A.';
$this->need_instance = 0;
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.7');
Expand Down

0 comments on commit 87a73e5

Please sign in to comment.