Skip to content

Commit fef1582

Browse files
author
richard
committed
New payment methods: Gift Card, Paysafecash.
1 parent ff94377 commit fef1582

14 files changed

Lines changed: 851 additions & 0 deletions
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?php
2+
3+
/**
4+
* Shop System Plugins - Terms of Use
5+
*
6+
* These plugins are offered by CardGate
7+
*
8+
* They have been tested and approved for full functionality in the standard
9+
* configuration
10+
* (status on delivery) of the corresponding shop system. They are under
11+
* General Public License Version 2 (GPLv2) and can be used, developed and
12+
* passed on to third parties under the same terms.
13+
*
14+
* However, CardGate does not provide any guarantee or accept any liability
15+
* for any errors occurring when used in an enhanced, customized shop system
16+
* configuration.
17+
*
18+
* Operation in an enhanced, customized configuration is at your own risk and
19+
* requires a comprehensive test phase by the user of the plugin.
20+
*
21+
* Customers use the plugins at their own risk. CardGate does not guarantee
22+
* their full functionality neither does CardGate assume liability for any
23+
* disadvantages related to the use of the plugins. Additionally, CardGate
24+
* does not guarantee the full functionality for customized shop systems or
25+
* installed plugins of other vendors of plugins within the same shop system.
26+
*
27+
* Customers are responsible for testing the plugin's functionality before
28+
* starting productive operation.
29+
*
30+
* By installing the plugin into the shop system the customer agrees to these
31+
* terms of use. Please do not use the plugin if you do not agree to these
32+
* terms of use!
33+
*/
34+
defined ( '_VALID_CALL' ) or die ( 'Direct Access is not allowed.' );
35+
36+
$sRootPath = dirname(dirname(dirname(dirname(__FILE__))));
37+
require_once($sRootPath . '/cardgate/classes/cardgate.php');
38+
39+
class cardgategiftcard extends cardgate{
40+
function __construct() {
41+
parent::__construct();
42+
}
43+
44+
/**
45+
* XTC-Funktion, um das Paymentrequest an einen externen PSP zu senden
46+
*
47+
* Die Funktion spiegelt in etwa die alte "payment_action" wieder. An dieser Stelle
48+
* wird die Anfrage gestellt und je nach der Ergebnis der Sprung auf die entsprechende
49+
* Seite vorbereitet (idR IFrame oder Fehlerseite)
50+
*
51+
* @param $order_data array
52+
* mit den wichtigsten Infos zur Bestellung
53+
* @return URL, zu der als nächstes gesprungen werden soll
54+
* @access public
55+
*/
56+
function pspRedirect($aOrderData = null) {
57+
return parent::pspRedirect($aOrderData);
58+
}
59+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/**
3+
* Shop System Plugins - Terms of Use
4+
*
5+
* These plugins are offered by CardGate
6+
*
7+
* They have been tested and approved for full functionality in the standard
8+
* configuration
9+
* (status on delivery) of the corresponding shop system. They are under
10+
* General Public License Version 2 (GPLv2) and can be used, developed and
11+
* passed on to third parties under the same terms.
12+
*
13+
* However, CardGate does not provide any guarantee or accept any liability
14+
* for any errors occurring when used in an enhanced, customized shop system
15+
* configuration.
16+
*
17+
* Operation in an enhanced, customized configuration is at your own risk and
18+
* requires a comprehensive test phase by the user of the plugin.
19+
*
20+
* Customers use the plugins at their own risk. CardGate does not guarantee
21+
* their full functionality neither does CardGate assume liability for any
22+
* disadvantages related to the use of the plugins. Additionally, CardGate
23+
* does not guarantee the full functionality for customized shop systems or
24+
* installed plugins of other vendors of plugins within the same shop system.
25+
*
26+
* Customers are responsible for testing the plugin's functionality before
27+
* starting productive operation.
28+
*
29+
* By installing the plugin into the shop system the customer agrees to these
30+
* terms of use. Please do not use the plugin if you do not agree to these
31+
* terms of use!
32+
*/
33+
34+
if ($tpl_data ['payment_code'] == 'cardgategiftcard') {
35+
$tpl_data ['plugin'] = new cardgategiftcard();
36+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
/**
3+
* Shop System Plugins - Terms of Use
4+
*
5+
* These plugins are offered by CardGate
6+
*
7+
* They have been tested and approved for full functionality in the standard
8+
* configuration
9+
* (status on delivery) of the corresponding shop system. They are under
10+
* General Public License Version 2 (GPLv2) and can be used, developed and
11+
* passed on to third parties under the same terms.
12+
*
13+
* However, CardGate does not provide any guarantee or accept any liability
14+
* for any errors occurring when used in an enhanced, customized shop system
15+
* configuration.
16+
*
17+
* Operation in an enhanced, customized configuration is at your own risk and
18+
* requires a comprehensive test phase by the user of the plugin.
19+
*
20+
* Customers use the plugins at their own risk. CardGate does not guarantee
21+
* their full functionality neither does CardGate assume liability for any
22+
* disadvantages related to the use of the plugins. Additionally, CardGate
23+
* does not guarantee the full functionality for customized shop systems or
24+
* installed plugins of other vendors of plugins within the same shop system.
25+
*
26+
* Customers are responsible for testing the plugin's functionality before
27+
* starting productive operation.
28+
*
29+
* By installing the plugin into the shop system the customer agrees to these
30+
* terms of use. Please do not use the plugin if you do not agree to these
31+
* terms of use!
32+
*/
33+
34+
defined('_VALID_CALL') or die('Direct Access is not allowed.');
35+
36+
if ($this->order_data['order_data']['payment_code'] == 'giftcard') {
37+
/** @global ADODB_mysql $db */
38+
global $db;
39+
40+
$rs = $db->GetAssoc("SELECT * FROM cardgate_transaction WHERE orderid=?", array((int)$this->order_data['order_data']['orders_id']));
41+
if (count($rs))
42+
{
43+
$cg_data = array_pop($rs);
44+
if (strlen($cg_data['RESPONSEDATA']))
45+
{
46+
$blacklist = array('last_order_id');
47+
$info = json_decode($cg_data['RESPONSEDATA']);
48+
foreach ($info as $k => $v)
49+
{
50+
if (in_array($k, $blacklist))
51+
continue;
52+
$tpl_data['order_data']['order_info_options'][] = array('text' => $k, 'value' => $v);
53+
}
54+
55+
}
56+
}
57+
}
58+
715 Bytes
Loading
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xtcommerceplugin>
3+
<title>Gift Card</title>
4+
<type>payment</type>
5+
<version>1.0.0</version>
6+
<code>cardgategiftcard</code>
7+
<url>http://cardgate.com</url>
8+
<description>Zahlungsmodul Gift Card</description>
9+
<icon>cardgategiftcard.png</icon>
10+
<payment>
11+
<payment_code>cardgategiftcard</payment_code>
12+
<payment_dir>cardgategiftcard</payment_dir>
13+
<payment_icon></payment_icon>
14+
<payment_tpl>cardgategiftcard.html</payment_tpl>
15+
<de>
16+
<title>Gift Card</title>
17+
<description></description>
18+
</de>
19+
<en>
20+
<title>Gift Card</title>
21+
<description></description>
22+
</en>
23+
<nl>
24+
<title>Gift Card</title>
25+
<description></description>
26+
</nl>
27+
</payment>
28+
29+
<db_install><![CDATA[
30+
include_once _SRV_WEBROOT . _SRV_WEB_PLUGINS. '/cardgategiftcard/installer/install.php';
31+
]]></db_install>
32+
33+
<plugin_code>
34+
<code>
35+
<hook>page_registry.php:bottom</hook>
36+
<phpcode><![CDATA[
37+
define('PAGE_CARDGATEGIFTCARD_CHECKOUT', _SRV_WEB_PLUGINS.'cardgategiftcard/pages/cardgategiftcard_checkout.php');
38+
]]></phpcode>
39+
<order>1</order>
40+
<active>1</active>
41+
</code>
42+
<code>
43+
<hook>class.checkout.php:_getPayment</hook>
44+
<phpcode><![CDATA[
45+
if(!empty($_COOKIE['QTAFFIWM'])){
46+
47+
foreach($payment_data as $k => $v) {
48+
if ($k != 'giftcard') {
49+
unset($payment_data[$k]);
50+
}
51+
}
52+
reset($payment_data);
53+
}
54+
]]></phpcode>
55+
<order>1</order>
56+
<active>1</active>
57+
</code>
58+
59+
<code>
60+
<hook>class.checkout.php:_selectPayment_tpl_data</hook>
61+
<phpcode><![CDATA[
62+
require _SRV_WEBROOT._SRV_WEB_PLUGINS.'cardgategiftcard/hooks/checkout_selectpayment_tpl_data.php';
63+
]]></phpcode>
64+
<order>1</order>
65+
<active>1</active>
66+
</code>
67+
68+
<code>
69+
<hook>order_edit.php:display_data</hook>
70+
<phpcode><![CDATA[
71+
require _SRV_WEBROOT._SRV_WEB_PLUGINS.'cardgategiftcard/hooks/order_edit_display_data.php';
72+
]]></phpcode>
73+
<order>0</order>
74+
<active>1</active>
75+
</code>
76+
</plugin_code>
77+
78+
79+
<language_content>
80+
<phrase>
81+
<key>TEXT_PAYMENT_CARDGATE_GIFTCARD</key>
82+
<class>store</class>
83+
<de>
84+
<value>Gift Card</value>
85+
</de>
86+
<en>
87+
<value>Gift Card</value>
88+
</en>
89+
<nl>
90+
<value>Gift Card</value>
91+
</nl>
92+
</phrase>
93+
</language_content>
94+
</xtcommerceplugin>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
/**
3+
* Shop System Plugins - Terms of Use
4+
*
5+
* These plugins are offered by CardGate
6+
*
7+
* They have been tested and approved for full functionality in the standard
8+
* configuration
9+
* (status on delivery) of the corresponding shop system. They are under
10+
* General Public License Version 2 (GPLv2) and can be used, developed and
11+
* passed on to third parties under the same terms.
12+
*
13+
* However, CardGate does not provide any guarantee or accept any liability
14+
* for any errors occurring when used in an enhanced, customized shop system
15+
* configuration.
16+
*
17+
* Operation in an enhanced, customized configuration is at your own risk and
18+
* requires a comprehensive test phase by the user of the plugin.
19+
*
20+
* Customers use the plugins at their own risk. CardGate does not guarantee
21+
* their full functionality neither does CardGate assume liability for any
22+
* disadvantages related to the use of the plugins. Additionally, CardGate
23+
* does not guarantee the full functionality for customized shop systems or
24+
* installed plugins of other vendors of plugins within the same shop system.
25+
*
26+
* Customers are responsible for testing the plugin's functionality before
27+
* starting productive operation.
28+
*
29+
* By installing the plugin into the shop system the customer agrees to these
30+
* terms of use. Please do not use the plugin if you do not agree to these
31+
* terms of use!
32+
*/
33+
34+
defined('_VALID_CALL') or die('Direct Access is not allowed.');
35+
36+
$sRootPath = dirname(dirname(dirname(dirname(__FILE__))));
37+
require_once($sRootPath . '/cardgate/installer/install.php');

0 commit comments

Comments
 (0)