Skip to content

Commit

Permalink
v1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dimosKougiou committed Oct 16, 2024
1 parent c288295 commit 8107a75
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 83 deletions.
Binary file added README-IMAGES/iris-configuration-image001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README-IMAGES/iris-configuration-image002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README-IMAGES/iris-configuration-image003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,26 @@
- Contributors: cardlink
- Tags: payments, payment-gateway
- Requires at least: Joomla 4.1.0, VirtueMart 4.x
- Tested up to: Joomle 4.4.3, VirtueMart 4.2.4
- Tested up to: Joomle 4.4.8, VirtueMart 4.2.4
- Requires PHP: 7.x - 8.x
- License: GPLv2 or later
- License URI: http://www.gnu.org/licenses/gpl-2.0.html

## Changelog

- **1.0.0**
- Initial release.
- **1.0.1**
- Optimized digest validation process.
- **1.1.1**
- Minor fixes.
- Updated README.
- **1.1.0**
- Added support for IRIS payments.
- **1.0.1**
- Optimized digest validation process.
- **1.0.0**
- Initial release.

## Support tickets

In case that you face any technical issue during the installation process, you can contact the Cardlink e-commerce team at [email protected] .

## Description

Expand All @@ -37,7 +44,9 @@ Once you have completed the requested tests and any changes to your website, you
8. A text field for providing the absolute or relative (to Cardlink Payment Gateway location on server) URL of custom CSS stylesheet, to apply custom CSS styles in the payment page.
9. Translation ready for Greek & English languages.
10. Automatically cancel pending payment orders after a configurable number of minutes using Joomla Scheduled Tasks.
11. Support for IRIS payments.
11. Support for IRIS payments for Nexi acquirer only.
12. The IFRAME feature is not supported for IRIS payments


## Installation and Configuration

Expand Down Expand Up @@ -89,6 +98,11 @@ If you are unsure or unfamiliar with the actions described above, please ask a t

If you are unsure or unfamiliar with the actions described above, please ask a trained IT person or contact your hosting provider to do them for you.

## Support tickets

In case that you face any technical issue during the installation process, you can contact the Cardlink e-commerce team at [email protected] .
## IRIS Payments Setup

To set up IRIS payments, you will need to have the Merchant ID, Shared Secret and DIAS Customer ID specifically issued for use with IRIS. Other settings are similar to the ones for Card Payments.

![iris-configuration-image001.png](README-IMAGES/iris-configuration-image001.png)
![iris-configuration-image002.png](README-IMAGES/iris-configuration-image002.png)
![iris-configuration-image003.png](README-IMAGES/iris-configuration-image003.png)
4 changes: 2 additions & 2 deletions cardlink.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin" group="system" method="upgrade">
<name>Cardlink Payment Gateway Helper</name>
<version>1.1.0</version>
<modified>19-09-2024</modified>
<version>1.1.1</version>
<modified>14-10-2024</modified>
<creationDate>11/07/2024</creationDate>
<author>Cardlink</author>
<authorEmail>[email protected]</authorEmail>
Expand Down
11 changes: 8 additions & 3 deletions plugins/vmpayment/cardlinkcard/assets/js/scripts-frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,14 @@
$storedCardRadioOption.trigger('change');
}

var $iframe = $('#payment_iframe');
if ($iframe.length > 0) {
modalPayment($iframe);
var searchParams = new URLSearchParams(window.location.search);
var $vmOrderDone = $('.vm-wrap.vm-order-done');

if ($vmOrderDone.length > 0 || (searchParams.has('task') && searchParams.get('task') == 'orderdone')) {
var $iframe = $('#payment_iframe');
if ($iframe.length > 0) {
modalPayment($iframe);
}
}
});

Expand Down
8 changes: 4 additions & 4 deletions plugins/vmpayment/cardlinkcard/tmpl/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
$logoURL = Uri::root(true) . '/plugins/vmpayment/cardlinkcard/assets/images/cardlink.svg';

?>
<div id="cardlinkcard" class="cardlinkcard paymentgateway" style="margin:0 auto;text-align:center;">
<div id="cardlinkcard" class="cardlinkcard paymentgateway card-redirect" style="margin:0 auto;text-align:center;">
<?php /*/ ?><img onclick="document.payCardlinkCard.submit();" src="<?php echo $logoURL; ?>" border="0" id="cardlinklogo"
style="width:350px;cursor:pointer;" /><?php /*/ ?>
<form id="vmPaymentForm" name="payCardlinkCard" method="post" action="about:blank" accept-charset="UTF-8"
data-date="<?php echo date("Y-m-d H:i:s"); ?>">
<form id="vmPaymentFormCardlinkCard" name="payCardlinkCard" method="post" action="about:blank" target="_top"
accept-charset="UTF-8" data-date="<?php echo date("Y-m-d H:i:s"); ?>">
</form>

