Skip to content

Commit

Permalink
cards_view
Browse files Browse the repository at this point in the history
  • Loading branch information
krzGablo committed Jan 8, 2024
1 parent 692db32 commit 519f55b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Model/TpayConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ public function afterGetAvailableMethods(MethodList $compiled, $result)
{
$onsiteChannels = $this->scopeConfig->getValue(self::CONFIG_PATH, ScopeInterface::SCOPE_STORE);

$secondTpay = false;
foreach ($result as $paymentMethod) {
if ($paymentMethod->getCode() == 'tpaycom_magento2basic') {
if ($secondTpay) {
$paymentMethod->setCode('tpaycom_magento2basic_cards');
} else {
$secondTpay = true;
}
}
}

if (!$onsiteChannels){
return $result;
}

foreach (explode(',', $onsiteChannels) as $onsiteChannel) {
$method = $this->data->getMethodInstance('generic');
$method->setChannelId($onsiteChannel);
Expand Down
18 changes: 18 additions & 0 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@
<currency>PLN</currency>
<use_sandbox>0</use_sandbox>
</tpaycom_magento2basic>
<tpaycom_magento2basic_cards>
<order_status>pending_payment</order_status>
<active>0</active>
<model>tpaycom\magento2basic\Model\Tpay</model>
<title>Karty</title>
<allowspecific>0</allowspecific>
<min_order_total>0.10</min_order_total>
<is_gateway>1</is_gateway>
<can_use_checkout>1</can_use_checkout>
<can_authorize>0</can_authorize>
<can_capture>0</can_capture>
<can_refund>1</can_refund>
<can_void>0</can_void>
<can_cancel>1</can_cancel>
<currency>PLN</currency>
<check_server>1</check_server>
<check_proxy>0</check_proxy>
</tpaycom_magento2basic_cards>
<generic>
<order_status>pending_payment</order_status>
<active>0</active>
Expand Down

0 comments on commit 519f55b

Please sign in to comment.