<script>
Expand All @@ -37,7 +37,7 @@
success: function (response) {
if (response.success) {
if (response.data.url) {
let $form = $('form#vmPaymentForm');
let $form = $('form#vmPaymentFormCardlinkCard');
$form.attr('action', response.data.url);
$.each(response.data.post_data, function (k, v) {
$('<input>').attr({ type: 'hidden', id: k, name: k, value: v }).appendTo($form);
Expand Down
12 changes: 6 additions & 6 deletions plugins/vmpayment/cardlinkcard/tmpl/form_iframe.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
$logoURL = Uri::root(true) . '/plugins/vmpayment/cardlinkcard/assets/images/cardlink.svg';

?>
<div id="cardlinkcard" class="cardlinkcard paymentgateway" style="margin:0 auto;text-align:center;">
<div id="cardlinkcard" class="cardlinkcard paymentgateway card-iframe" style="margin:0 auto;text-align:center;">
<?php /*/ ?><img src="<?php echo $logoURL; ?>" border="0" id="cardlinklogo" style="width:350px;cursor:pointer;" /><?php /*/ ?>

<form id="vmPaymentForm" name="payCardlinkCard" method="post" action="about:blank" target="payment_iframe"
accept-charset="UTF-8" data-date="<?php echo date("Y-m-d H:i:s"); ?>">
<form id="vmPaymentFormCardlinkCardIframe" name="payCardlinkCardIframe" method="post" action="about:blank"
target="payment_iframe" accept-charset="UTF-8" data-date="<?php echo date("Y-m-d H:i:s"); ?>">
</form>

<script>
Expand All @@ -38,7 +38,7 @@
success: function (response) {
if (response.success) {
if (response.data.url) {
let $form = $('form#vmPaymentForm');
let $form = $('form#vmPaymentFormCardlinkCardIframe');
$form.attr('action', response.data.url);
$.each(response.data.post_data, function (k, v) {
$('<input>').attr({ type: 'hidden', id: k, name: k, value: v }).appendTo($form);
Expand All @@ -47,13 +47,13 @@
+ '<?php echo vmText::_('VMPAYMENT_CARDLINKCARD_REDIRECT_MESSAGE'); ?>'
+ '</button>')
.on('click', function () {
document.payCardlinkCard.submit();
document.payCardlinkCardIframe.submit();
document.getElementById('modal').style.display = 'block';
})
.appendTo($form);

document.getElementById('modal').style.display = 'block';
document.payCardlinkCard.submit();
document.payCardlinkCardIframe.submit();
}
} else {
console.error('Error:', response.message);
Expand Down
8 changes: 0 additions & 8 deletions plugins/vmpayment/cardlinkiris/assets/css/styles-frontend.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ span.vmpayment.cardlinkiris span.vmCartPaymentLogo img {
max-height: 32px;
}

#payment_iframe {
width: 100%;
min-height: 700px;
height: 100%;
max-height: 100vh;
display: block;
}

@media print {
.no-print {
display: none;
Expand Down
38 changes: 1 addition & 37 deletions plugins/vmpayment/cardlinkiris/assets/js/scripts-frontend.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,8 @@
(function ($) {
'use strict';

function check_order_status(orderId) {
var polling = setInterval(function () {
var $iframe = $('#payment_iframe');
if ($iframe.attr('src') != 'about:blank') {
$.ajax({
url: 'index.php?option=com_virtuemart&view=plugin&type=vmpayment&name=cardlinkiris&task=checkOrderStatus',
data: {
order_id: orderId
},
type: 'post',
dataType: 'json',
success: function (response) {
var redirectUrl = response.data[0].redirect_url;
var redirected = response.data[0].redirected;
if (!redirected && redirectUrl) {
clearInterval(polling);
window.location.href = redirectUrl;
}
},
error: function (error) {
clearInterval(polling);
window.location.reload();
}
});
}
}, 1000);
}

function modalPayment($iframe) {
var orderId = $iframe.data('order-id');
check_order_status(orderId);
}

$(document).ready(function () {
var $iframe = $('#payment_iframe');
if ($iframe.length > 0) {
modalPayment($iframe);
}

});

})(jQuery);
7 changes: 3 additions & 4 deletions plugins/vmpayment/cardlinkiris/cardlinkiris.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function __construct(&$subject, $config)
'payment_logos' => array('', 'char'),
'referenceid' => array('order_number', 'char'),
'paytype' => array(1, 'int'),
'iframe' => array(0, 'int'),
'css_url' => array('', 'char'),
'version' => array(1, 'int'),
'debug' => array(0, 'int'),
Expand Down Expand Up @@ -288,12 +287,12 @@ function plgVmConfirmedOrder($cart, $order)
$cart->setCartIntoSession();

$html = $this->renderByLayout(
$this->_currentMethod->iframe ? 'form_iframe' : 'form',
'form',
array(
'order_id' => $virtuemart_order_id,
'order_ref_id' => $refID,
"logos" => $this->getLogos($this->_currentMethod),
"params" => $this->_currentMethod,
'logos' => $this->getLogos($this->_currentMethod),
'params' => $this->_currentMethod,
)
);
$app->input->set('html', $html);
Expand Down
4 changes: 0 additions & 4 deletions plugins/vmpayment/cardlinkiris/cardlinkiris.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@

<fieldset name="display_settings_section" label="VMPAYMENT_CARDLINKIRIS_DISPLAY_SETTINGS">
<field name="payment_logos" type="vmfiles" label="VMPAYMENT_CARDLINKIRIS_LOGOS" description="VMPAYMENT_CARDLINKIRIS_LOGOS_DESC" directory="/images/virtuemart/payment" hide_default="1" hide_none="0" stripext="0" exclude="^_" />
<field name="iframe" type="list" default="0" label="VMPAYMENT_CARDLINKIRIS_IFRAME" description="VMPAYMENT_CARDLINKIRIS_IFRAME_DESC">
<option value="0">COM_VIRTUEMART_NO</option>
<option value="1">COM_VIRTUEMART_YES</option>
</field>
<field type="url" name="css_url" size="50" maxlength="200" label="VMPAYMENT_CARDLINKIRIS_CSS_URL" validate="true" default="" hint="VMPAYMENT_CARDLINKIRIS_CSS_URL_DESC" />
</fieldset>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ VMPAYMENT_CARDLINKIRIS_LAYOUT_SECTION="Layout"
VMPAYMENT_CARDLINKIRIS_LAYOUT_SECTION_DESC="Here you can modify some layout in VirtueMart Shopping cart and Cardlink page."
VMPAYMENT_CARDLINKIRIS_SETTINGS_DESC="Ρυθμίσεις"
VMPAYMENT_CARDLINKIRIS_DISPLAY_SETTINGS="Ρυθμίσεις Εμφάνισης"
VMPAYMENT_CARDLINKIRIS_IFRAME="Enable payment iframe"
VMPAYMENT_CARDLINKIRIS_IFRAME_DESC="Customers will stay in website to complete payments without redirecting to Cardlink\'s eCommerce payment page.<br />You must have a valid SSL certificate installed on your domain."
VMPAYMENT_CARDLINKIRIS_CSS_URL="Css URL path"
VMPAYMENT_CARDLINKIRIS_CSS_URL_DESC="URL of custom CSS stylesheet, to be used to display payment page styles."
;------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ VMPAYMENT_CARDLINKIRIS_LAYOUT_SECTION_DESC="Here you can modify some layout in V
VMPAYMENT_CARDLINKIRIS_LOGOS="Logos"
VMPAYMENT_CARDLINKIRIS_SETTINGS_DESC="Settings"
VMPAYMENT_CARDLINKIRIS_DISPLAY_SETTINGS="Display Settings"
VMPAYMENT_CARDLINKIRIS_IFRAME="Enable payment iframe"
VMPAYMENT_CARDLINKIRIS_IFRAME_DESC="Customers will stay in website to complete payments without redirecting to Cardlink\'s eCommerce payment page.<br />You must have a valid SSL certificate installed on your domain."
VMPAYMENT_CARDLINKIRIS_CSS_URL="CSS URL path"
VMPAYMENT_CARDLINKIRIS_CSS_URL_DESC="URL of custom CSS stylesheet, to be used to display payment page styles."
VMPAYMENT_CARDLINKIRIS_SUCCESS_COMMENT="Your order %s has been paid successfully. Transaction ID %s %s."
Expand Down
6 changes: 3 additions & 3 deletions plugins/vmpayment/cardlinkiris/tmpl/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<div id="cardlink" class="cardlinkiris paymentgateway" style="margin:0 auto;text-align:center;">
<img src="<?php echo $logoURL; ?>" border="0" id="cardlinkIrisLogo" style="width:350px;cursor:pointer;" />

<form id="vmPaymentForm" name="payCardlinkIris" method="post" action="about:blank" accept-charset="UTF-8"
data-date="<?php echo date("Y-m-d H:i:s"); ?>">
<form id="vmPaymentFormCardlinkIris" name="payCardlinkIris" method="post" action="about:blank" target="_top"
accept-charset="UTF-8" data-date="<?php echo date("Y-m-d H:i:s"); ?>">
</form>

<script>
Expand All @@ -36,7 +36,7 @@
success: function (response) {
if (response.success) {
if (response.data.url) {
let $form = $('form#vmPaymentForm');
let $form = $('form#vmPaymentFormCardlinkIris');
$form.attr('action', response.data.url);
$.each(response.data.post_data, function (k, v) {
$('<input>').attr({ type: 'hidden', id: k, name: k, value: v }).appendTo($form);
Expand Down

0 comments on commit 8107a75

Please sign in to comment.