Version Notes
- Added 'send payment link email'
- Added support for orders created by admins
- Added iDEAL QR
- Added paysafecard
- Fixed correct processing of some declined creditcard transactions
Download this release
Release Info
Developer | Cardgate BV |
Extension | Cardgate_Cgp |
Version | 1.2.1 |
Comparing to | |
See all releases |
Code changes from version 1.2.0 to 1.2.1
- app/code/local/Cardgate/.gitignore +1 -0
- app/code/local/Cardgate/Cgp/Block/Adminhtml/Paymentlink/Resend.php +45 -0
- app/code/local/Cardgate/Cgp/Block/Info/Payment.php +62 -0
- app/code/local/Cardgate/Cgp/Model/Base.php +95 -66
- app/code/local/Cardgate/Cgp/Model/Gateway/Abstract.php +172 -115
- app/code/local/Cardgate/Cgp/Model/Gateway/Idealqr.php +17 -0
- app/code/local/Cardgate/Cgp/Model/Gateway/Paysafecard.php +17 -0
- app/code/local/Cardgate/Cgp/Model/Gateway/Pos.php +20 -0
- app/code/local/Cardgate/Cgp/Model/Observer.php +37 -11
- app/code/local/Cardgate/Cgp/Model/Paymentlink.php +109 -0
- app/code/local/Cardgate/Cgp/controllers/Adminhtml/CardgateController.php +101 -0
- app/code/local/Cardgate/Cgp/controllers/StandardController.php +164 -35
- app/code/local/Cardgate/Cgp/etc/config.xml +526 -424
- app/code/local/Cardgate/Cgp/etc/system.xml +322 -0
- app/code/local/Cardgate/Cgp/sql/cgp_setup/mysql4-upgrade-1.2.0-1.2.1.php +8 -0
- app/design/frontend/base/default/template/cardgate/cgp/email/sales/order_new.html +100 -0
- app/design/frontend/base/default/template/cardgate/cgp/email/sales/order_new_guest.html +99 -0
- app/locale/en_US/template/email/cgp/paymentlink.html +99 -0
- app/locale/en_US/template/email/cgp/paymentlink_guest.html +99 -0
- app/locale/nl_NL/Cardgate_Cgp.csv +18 -3
- app/locale/nl_NL/Cardgate_Cgp.csv.from_package +0 -96
- app/locale/nl_NL/template/email/cgp/paymentlink.html +100 -0
- app/locale/nl_NL/template/email/cgp/paymentlink_guest.html +100 -0
- package.xml +9 -5
app/code/local/Cardgate/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!*
|
app/code/local/Cardgate/Cgp/Block/Adminhtml/Paymentlink/Resend.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Cardgate_Cgp_Block_Adminhtml_Paymentlink_Resend extends Mage_Core_Block_Text
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* {@inheritDoc}
|
7 |
+
* @see Varien_Data_Form_Element_Renderer_Interface::render()
|
8 |
+
*/
|
9 |
+
public function __construct() {
|
10 |
+
/**
|
11 |
+
* @var Mage_Sales_Model_Order $order
|
12 |
+
*/
|
13 |
+
|
14 |
+
$order = Mage::getModel( 'sales/order' )->load( $this->getRequest()->get( 'orderid' ) );
|
15 |
+
if ( empty( $order ) ) {
|
16 |
+
$this->addText( Mage::helper('cgp')->__('Error loading order #%s'), $this->getRequest()->get( 'orderid' ) );
|
17 |
+
}
|
18 |
+
$payment = $order->getPayment();
|
19 |
+
if ( empty( $payment ) ) {
|
20 |
+
$this->addText( Mage::helper('cgp')->__('Error loading payment info for order #%s'), $this->getRequest()->get( 'orderid' ) );
|
21 |
+
}
|
22 |
+
try {
|
23 |
+
$title = $payment->getMethodInstance()->getTitle();
|
24 |
+
} catch ( Exception $e ) {
|
25 |
+
/* ignore */
|
26 |
+
}
|
27 |
+
if ( empty( $title ) ) {
|
28 |
+
$title = $payment->getMethod();
|
29 |
+
}
|
30 |
+
$cardgateMethod = ( substr($payment->getMethod(), 0, 3) == 'cgp' );
|
31 |
+
$this->addText( Mage::helper('cgp')->__('Send payment link for order #%s to email \'%s\'', $order->getId(), $order->getCustomerEmail() ));
|
32 |
+
if ( $cardgateMethod ) {
|
33 |
+
$this->addText( '<br/><br/>' );
|
34 |
+
$fixedText = Mage::helper('cgp')->__("Send direct payment link using method '%s'", $title);
|
35 |
+
$fixedUrl = Mage::helper('adminhtml')->getUrl('*/cardgate/resendpayment', array('orderid' => $order->getId()) );
|
36 |
+
$this->addText( '<button class="scalable" type="button" title="'.$fixedText.'" onclick="setLocation(\''.$fixedUrl.'\');">'.$fixedText.'</button>');
|
37 |
+
}
|
38 |
+
$flexText = Mage::helper('cgp')->__('Send direct payment link allowing all available paymentmethods');
|
39 |
+
$flexUrl = Mage::helper('adminhtml')->getUrl('*/cardgate/resendcheckout', array('orderid' => $order->getId()) );
|
40 |
+
$this->addText( '<br/><br/><button class="scalable" type="button" title="'.$flexText.'" onclick="setLocation(\''.$flexUrl.'\');">'.$flexText.'</button>' );
|
41 |
+
|
42 |
+
$this->addText( '<br/><br/>' . Mage::helper('cgp')->__('Please notice the order is already finalized and additional transactioncosts don\'t change when other paymentmethods are applied.') );
|
43 |
+
}
|
44 |
+
|
45 |
+
}
|
app/code/local/Cardgate/Cgp/Block/Info/Payment.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento CardGate payment extension
|
5 |
+
*
|
6 |
+
* @category Mage
|
7 |
+
* @package Cardgate_Cgp
|
8 |
+
*/
|
9 |
+
class Cardgate_Cgp_Block_Info_Payment extends Mage_Payment_Block_Info
|
10 |
+
{
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Retrieve order model object
|
14 |
+
*
|
15 |
+
* @return Mage_Sales_Model_Order
|
16 |
+
*/
|
17 |
+
public function getOrder()
|
18 |
+
{
|
19 |
+
return Mage::registry('sales_order');
|
20 |
+
}
|
21 |
+
|
22 |
+
protected function _toHtml() {
|
23 |
+
if ( false === $this->getIsSecureMode() ) {
|
24 |
+
$extraLinks = '';
|
25 |
+
if ( !empty( $this->getOrder() ) ) {
|
26 |
+
$order = $this->getOrder();
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @var Cardgate_Cgp_Model_Base $base
|
30 |
+
*/
|
31 |
+
$base = Mage::getSingleton( 'cgp/base' );
|
32 |
+
|
33 |
+
if ( $base->isRESTCapable() && intval( $order->getTotalPaid() ) == 0 ) {
|
34 |
+
$text = Mage::helper('cgp')->__('Send payment link');
|
35 |
+
$url = Mage::helper('adminhtml')->getUrl('*/cardgate/resend', array('orderid' => $order->getId()) );
|
36 |
+
$extraLinks.= '<button class="scalable" type="button" title="'.$text.'" onclick="setLocation(\''.$url.'\');">'.$text.'</button>';
|
37 |
+
} elseif ( intval( $order->getTotalPaid() ) > 0 ) {
|
38 |
+
if ( ! empty( $order->getPayment() ) ) {
|
39 |
+
$info = $order->getPayment()->getAdditionalInformation();
|
40 |
+
if ( !empty( $info['cardgate_transaction_id'])) {
|
41 |
+
$transactionid = $info['cardgate_transaction_id'];
|
42 |
+
$testmode = $info['cardgate_testmode'];
|
43 |
+
if ( $testmode ) {
|
44 |
+
$host = 'staging.curopayments.net';
|
45 |
+
} else {
|
46 |
+
$host = 'my.cardgate.com';
|
47 |
+
}
|
48 |
+
$text = Mage::helper('cgp')->__('CardGate transaction information %s', $transactionid);
|
49 |
+
$url = "https://".$host."/details/".$transactionid;
|
50 |
+
$extraLinks.= '<button class="scalable" type="button" title="'.$text.'" onclick="popWin(\''.$url.'\', \'Cgp_transaction_info\', \'resizable,scrollbars,status\');">'.$text.'</button>';
|
51 |
+
}
|
52 |
+
|
53 |
+
}
|
54 |
+
}
|
55 |
+
}
|
56 |
+
return ($extraLinks ? $extraLinks.'<br/>' : '') . parent::_toHtml();
|
57 |
+
} else {
|
58 |
+
return parent::_toHtml();
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
}
|
app/code/local/Cardgate/Cgp/Model/Base.php
CHANGED
@@ -26,7 +26,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
26 |
/**
|
27 |
* Retrieve config value
|
28 |
*
|
29 |
-
* @param string $field
|
30 |
* @return mixed
|
31 |
*/
|
32 |
public function getConfigData ( $field ) {
|
@@ -40,7 +40,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
40 |
/**
|
41 |
* Set callback data
|
42 |
*
|
43 |
-
* @param array $data
|
44 |
* @return Cardgate_Cgp_Model_Base
|
45 |
*/
|
46 |
public function setCallbackData ( $data ) {
|
@@ -51,7 +51,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
51 |
/**
|
52 |
* Get callback data
|
53 |
*
|
54 |
-
* @param string $field
|
55 |
* @return string
|
56 |
*/
|
57 |
public function getCallbackData ( $field = null ) {
|
@@ -71,6 +71,10 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
71 |
return $this->getConfigData( 'debug' );
|
72 |
}
|
73 |
|
|
|
|
|
|
|
|
|
74 |
/**
|
75 |
* If the test mode is enabled
|
76 |
*
|
@@ -83,7 +87,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
83 |
/**
|
84 |
* Log data into the logfile
|
85 |
*
|
86 |
-
* @param string $msg
|
87 |
* @return void
|
88 |
*/
|
89 |
public function log ( $msg ) {
|
@@ -102,14 +106,14 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
102 |
$varDir = Mage::getConfig()->getVarDir( 'locks' );
|
103 |
$lockFilename = $varDir . DS . 'cgp-' . $lockKey . '.lock';
|
104 |
$fp = @fopen( $lockFilename, 'x' );
|
105 |
-
|
106 |
if ( $fp ) {
|
107 |
$this->_isLocked = true;
|
108 |
$pid = getmypid();
|
109 |
$now = date( 'Y-m-d H:i:s' );
|
110 |
fwrite( $fp, "Locked by $pid at $now\n" );
|
111 |
}
|
112 |
-
|
113 |
return $this;
|
114 |
}
|
115 |
|
@@ -124,7 +128,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
124 |
$varDir = Mage::getConfig()->getVarDir( 'locks' );
|
125 |
$lockFilename = $varDir . DS . 'cgp-' . $lockKey . '.lock';
|
126 |
unlink( $lockFilename );
|
127 |
-
|
128 |
return $this;
|
129 |
}
|
130 |
|
@@ -132,7 +136,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
132 |
if ( $this->_isLocked ) {
|
133 |
return true;
|
134 |
}
|
135 |
-
|
136 |
$lockKey = ( $trxid != '' ? $trxid : $this->getCallbackData( 'ref' ) );
|
137 |
$varDir = Mage::getConfig()->getVarDir( 'locks' );
|
138 |
$lockFilename = $varDir . DS . 'cgp-' . $lockKey . '.lock';
|
@@ -142,7 +146,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
142 |
/**
|
143 |
* Create and mail invoice
|
144 |
*
|
145 |
-
* @param Mage_Sales_Model_Order $order
|
146 |
* @return boolean
|
147 |
*/
|
148 |
protected function createInvoice ( Mage_Sales_Model_Order $order ) {
|
@@ -152,75 +156,75 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
152 |
if ( $invoice->canCapture() ) {
|
153 |
$invoice->capture();
|
154 |
}
|
155 |
-
|
156 |
$invoice->save();
|
157 |
-
|
158 |
Mage::getModel( "core/resource_transaction" )->addObject( $invoice )
|
159 |
->addObject( $invoice->getOrder() )
|
160 |
->save();
|
161 |
-
|
162 |
$mail_invoice = $this->getConfigData( "mail_invoice" );
|
163 |
if ( $mail_invoice ) {
|
164 |
$invoice->setEmailSent( true );
|
165 |
$invoice->save();
|
166 |
$invoice->sendEmail();
|
167 |
}
|
168 |
-
|
169 |
$statusMessage = $mail_invoice ? "Invoice # %s created and send to customer." : "Invoice # %s created.";
|
170 |
$order->addStatusToHistory( $order->getStatus(), Mage::helper( "cgp" )->__( $statusMessage, $invoice->getIncrementId(), $mail_invoice ) );
|
171 |
-
|
172 |
return true;
|
173 |
}
|
174 |
-
|
175 |
return false;
|
176 |
}
|
177 |
|
178 |
/**
|
179 |
* Notify shop owners on failed invoicing creation
|
180 |
*
|
181 |
-
* @param Mage_Sales_Model_Order $order
|
182 |
* @return void
|
183 |
*/
|
184 |
protected function eventInvoicingFailed ( $order ) {
|
185 |
$storeId = $order->getStore()->getId();
|
186 |
-
|
187 |
$ident = Mage::getStoreConfig( 'cgp/settings/notification_email' );
|
188 |
$sender_email = Mage::getStoreConfig( 'trans_email/ident_general/email', $storeId );
|
189 |
$sender_name = Mage::getStoreConfig( 'trans_email/ident_general/name', $storeId );
|
190 |
$recipient_email = Mage::getStoreConfig( 'trans_email/ident_' . $ident . '/email', $storeId );
|
191 |
$recipient_name = Mage::getStoreConfig( 'trans_email/ident_' . $ident . '/name', $storeId );
|
192 |
-
|
193 |
$mail = new Zend_Mail();
|
194 |
$mail->setFrom( $sender_email, $sender_name );
|
195 |
$mail->addTo( $recipient_email, $recipient_name );
|
196 |
$mail->setSubject( Mage::helper( "cgp" )->__( 'Automatic invoice creation failed' ) );
|
197 |
-
$mail->setBodyText(
|
198 |
Mage::helper( "cgp" )->__( 'Magento was unable to create an invoice for Order # %s after a successful payment via CardGate (transaction # %s)', $order->getIncrementId(), $this->getCallbackData( 'transaction_id' ) ) );
|
199 |
-
$mail->setBodyHtml(
|
200 |
-
Mage::helper( "cgp" )->__( 'Magento was unable to create an invoice for <b>Order # %s</b> after a successful payment via CardGate <b>(transaction # %s)</b>', $order->getIncrementId(),
|
201 |
$this->getCallbackData( 'transaction_id' ) ) );
|
202 |
$mail->send();
|
203 |
}
|
204 |
|
205 |
protected function eventRefundFailed ( $order ) {
|
206 |
$storeId = $order->getStore()->getId();
|
207 |
-
|
208 |
$ident = Mage::getStoreConfig( 'cgp/settings/notification_email' );
|
209 |
$sender_email = Mage::getStoreConfig( 'trans_email/ident_general/email', $storeId );
|
210 |
$sender_name = Mage::getStoreConfig( 'trans_email/ident_general/name', $storeId );
|
211 |
$recipient_email = Mage::getStoreConfig( 'trans_email/ident_' . $ident . '/email', $storeId );
|
212 |
$recipient_name = Mage::getStoreConfig( 'trans_email/ident_' . $ident . '/name', $storeId );
|
213 |
-
|
214 |
$mail = new Zend_Mail();
|
215 |
$mail->setFrom( $sender_email, $sender_name );
|
216 |
$mail->addTo( $recipient_email, $recipient_name );
|
217 |
$mail->setSubject( Mage::helper( "cgp" )->__( 'CardGate refund failed' ) );
|
218 |
-
$mail->setBodyText(
|
219 |
-
Mage::helper( "cgp" )->__( 'CardGate was unable to succesfully complete a refund for Order # %s (transaction # %s). Please visit https://my.cardgate.com/ for more details.', $order->getIncrementId(),
|
220 |
$this->getCallbackData( 'transaction_id' ) ) );
|
221 |
-
$mail->setBodyHtml(
|
222 |
-
Mage::helper( "cgp" )->__(
|
223 |
-
"CardGate was unable to succesfully complete a refund for <b>Order # %s</b> <b>(transaction # %s)</b>. Please visit <a href='https://my.cardgate.com/'>https://my.cardgate.com/</a> for more details.",
|
224 |
$order->getIncrementId(), $this->getCallbackData( 'transaction_id' ) ) );
|
225 |
$mail->send();
|
226 |
}
|
@@ -228,13 +232,13 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
228 |
/**
|
229 |
* Returns true if the amounts match
|
230 |
*
|
231 |
-
* @param Mage_Sales_Model_Order $order
|
232 |
* @return boolean
|
233 |
*/
|
234 |
protected function validateAmount ( Mage_Sales_Model_Order $order ) {
|
235 |
$amountInCents = ( int ) sprintf( '%.0f', $order->getGrandTotal() * 100 );
|
236 |
$callbackAmount = ( int ) $this->getCallbackData( 'amount' );
|
237 |
-
|
238 |
if ( ( $amountInCents != $callbackAmount ) and ( abs( $callbackAmount - $amountInCents ) > 1 ) ) {
|
239 |
$this->log( 'OrderID: ' . $order->getId() . ' do not match amounts. Sent ' . $amountInCents . ', received: ' . $callbackAmount );
|
240 |
$statusMessage = Mage::helper( "cgp" )->__( "Hacker attempt: Order total amount does not match CardGate's gross total amount!" );
|
@@ -242,7 +246,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
242 |
$order->save();
|
243 |
return false;
|
244 |
}
|
245 |
-
|
246 |
return true;
|
247 |
}
|
248 |
|
@@ -254,11 +258,11 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
254 |
*/
|
255 |
$order = Mage::getModel( 'sales/order' );
|
256 |
$order->loadByIncrementId( $id );
|
257 |
-
|
258 |
// Log callback data
|
259 |
$this->log( 'Receiving refund-callback data:' );
|
260 |
$this->log( $this->getCallbackData() );
|
261 |
-
|
262 |
switch ( $this->getCallbackData( 'status_id' ) ) {
|
263 |
case "0":
|
264 |
$statusMessage = sprintf( Mage::helper( 'cgp' )->__( 'CardGate refund %s successfully authorised. Amount: %s' ), $this->getCallbackData( 'transaction_id' ), number_format( $this->getCallbackData( 'amount' ) / 100, 2 ) );
|
@@ -275,7 +279,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
275 |
$this->log( $msg );
|
276 |
die( $msg );
|
277 |
}
|
278 |
-
|
279 |
$order->addStatusHistoryComment( $statusMessage );
|
280 |
$order->save();
|
281 |
}
|
@@ -293,27 +297,29 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
293 |
*/
|
294 |
$order = Mage::getModel( 'sales/order' );
|
295 |
$order->loadByIncrementId( $id );
|
296 |
-
|
297 |
// Log callback data
|
298 |
$this->log( 'Receiving callback data:' );
|
299 |
$this->log( $this->getCallbackData() );
|
300 |
-
|
301 |
// Validate amount
|
302 |
if ( ! $this->validateAmount( $order ) ) {
|
303 |
$this->log( 'Amount validation failed!' );
|
304 |
exit();
|
305 |
}
|
306 |
-
|
307 |
$transactionid = $this->getCallbackData( 'transaction_id' );
|
308 |
-
|
|
|
309 |
$payment = $order->getPayment();
|
310 |
$payment->setTransactionId( $transactionid );
|
311 |
-
|
312 |
$info = $payment->getMethodInstance()->getInfoInstance();
|
313 |
$info->setAdditionalInformation( 'cardgate_transaction_id', $transactionid );
|
314 |
-
|
|
|
315 |
// $this->log( $payment->getData() );
|
316 |
-
|
317 |
$statusWaitconf = $this->getConfigData( "waitconf_status" );
|
318 |
$statusPending = $this->getConfigData( "pending_status" );
|
319 |
$statusComplete = $this->getConfigData( "complete_status" );
|
@@ -321,15 +327,15 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
321 |
$statusFraud = $this->getConfigData( "fraud_status" );
|
322 |
$autocreateInvoice = $this->getConfigData( "autocreate_invoice" );
|
323 |
$evInvoicingFailed = $this->getConfigData( "event_invoicing_failed" );
|
324 |
-
|
325 |
$complete = false;
|
326 |
$canceled = false;
|
327 |
$newState = null;
|
328 |
$newStatus = true;
|
329 |
$statusMessage = '';
|
330 |
-
|
331 |
$this->log( "Got: {$statusPending}/{$statusComplete}/{$statusFailed}/{$statusFraud}/{$autocreateInvoice}/{$evInvoicingFailed} : " . $this->getCallbackData( 'status_id' ) );
|
332 |
-
|
333 |
switch ( $this->getCallbackData( 'status_id' ) ) {
|
334 |
case "0":
|
335 |
$complete = false;
|
@@ -348,6 +354,9 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
348 |
$newState = Mage_Sales_Model_Order::STATE_PROCESSING;
|
349 |
$newStatus = $statusComplete;
|
350 |
$statusMessage = Mage::helper( 'cgp' )->__( 'Payment complete.' );
|
|
|
|
|
|
|
351 |
break;
|
352 |
case "300":
|
353 |
$canceled = true;
|
@@ -373,6 +382,12 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
373 |
$newStatus = $statusFailed;
|
374 |
$statusMessage = Mage::helper( 'cgp' )->__( 'Payment canceled by user.' );
|
375 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
case "700":
|
377 |
// Banktransfer pending status
|
378 |
$complete = false;
|
@@ -394,33 +409,47 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
394 |
$order->save();
|
395 |
break;
|
396 |
default:
|
397 |
-
|
398 |
-
|
399 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
400 |
}
|
401 |
-
|
402 |
// Additional logging for direct-debit
|
403 |
if ( $this->getCallbackData( 'recipient_name' ) && $this->getCallbackData( 'recipient_iban' ) && $this->getCallbackData( 'recipient_bic' ) && $this->getCallbackData( 'recipient_reference' ) ) {
|
404 |
$statusMessage .= "<br/>\n" . Mage::helper( 'cgp' )->__( 'Additional information' ) . " : " . "<br/>\n" . Mage::helper( 'cgp' )->__( 'Benificiary' ) . " : " . $this->getCallbackData( 'recipient_name' ) . "<br/>\n" .
|
405 |
Mage::helper( 'cgp' )->__( 'Benificiary IBAN' ) . " : " . $this->getCallbackData( 'recipient_iban' ) . "<br/>\n" . Mage::helper( 'cgp' )->__( 'Benificiary BIC' ) . " : " . $this->getCallbackData( 'recipient_bic' ) .
|
406 |
"<br/>\n" . Mage::helper( 'cgp' )->__( 'Reference' ) . " : " . $this->getCallbackData( 'recipient_reference' );
|
407 |
-
|
408 |
$info->setAdditionalInformation( 'recipient_name', $this->getCallbackData( 'recipient_name' ) );
|
409 |
$info->setAdditionalInformation( 'recipient_iban', $this->getCallbackData( 'recipient_iban' ) );
|
410 |
$info->setAdditionalInformation( 'recipient_bic', $this->getCallbackData( 'recipient_bic' ) );
|
411 |
$info->setAdditionalInformation( 'recipient_reference', $this->getCallbackData( 'recipient_reference' ) );
|
412 |
-
|
413 |
}
|
414 |
-
|
415 |
$info->save();
|
416 |
-
|
417 |
// Update only certain states
|
418 |
$canUpdate = false;
|
419 |
$undoCancel = false;
|
420 |
if ( $order->getState() == Mage_Sales_Model_Order::STATE_NEW || $order->getState() == Mage_Sales_Model_Order::STATE_PENDING_PAYMENT || $order->getState() == Mage_Sales_Model_Order::STATE_CANCELED ) {
|
421 |
$canUpdate = true;
|
422 |
}
|
423 |
-
|
424 |
foreach ( $order->getStatusHistoryCollection( true ) as $_item ) {
|
425 |
// Don't update order status if the payment is complete
|
426 |
if ( $_item->getStatusLabel() == ucfirst( $statusComplete ) ) {
|
@@ -430,7 +459,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
430 |
$undoCancel = true;
|
431 |
}
|
432 |
}
|
433 |
-
|
434 |
// Unclaim inventory if the payment failed
|
435 |
if ( $canUpdate && ! $complete && $canceled && $order->getStatus() != Mage_Sales_Model_Order::STATE_CANCELED ) {
|
436 |
$statusMessage .= "<br/>\n" . Mage::helper( 'cgp' )->__( "Unclaimed inventory because order changed to 'Canceled' state." );
|
@@ -441,7 +470,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
441 |
$stockItem->setData( 'product_id', $_item->getProductId() );
|
442 |
$stockItem->setData( 'stock_id', 1 );
|
443 |
}
|
444 |
-
|
445 |
$stockItem->setData( 'qty', $stockItem->getData( 'qty' ) + $_item->getQtyOrdered() );
|
446 |
// call save() method to save your product with updated data
|
447 |
try {
|
@@ -449,10 +478,10 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
449 |
} catch ( Exception $ex ) { }
|
450 |
}
|
451 |
}
|
452 |
-
|
453 |
// Lock
|
454 |
$this->lock();
|
455 |
-
|
456 |
// Uncancel order if necessary
|
457 |
if ( $undoCancel ) {
|
458 |
foreach ( $order->getAllItems() as $_item ) {
|
@@ -461,7 +490,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
461 |
if ( $_item->getQtyInvoiced() > 0 )
|
462 |
$_item->setQtyInvoiced( 0 )->save();
|
463 |
}
|
464 |
-
|
465 |
$order->setBaseDiscountCanceled( 0 )
|
466 |
->setBaseShippingCanceled( 0 )
|
467 |
->setBaseSubtotalCanceled( 0 )
|
@@ -473,10 +502,10 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
473 |
->setTaxCanceled( 0 )
|
474 |
->setTotalCanceled( 0 );
|
475 |
}
|
476 |
-
|
477 |
// Update the status if changed
|
478 |
if ( $canUpdate && ( ( $newState != $order->getState() ) || ( $newStatus != $order->getStatus() ) ) ) {
|
479 |
-
|
480 |
// Reclaim inventory
|
481 |
if ( $order->getState() == Mage_Sales_Model_Order::STATE_CANCELED && $newState == Mage_Sales_Model_Order::STATE_PROCESSING ) {
|
482 |
$statusMessage .= "<br/>\n" . Mage::helper( 'cgp' )->__( "Reclaimed inventory because order changed from 'Canceled' to 'Processing' state." );
|
@@ -492,7 +521,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
492 |
} catch ( Exception $ex ) {}
|
493 |
}
|
494 |
}
|
495 |
-
|
496 |
// Set order state and status
|
497 |
if ( $newState == $order->getState() ) {
|
498 |
$order->addStatusToHistory( $newStatus, $statusMessage );
|
@@ -500,7 +529,7 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
500 |
$order->setState( $newState, $newStatus, $statusMessage );
|
501 |
}
|
502 |
$this->log( "Changing state to '$newState' from '" . $order->getState() . "' with message '$statusMessage' for order ID: $id." );
|
503 |
-
|
504 |
// Create an invoice when the payment is completed
|
505 |
if ( $complete && ! $canceled && $autocreateInvoice ) {
|
506 |
$invoiceCreated = $this->createInvoice( $order );
|
@@ -509,23 +538,23 @@ class Cardgate_Cgp_Model_Base extends Varien_Object {
|
|
509 |
} else {
|
510 |
$this->log( "Unable to create invoice for order ID: $id." );
|
511 |
}
|
512 |
-
|
513 |
// Send notification
|
514 |
if ( ! $invoiceCreated && $evInvoicingFailed ) {
|
515 |
$this->eventInvoicingFailed( $order );
|
516 |
}
|
517 |
}
|
518 |
-
|
519 |
// Send new order e-mail
|
520 |
if ( $complete && ! $canceled && ! $order->getEmailSent() ) {
|
521 |
$order->sendNewOrderEmail();
|
522 |
$order->setEmailSent( true );
|
523 |
}
|
524 |
-
|
525 |
// Save order status changes
|
526 |
$order->save();
|
527 |
}
|
528 |
-
|
529 |
// Unlock
|
530 |
$this->unlock();
|
531 |
}
|
26 |
/**
|
27 |
* Retrieve config value
|
28 |
*
|
29 |
+
* @param string $field
|
30 |
* @return mixed
|
31 |
*/
|
32 |
public function getConfigData ( $field ) {
|
40 |
/**
|
41 |
* Set callback data
|
42 |
*
|
43 |
+
* @param array $data
|
44 |
* @return Cardgate_Cgp_Model_Base
|
45 |
*/
|
46 |
public function setCallbackData ( $data ) {
|
51 |
/**
|
52 |
* Get callback data
|
53 |
*
|
54 |
+
* @param string $field
|
55 |
* @return string
|
56 |
*/
|
57 |
public function getCallbackData ( $field = null ) {
|
71 |
return $this->getConfigData( 'debug' );
|
72 |
}
|
73 |
|
74 |
+
public function isRESTCapable() {
|
75 |
+
return ( $this->getConfigData( 'api_key' ) && $this->getConfigData( 'api_id' ) );
|
76 |
+
}
|
77 |
+
|
78 |
/**
|
79 |
* If the test mode is enabled
|
80 |
*
|
87 |
/**
|
88 |
* Log data into the logfile
|
89 |
*
|
90 |
+
* @param string $msg
|
91 |
* @return void
|
92 |
*/
|
93 |
public function log ( $msg ) {
|
106 |
$varDir = Mage::getConfig()->getVarDir( 'locks' );
|
107 |
$lockFilename = $varDir . DS . 'cgp-' . $lockKey . '.lock';
|
108 |
$fp = @fopen( $lockFilename, 'x' );
|
109 |
+
|
110 |
if ( $fp ) {
|
111 |
$this->_isLocked = true;
|
112 |
$pid = getmypid();
|
113 |
$now = date( 'Y-m-d H:i:s' );
|
114 |
fwrite( $fp, "Locked by $pid at $now\n" );
|
115 |
}
|
116 |
+
|
117 |
return $this;
|
118 |
}
|
119 |
|
128 |
$varDir = Mage::getConfig()->getVarDir( 'locks' );
|
129 |
$lockFilename = $varDir . DS . 'cgp-' . $lockKey . '.lock';
|
130 |
unlink( $lockFilename );
|
131 |
+
|
132 |
return $this;
|
133 |
}
|
134 |
|
136 |
if ( $this->_isLocked ) {
|
137 |
return true;
|
138 |
}
|
139 |
+
|
140 |
$lockKey = ( $trxid != '' ? $trxid : $this->getCallbackData( 'ref' ) );
|
141 |
$varDir = Mage::getConfig()->getVarDir( 'locks' );
|
142 |
$lockFilename = $varDir . DS . 'cgp-' . $lockKey . '.lock';
|
146 |
/**
|
147 |
* Create and mail invoice
|
148 |
*
|
149 |
+
* @param Mage_Sales_Model_Order $order
|
150 |
* @return boolean
|
151 |
*/
|
152 |
protected function createInvoice ( Mage_Sales_Model_Order $order ) {
|
156 |
if ( $invoice->canCapture() ) {
|
157 |
$invoice->capture();
|
158 |
}
|
159 |
+
|
160 |
$invoice->save();
|
161 |
+
|
162 |
Mage::getModel( "core/resource_transaction" )->addObject( $invoice )
|
163 |
->addObject( $invoice->getOrder() )
|
164 |
->save();
|
165 |
+
|
166 |
$mail_invoice = $this->getConfigData( "mail_invoice" );
|
167 |
if ( $mail_invoice ) {
|
168 |
$invoice->setEmailSent( true );
|
169 |
$invoice->save();
|
170 |
$invoice->sendEmail();
|
171 |
}
|
172 |
+
|
173 |
$statusMessage = $mail_invoice ? "Invoice # %s created and send to customer." : "Invoice # %s created.";
|
174 |
$order->addStatusToHistory( $order->getStatus(), Mage::helper( "cgp" )->__( $statusMessage, $invoice->getIncrementId(), $mail_invoice ) );
|
175 |
+
|
176 |
return true;
|
177 |
}
|
178 |
+
|
179 |
return false;
|
180 |
}
|
181 |
|
182 |
/**
|
183 |
* Notify shop owners on failed invoicing creation
|
184 |
*
|
185 |
+
* @param Mage_Sales_Model_Order $order
|
186 |
* @return void
|
187 |
*/
|
188 |
protected function eventInvoicingFailed ( $order ) {
|
189 |
$storeId = $order->getStore()->getId();
|
190 |
+
|
191 |
$ident = Mage::getStoreConfig( 'cgp/settings/notification_email' );
|
192 |
$sender_email = Mage::getStoreConfig( 'trans_email/ident_general/email', $storeId );
|
193 |
$sender_name = Mage::getStoreConfig( 'trans_email/ident_general/name', $storeId );
|
194 |
$recipient_email = Mage::getStoreConfig( 'trans_email/ident_' . $ident . '/email', $storeId );
|
195 |
$recipient_name = Mage::getStoreConfig( 'trans_email/ident_' . $ident . '/name', $storeId );
|
196 |
+
|
197 |
$mail = new Zend_Mail();
|
198 |
$mail->setFrom( $sender_email, $sender_name );
|
199 |
$mail->addTo( $recipient_email, $recipient_name );
|
200 |
$mail->setSubject( Mage::helper( "cgp" )->__( 'Automatic invoice creation failed' ) );
|
201 |
+
$mail->setBodyText(
|
202 |
Mage::helper( "cgp" )->__( 'Magento was unable to create an invoice for Order # %s after a successful payment via CardGate (transaction # %s)', $order->getIncrementId(), $this->getCallbackData( 'transaction_id' ) ) );
|
203 |
+
$mail->setBodyHtml(
|
204 |
+
Mage::helper( "cgp" )->__( 'Magento was unable to create an invoice for <b>Order # %s</b> after a successful payment via CardGate <b>(transaction # %s)</b>', $order->getIncrementId(),
|
205 |
$this->getCallbackData( 'transaction_id' ) ) );
|
206 |
$mail->send();
|
207 |
}
|
208 |
|
209 |
protected function eventRefundFailed ( $order ) {
|
210 |
$storeId = $order->getStore()->getId();
|
211 |
+
|
212 |
$ident = Mage::getStoreConfig( 'cgp/settings/notification_email' );
|
213 |
$sender_email = Mage::getStoreConfig( 'trans_email/ident_general/email', $storeId );
|
214 |
$sender_name = Mage::getStoreConfig( 'trans_email/ident_general/name', $storeId );
|
215 |
$recipient_email = Mage::getStoreConfig( 'trans_email/ident_' . $ident . '/email', $storeId );
|
216 |
$recipient_name = Mage::getStoreConfig( 'trans_email/ident_' . $ident . '/name', $storeId );
|
217 |
+
|
218 |
$mail = new Zend_Mail();
|
219 |
$mail->setFrom( $sender_email, $sender_name );
|
220 |
$mail->addTo( $recipient_email, $recipient_name );
|
221 |
$mail->setSubject( Mage::helper( "cgp" )->__( 'CardGate refund failed' ) );
|
222 |
+
$mail->setBodyText(
|
223 |
+
Mage::helper( "cgp" )->__( 'CardGate was unable to succesfully complete a refund for Order # %s (transaction # %s). Please visit https://my.cardgate.com/ for more details.', $order->getIncrementId(),
|
224 |
$this->getCallbackData( 'transaction_id' ) ) );
|
225 |
+
$mail->setBodyHtml(
|
226 |
+
Mage::helper( "cgp" )->__(
|
227 |
+
"CardGate was unable to succesfully complete a refund for <b>Order # %s</b> <b>(transaction # %s)</b>. Please visit <a href='https://my.cardgate.com/'>https://my.cardgate.com/</a> for more details.",
|
228 |
$order->getIncrementId(), $this->getCallbackData( 'transaction_id' ) ) );
|
229 |
$mail->send();
|
230 |
}
|
232 |
/**
|
233 |
* Returns true if the amounts match
|
234 |
*
|
235 |
+
* @param Mage_Sales_Model_Order $order
|
236 |
* @return boolean
|
237 |
*/
|
238 |
protected function validateAmount ( Mage_Sales_Model_Order $order ) {
|
239 |
$amountInCents = ( int ) sprintf( '%.0f', $order->getGrandTotal() * 100 );
|
240 |
$callbackAmount = ( int ) $this->getCallbackData( 'amount' );
|
241 |
+
|
242 |
if ( ( $amountInCents != $callbackAmount ) and ( abs( $callbackAmount - $amountInCents ) > 1 ) ) {
|
243 |
$this->log( 'OrderID: ' . $order->getId() . ' do not match amounts. Sent ' . $amountInCents . ', received: ' . $callbackAmount );
|
244 |
$statusMessage = Mage::helper( "cgp" )->__( "Hacker attempt: Order total amount does not match CardGate's gross total amount!" );
|
246 |
$order->save();
|
247 |
return false;
|
248 |
}
|
249 |
+
|
250 |
return true;
|
251 |
}
|
252 |
|
258 |
*/
|
259 |
$order = Mage::getModel( 'sales/order' );
|
260 |
$order->loadByIncrementId( $id );
|
261 |
+
|
262 |
// Log callback data
|
263 |
$this->log( 'Receiving refund-callback data:' );
|
264 |
$this->log( $this->getCallbackData() );
|
265 |
+
|
266 |
switch ( $this->getCallbackData( 'status_id' ) ) {
|
267 |
case "0":
|
268 |
$statusMessage = sprintf( Mage::helper( 'cgp' )->__( 'CardGate refund %s successfully authorised. Amount: %s' ), $this->getCallbackData( 'transaction_id' ), number_format( $this->getCallbackData( 'amount' ) / 100, 2 ) );
|
279 |
$this->log( $msg );
|
280 |
die( $msg );
|
281 |
}
|
282 |
+
|
283 |
$order->addStatusHistoryComment( $statusMessage );
|
284 |
$order->save();
|
285 |
}
|
297 |
*/
|
298 |
$order = Mage::getModel( 'sales/order' );
|
299 |
$order->loadByIncrementId( $id );
|
300 |
+
|
301 |
// Log callback data
|
302 |
$this->log( 'Receiving callback data:' );
|
303 |
$this->log( $this->getCallbackData() );
|
304 |
+
|
305 |
// Validate amount
|
306 |
if ( ! $this->validateAmount( $order ) ) {
|
307 |
$this->log( 'Amount validation failed!' );
|
308 |
exit();
|
309 |
}
|
310 |
+
|
311 |
$transactionid = $this->getCallbackData( 'transaction_id' );
|
312 |
+
$testmode = $this->getCallbackData( 'testmode' ) || $this->getCallbackData( 'is_test' );
|
313 |
+
|
314 |
$payment = $order->getPayment();
|
315 |
$payment->setTransactionId( $transactionid );
|
316 |
+
|
317 |
$info = $payment->getMethodInstance()->getInfoInstance();
|
318 |
$info->setAdditionalInformation( 'cardgate_transaction_id', $transactionid );
|
319 |
+
$info->setAdditionalInformation( 'cardgate_testmode', $testmode );
|
320 |
+
|
321 |
// $this->log( $payment->getData() );
|
322 |
+
|
323 |
$statusWaitconf = $this->getConfigData( "waitconf_status" );
|
324 |
$statusPending = $this->getConfigData( "pending_status" );
|
325 |
$statusComplete = $this->getConfigData( "complete_status" );
|
327 |
$statusFraud = $this->getConfigData( "fraud_status" );
|
328 |
$autocreateInvoice = $this->getConfigData( "autocreate_invoice" );
|
329 |
$evInvoicingFailed = $this->getConfigData( "event_invoicing_failed" );
|
330 |
+
|
331 |
$complete = false;
|
332 |
$canceled = false;
|
333 |
$newState = null;
|
334 |
$newStatus = true;
|
335 |
$statusMessage = '';
|
336 |
+
|
337 |
$this->log( "Got: {$statusPending}/{$statusComplete}/{$statusFailed}/{$statusFraud}/{$autocreateInvoice}/{$evInvoicingFailed} : " . $this->getCallbackData( 'status_id' ) );
|
338 |
+
|
339 |
switch ( $this->getCallbackData( 'status_id' ) ) {
|
340 |
case "0":
|
341 |
$complete = false;
|
354 |
$newState = Mage_Sales_Model_Order::STATE_PROCESSING;
|
355 |
$newStatus = $statusComplete;
|
356 |
$statusMessage = Mage::helper( 'cgp' )->__( 'Payment complete.' );
|
357 |
+
if ( $testmode ) {
|
358 |
+
$statusMessage.= " <b>CALLBACK RECEIVED IN TESTMODE!</b>";
|
359 |
+
}
|
360 |
break;
|
361 |
case "300":
|
362 |
$canceled = true;
|
382 |
$newStatus = $statusFailed;
|
383 |
$statusMessage = Mage::helper( 'cgp' )->__( 'Payment canceled by user.' );
|
384 |
break;
|
385 |
+
case "352":
|
386 |
+
$canceled = true;
|
387 |
+
$newState = Mage_Sales_Model_Order::STATE_CANCELED;
|
388 |
+
$newStatus = $statusFailed;
|
389 |
+
$statusMessage = Mage::helper( 'cgp' )->__( 'Transaction failed 3DS verification.' );
|
390 |
+
break;
|
391 |
case "700":
|
392 |
// Banktransfer pending status
|
393 |
$complete = false;
|
409 |
$order->save();
|
410 |
break;
|
411 |
default:
|
412 |
+
switch( $this->getCallbackData( 'status' ) ) {
|
413 |
+
case "300":
|
414 |
+
$canceled = true;
|
415 |
+
$newState = Mage_Sales_Model_Order::STATE_CANCELED;
|
416 |
+
$newStatus = $statusFailed;
|
417 |
+
$statusMessage = Mage::helper( 'cgp' )->__( 'Payment failed.' );
|
418 |
+
break;
|
419 |
+
default:
|
420 |
+
$msg = 'Status not recognised: ' . $this->getCallbackData( 'status' );
|
421 |
+
$this->log( $msg );
|
422 |
+
die( $msg );
|
423 |
+
break;
|
424 |
+
}
|
425 |
+
}
|
426 |
+
|
427 |
+
if ( $this->getCallbackData( 'billing_option' ) ) {
|
428 |
+
$statusMessage.= " (" . $this->getCallbackData( 'billing_option' ) . ")";
|
429 |
}
|
430 |
+
|
431 |
// Additional logging for direct-debit
|
432 |
if ( $this->getCallbackData( 'recipient_name' ) && $this->getCallbackData( 'recipient_iban' ) && $this->getCallbackData( 'recipient_bic' ) && $this->getCallbackData( 'recipient_reference' ) ) {
|
433 |
$statusMessage .= "<br/>\n" . Mage::helper( 'cgp' )->__( 'Additional information' ) . " : " . "<br/>\n" . Mage::helper( 'cgp' )->__( 'Benificiary' ) . " : " . $this->getCallbackData( 'recipient_name' ) . "<br/>\n" .
|
434 |
Mage::helper( 'cgp' )->__( 'Benificiary IBAN' ) . " : " . $this->getCallbackData( 'recipient_iban' ) . "<br/>\n" . Mage::helper( 'cgp' )->__( 'Benificiary BIC' ) . " : " . $this->getCallbackData( 'recipient_bic' ) .
|
435 |
"<br/>\n" . Mage::helper( 'cgp' )->__( 'Reference' ) . " : " . $this->getCallbackData( 'recipient_reference' );
|
436 |
+
|
437 |
$info->setAdditionalInformation( 'recipient_name', $this->getCallbackData( 'recipient_name' ) );
|
438 |
$info->setAdditionalInformation( 'recipient_iban', $this->getCallbackData( 'recipient_iban' ) );
|
439 |
$info->setAdditionalInformation( 'recipient_bic', $this->getCallbackData( 'recipient_bic' ) );
|
440 |
$info->setAdditionalInformation( 'recipient_reference', $this->getCallbackData( 'recipient_reference' ) );
|
441 |
+
|
442 |
}
|
443 |
+
|
444 |
$info->save();
|
445 |
+
|
446 |
// Update only certain states
|
447 |
$canUpdate = false;
|
448 |
$undoCancel = false;
|
449 |
if ( $order->getState() == Mage_Sales_Model_Order::STATE_NEW || $order->getState() == Mage_Sales_Model_Order::STATE_PENDING_PAYMENT || $order->getState() == Mage_Sales_Model_Order::STATE_CANCELED ) {
|
450 |
$canUpdate = true;
|
451 |
}
|
452 |
+
|
453 |
foreach ( $order->getStatusHistoryCollection( true ) as $_item ) {
|
454 |
// Don't update order status if the payment is complete
|
455 |
if ( $_item->getStatusLabel() == ucfirst( $statusComplete ) ) {
|
459 |
$undoCancel = true;
|
460 |
}
|
461 |
}
|
462 |
+
|
463 |
// Unclaim inventory if the payment failed
|
464 |
if ( $canUpdate && ! $complete && $canceled && $order->getStatus() != Mage_Sales_Model_Order::STATE_CANCELED ) {
|
465 |
$statusMessage .= "<br/>\n" . Mage::helper( 'cgp' )->__( "Unclaimed inventory because order changed to 'Canceled' state." );
|
470 |
$stockItem->setData( 'product_id', $_item->getProductId() );
|
471 |
$stockItem->setData( 'stock_id', 1 );
|
472 |
}
|
473 |
+
|
474 |
$stockItem->setData( 'qty', $stockItem->getData( 'qty' ) + $_item->getQtyOrdered() );
|
475 |
// call save() method to save your product with updated data
|
476 |
try {
|
478 |
} catch ( Exception $ex ) { }
|
479 |
}
|
480 |
}
|
481 |
+
|
482 |
// Lock
|
483 |
$this->lock();
|
484 |
+
|
485 |
// Uncancel order if necessary
|
486 |
if ( $undoCancel ) {
|
487 |
foreach ( $order->getAllItems() as $_item ) {
|
490 |
if ( $_item->getQtyInvoiced() > 0 )
|
491 |
$_item->setQtyInvoiced( 0 )->save();
|
492 |
}
|
493 |
+
|
494 |
$order->setBaseDiscountCanceled( 0 )
|
495 |
->setBaseShippingCanceled( 0 )
|
496 |
->setBaseSubtotalCanceled( 0 )
|
502 |
->setTaxCanceled( 0 )
|
503 |
->setTotalCanceled( 0 );
|
504 |
}
|
505 |
+
|
506 |
// Update the status if changed
|
507 |
if ( $canUpdate && ( ( $newState != $order->getState() ) || ( $newStatus != $order->getStatus() ) ) ) {
|
508 |
+
|
509 |
// Reclaim inventory
|
510 |
if ( $order->getState() == Mage_Sales_Model_Order::STATE_CANCELED && $newState == Mage_Sales_Model_Order::STATE_PROCESSING ) {
|
511 |
$statusMessage .= "<br/>\n" . Mage::helper( 'cgp' )->__( "Reclaimed inventory because order changed from 'Canceled' to 'Processing' state." );
|
521 |
} catch ( Exception $ex ) {}
|
522 |
}
|
523 |
}
|
524 |
+
|
525 |
// Set order state and status
|
526 |
if ( $newState == $order->getState() ) {
|
527 |
$order->addStatusToHistory( $newStatus, $statusMessage );
|
529 |
$order->setState( $newState, $newStatus, $statusMessage );
|
530 |
}
|
531 |
$this->log( "Changing state to '$newState' from '" . $order->getState() . "' with message '$statusMessage' for order ID: $id." );
|
532 |
+
|
533 |
// Create an invoice when the payment is completed
|
534 |
if ( $complete && ! $canceled && $autocreateInvoice ) {
|
535 |
$invoiceCreated = $this->createInvoice( $order );
|
538 |
} else {
|
539 |
$this->log( "Unable to create invoice for order ID: $id." );
|
540 |
}
|
541 |
+
|
542 |
// Send notification
|
543 |
if ( ! $invoiceCreated && $evInvoicingFailed ) {
|
544 |
$this->eventInvoicingFailed( $order );
|
545 |
}
|
546 |
}
|
547 |
+
|
548 |
// Send new order e-mail
|
549 |
if ( $complete && ! $canceled && ! $order->getEmailSent() ) {
|
550 |
$order->sendNewOrderEmail();
|
551 |
$order->setEmailSent( true );
|
552 |
}
|
553 |
+
|
554 |
// Save order status changes
|
555 |
$order->save();
|
556 |
}
|
557 |
+
|
558 |
// Unlock
|
559 |
$this->unlock();
|
560 |
}
|
app/code/local/Cardgate/Cgp/Model/Gateway/Abstract.php
CHANGED
@@ -121,18 +121,22 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
121 |
|
122 |
protected $_canCapturePartial = true;
|
123 |
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
|
|
|
|
|
|
|
|
136 |
/**
|
137 |
* Return Gateway Url
|
138 |
*
|
@@ -203,7 +207,7 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
203 |
/**
|
204 |
* Magento tries to set the order from payment/, instead of cgp/
|
205 |
*
|
206 |
-
* @param Mage_Sales_Model_Order $order
|
207 |
* @return void
|
208 |
*/
|
209 |
public function setSortOrder ( $order ) {
|
@@ -213,7 +217,7 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
213 |
/**
|
214 |
* Append the current model to the URL
|
215 |
*
|
216 |
-
* @param string $url
|
217 |
* @return string
|
218 |
*/
|
219 |
function getModelUrl ( $url ) {
|
@@ -238,15 +242,15 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
238 |
/**
|
239 |
* Retrieve config value for store by path
|
240 |
*
|
241 |
-
* @param string $path
|
242 |
-
* @param mixed $store
|
243 |
* @return mixed
|
244 |
*/
|
245 |
public function getConfigData ( $field, $storeId = null ) {
|
246 |
if ( $storeId === null ) {
|
247 |
$storeId = $this->getStore();
|
248 |
}
|
249 |
-
|
250 |
$configSettings = Mage::getStoreConfig( $this->_module . '/settings', $storeId );
|
251 |
if ( ! is_array( $configSettings ) )
|
252 |
$configSettings = array();
|
@@ -254,7 +258,7 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
254 |
if ( ! is_array( $configGateway ) )
|
255 |
$configGateway = array();
|
256 |
$config = array_merge( $configSettings, $configGateway );
|
257 |
-
|
258 |
return @$config[$field];
|
259 |
}
|
260 |
|
@@ -266,7 +270,7 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
266 |
public function validate () {
|
267 |
parent::validate();
|
268 |
$base = Mage::getSingleton( 'cgp/base' );
|
269 |
-
|
270 |
$currency_code = $this->getQuote()->getBaseCurrencyCode();
|
271 |
if ( empty( $currency_code ) ) {
|
272 |
$currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
|
@@ -275,14 +279,14 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
275 |
$base->log( 'Unacceptable currency code (' . $currency_code . ').' );
|
276 |
Mage::throwException( Mage::helper( 'cgp' )->__( 'Selected currency code "%s" is not compatible with CardGate', $currency_code ) );
|
277 |
}
|
278 |
-
|
279 |
return $this;
|
280 |
}
|
281 |
|
282 |
/**
|
283 |
* Change order status
|
284 |
*
|
285 |
-
* @param Mage_Sales_Model_Order $order
|
286 |
* @return void
|
287 |
*/
|
288 |
protected function initiateTransactionStatus ( $order ) {
|
@@ -303,23 +307,40 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
303 |
* @return array
|
304 |
*/
|
305 |
public function getCheckoutFormFields () {
|
306 |
-
$base = Mage::getSingleton( 'cgp/base' );
|
307 |
$extra_data = $_SESSION['cgp_formdata']['payment']['cgp'];
|
308 |
-
|
309 |
$order = $this->getOrder();
|
310 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
if ( ! $this->getConfigData( 'orderemail_at_payment' ) ) {
|
312 |
$order->sendNewOrderEmail();
|
313 |
$order->setEmailSent( true );
|
314 |
}
|
315 |
$customer = $order->getBillingAddress();
|
316 |
$ship_customer = $order->getShippingAddress();
|
317 |
-
|
318 |
$s_arr = array();
|
319 |
$s_arr['language'] = $this->getConfigData( 'lang' );
|
320 |
-
|
321 |
$cartitems = array();
|
322 |
-
|
323 |
foreach ( $order->getAllItems() as $itemId => $item ) {
|
324 |
if ( $item->getQtyToInvoice() > 0 ) {
|
325 |
$aAdditionalCartData = array();
|
@@ -339,12 +360,12 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
339 |
), $aAdditionalCartData );
|
340 |
}
|
341 |
}
|
342 |
-
|
343 |
if ( $order->getDiscountAmount() < 0 ) {
|
344 |
$amount = $order->getDiscountAmount();
|
345 |
$applyAfter = Mage::helper( 'tax' )->applyTaxAfterDiscount( $order->getStoreId() );
|
346 |
$priceIncludesTax = Mage::helper( 'tax' )->priceIncludesTax( $order->getStoreId() );
|
347 |
-
|
348 |
if ( $applyAfter == true && $priceIncludesTax == false ) {
|
349 |
// With this setting active the discount will not have the
|
350 |
// correct value.
|
@@ -365,7 +386,7 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
365 |
$amount -= $newAmount;
|
366 |
}
|
367 |
}
|
368 |
-
|
369 |
$cartitems[] = array(
|
370 |
'quantity' => '1',
|
371 |
'sku' => 'cg-discount',
|
@@ -377,12 +398,11 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
377 |
'type' => 4
|
378 |
);
|
379 |
}
|
380 |
-
|
381 |
$tax_info = $order->getFullTaxInfo();
|
382 |
-
|
383 |
// add shipping
|
384 |
if ( $order->getShippingAmount() > 0 ) {
|
385 |
-
|
386 |
$flags = 8;
|
387 |
if ( ! isset( $tax_info[0]['percent'] ) ) {
|
388 |
$tax_rate = 0;
|
@@ -402,10 +422,10 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
402 |
'type' => 2
|
403 |
);
|
404 |
}
|
405 |
-
|
406 |
// add invoice fee
|
407 |
if ( $order->getPayment()->getAdditionalInformation( 'invoice_fee' ) > 0 ) {
|
408 |
-
|
409 |
$tax_rate = $order->getPayment()->getAdditionalInformation( 'invoice_fee_rate' );
|
410 |
$cartitems[] = array(
|
411 |
'quantity' => '1',
|
@@ -418,7 +438,7 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
418 |
'type' => 5
|
419 |
);
|
420 |
}
|
421 |
-
|
422 |
// add Magestore affiliateplus discount
|
423 |
if ( ! is_null( $order->getAffiliateplusDiscount() ) && $order->getAffiliateplusDiscount() != 0 ) {
|
424 |
$cartitems[] = array(
|
@@ -432,7 +452,7 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
432 |
'type' => 4
|
433 |
);
|
434 |
}
|
435 |
-
|
436 |
// add ET Payment Extra Charge
|
437 |
if ( ! is_null( $order->getEtPaymentExtraCharge() ) && $order->getEtPaymentExtraCharge() != 0 ) {
|
438 |
$cartitems[] = array(
|
@@ -446,13 +466,27 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
446 |
'type' => 5
|
447 |
);
|
448 |
}
|
449 |
-
|
450 |
// failsafe
|
451 |
$cartpricetotal = $cartvattotal = 0;
|
452 |
foreach ( $cartitems as $cartitem ) {
|
453 |
$cartpricetotal += ceil( ( $cartitem['price'] * $cartitem['quantity'] ) * 100 );
|
454 |
$cartvattotal += ceil( ( $cartitem['vat_amount'] * $cartitem['quantity'] ) * 100 );
|
455 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
456 |
if ( $cartpricetotal != ceil( $order->getGrandTotal() * 100 )) {
|
457 |
$iCorrectionAmount = ( ceil( $order->getGrandTotal() * 100 ) / 100 ) - ( $cartpricetotal / 100 );
|
458 |
$cartitems[] = array(
|
@@ -466,19 +500,9 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
466 |
'type' => ( $iCorrectionAmount > 0 ) ? 1 : 4
|
467 |
);
|
468 |
}
|
469 |
-
|
470 |
-
$cartitems[] = array(
|
471 |
-
'quantity' => '1',
|
472 |
-
'sku' => 'cg-vatcorrection',
|
473 |
-
'name' => 'VAT Correction',
|
474 |
-
'vat_amount' => sprintf( '%01.2f', ( ceil( $order->getTaxAmount() * 100 ) / 100 ) - ( $cartvattotal / 100 ) ),
|
475 |
-
'vat_inc' => 1,
|
476 |
-
'type' => 7
|
477 |
-
);
|
478 |
-
}
|
479 |
-
|
480 |
$s_arr['cartitems'] = serialize( $cartitems );
|
481 |
-
|
482 |
switch ( $this->_model ) {
|
483 |
// CreditCards
|
484 |
case 'visa':
|
@@ -490,38 +514,38 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
490 |
case 'vpay':
|
491 |
$s_arr['option'] = 'creditcard';
|
492 |
break;
|
493 |
-
|
494 |
// DIRECTebanking, Sofortbanking
|
495 |
case 'sofortbanking':
|
496 |
$s_arr['option'] = 'directebanking';
|
497 |
break;
|
498 |
-
|
499 |
// iDEAL
|
500 |
case 'ideal':
|
501 |
$s_arr['option'] = 'ideal';
|
502 |
$s_arr['suboption'] = $extra_data['ideal_issuer_id'];
|
503 |
break;
|
504 |
-
|
505 |
-
// Giropay
|
506 |
-
case 'giropay':
|
507 |
-
$s_arr['option'] = 'giropay';
|
508 |
-
break;
|
509 |
-
|
510 |
// Mister Cash
|
511 |
case 'mistercash':
|
512 |
$s_arr['option'] = 'bancontact';
|
513 |
break;
|
514 |
-
|
|
|
|
|
|
|
|
|
|
|
515 |
// PayPal
|
516 |
case 'paypal':
|
517 |
$s_arr['option'] = 'paypal';
|
518 |
break;
|
519 |
-
|
520 |
// Webmoney
|
521 |
case 'webmoney':
|
522 |
$s_arr['option'] = 'webmoney';
|
523 |
-
break
|
524 |
-
|
525 |
// Klarna
|
526 |
case 'klarna':
|
527 |
$s_arr['option'] = 'klarna';
|
@@ -533,13 +557,13 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
533 |
}
|
534 |
$s_arr['language'] = $extra_data['klarna-language'];
|
535 |
$s_arr['account'] = 0;
|
536 |
-
|
537 |
break;
|
538 |
-
|
539 |
// Klarna
|
540 |
case 'klarnaaccount':
|
541 |
$s_arr['option'] = 'klarna';
|
542 |
-
|
543 |
if ( isset( $extra_data['klarna-account-personal-number'] ) ) {
|
544 |
$s_arr['dob'] = $extra_data['klarna-account-personal-number'];
|
545 |
} else {
|
@@ -548,47 +572,57 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
548 |
}
|
549 |
$s_arr['language'] = $extra_data['klarna-account-language'];
|
550 |
$s_arr['account'] = 1;
|
551 |
-
|
552 |
break;
|
553 |
-
|
554 |
-
|
555 |
case 'banktransfer':
|
556 |
$s_arr['option'] = 'banktransfer';
|
557 |
break;
|
558 |
-
|
559 |
// Directdebit
|
560 |
case 'directdebit':
|
561 |
$s_arr['option'] = 'directdebit';
|
562 |
break;
|
563 |
-
|
564 |
// Przelewy24
|
565 |
case 'przelewy24':
|
566 |
$s_arr['option'] = 'przelewy24';
|
567 |
break;
|
568 |
-
|
569 |
// Afterpay
|
570 |
case 'afterpay':
|
571 |
$s_arr['option'] = 'afterpay';
|
572 |
break;
|
573 |
-
|
574 |
// Bitcoin
|
575 |
case 'bitcoin':
|
576 |
$s_arr['option'] = 'bitcoin';
|
577 |
break;
|
578 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
579 |
// Default
|
580 |
default:
|
581 |
-
$s_arr['option'] =
|
582 |
$s_arr['suboption'] = '';
|
583 |
break;
|
584 |
}
|
585 |
-
|
586 |
// Add new state
|
587 |
$this->initiateTransactionStatus( $order );
|
588 |
-
|
589 |
$s_arr['siteid'] = $this->getConfigData( 'site_id' );
|
590 |
$s_arr['ref'] = $order->getIncrementId();
|
591 |
-
|
592 |
$s_arr['first_name'] = $customer->getFirstname();
|
593 |
$s_arr['last_name'] = $customer->getLastname();
|
594 |
$s_arr['company_name'] = $customer->getCompany();
|
@@ -599,7 +633,7 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
599 |
$s_arr['postal_code'] = $customer->getPostcode();
|
600 |
$s_arr['phone_number'] = $customer->getTelephone();
|
601 |
$s_arr['state'] = $customer->getRegionCode();
|
602 |
-
|
603 |
// CURO protocol... because..
|
604 |
$s_arr['shipto_firstname'] = $ship_customer->getFirstname();
|
605 |
$s_arr['shipto_lastname'] = $ship_customer->getLastname();
|
@@ -611,7 +645,7 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
611 |
$s_arr['shipto_zipcode'] = $ship_customer->getPostcode();
|
612 |
$s_arr['shipto_phone'] = $ship_customer->getTelephone();
|
613 |
$s_arr['shipto_state'] = $ship_customer->getRegionCode();
|
614 |
-
|
615 |
if ( $this->getConfigData( 'use_backoffice_urls' ) == false ) {
|
616 |
$s_arr['return_url'] = Mage::getUrl( 'cgp/standard/success/', array(
|
617 |
'_secure' => true
|
@@ -620,30 +654,30 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
620 |
'_secure' => true
|
621 |
) );
|
622 |
}
|
623 |
-
|
624 |
$s_arr['shop_version'] = 'Magento ' . Mage::getVersion();
|
625 |
$s_arr['plugin_name'] = 'Cardgate_Cgp';
|
626 |
$s_arr['plugin_version'] = $this->getPluginVersion();
|
627 |
-
$s_arr['extra'] = $
|
628 |
-
|
629 |
if ( $base->isTest() ) {
|
630 |
-
|
631 |
$hash_prefix = 'TEST';
|
632 |
} else {
|
633 |
$hash_prefix = '';
|
634 |
}
|
635 |
-
|
636 |
$s_arr['amount'] = sprintf( '%.0f', ceil( $order->getGrandTotal() * 100 ) );
|
637 |
$s_arr['currency'] = $order->getOrderCurrencyCode();
|
638 |
$s_arr['description'] = str_replace( '%id%', $order->getIncrementId(), $this->getConfigData( 'order_description' ) );
|
639 |
$s_arr['hash'] = md5( $hash_prefix . $this->getConfigData( 'site_id' ) . $s_arr['amount'] . $s_arr['ref'] . $this->getConfigData( 'hash_key' ) );
|
640 |
-
|
641 |
// Logging
|
642 |
$base->log( 'Initiating a new transaction' );
|
643 |
$base->log( 'Sending customer to Card Gate Plus with values:' );
|
644 |
$base->log( 'URL = ' . $this->getGatewayUrl() );
|
645 |
$base->log( $s_arr );
|
646 |
-
|
647 |
$locale = Mage::app()->getLocale()->getLocaleCode();
|
648 |
return $s_arr;
|
649 |
}
|
@@ -656,8 +690,8 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
656 |
* Do RESTful API call
|
657 |
* @param string $entrypoint
|
658 |
* @param string $calldata
|
659 |
-
|
660 |
-
|
661 |
*/
|
662 |
public function doApiCall( $entrypoint, $calldata = array() ) {
|
663 |
$config = array(
|
@@ -665,19 +699,19 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
665 |
'timeout' => 30,
|
666 |
'verifypeer' => 0
|
667 |
);
|
668 |
-
|
669 |
$data = array();
|
670 |
$data['shop_version'] = 'Magento ' . Mage::getVersion();
|
671 |
$data['plugin_name'] = 'Cardgate_Cgp';
|
672 |
$data['plugin_version'] = $this->getPluginVersion();
|
673 |
$data = array_merge( $data, $calldata );
|
674 |
-
|
675 |
$APIid = $this->getConfigData( 'api_id' );
|
676 |
$APIkey = $this->getConfigData( 'api_key' );
|
677 |
$headers = array(
|
678 |
'Accept: application/json'
|
679 |
);
|
680 |
-
|
681 |
$client = new Varien_Http_Client();
|
682 |
$client->setUri( $this->getAPIUrl() . $entrypoint )
|
683 |
->setAuth( $APIid, $APIkey, Varien_Http_Client::AUTH_BASIC )
|
@@ -691,21 +725,44 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
691 |
$result = json_decode( $responsebody, true );
|
692 |
return array( 'code'=>$responsecode, 'result'=>$result, 'body'=>$responsebody );
|
693 |
}
|
694 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
695 |
/**
|
696 |
* Refund a capture transaction
|
697 |
*
|
698 |
-
* @param Mage_Sales_Model_Order_Payment $payment
|
699 |
-
* @param float $amount
|
700 |
*/
|
701 |
public function refund ( Varien_Object $payment, $amount ) {
|
702 |
-
|
703 |
/**
|
704 |
*
|
705 |
* @var Cardgate_Cgp_Model_Base $base
|
706 |
*/
|
707 |
$base = Mage::getModel( 'cgp/base' );
|
708 |
-
|
709 |
$trxid = $this->_getParentTransactionId( $payment );
|
710 |
$base->log( "CG REFUND " . $trxid . " -- " . $amount );
|
711 |
if ( $trxid ) {
|
@@ -713,38 +770,38 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
713 |
$base->log( "Transaction {$trxid} is locked, can't refund now. Aborting." );
|
714 |
Mage::throwException( "Transaction {$trxid} is locked, can't refund now. Aborting." );
|
715 |
}
|
716 |
-
|
717 |
/**
|
718 |
*
|
719 |
* @var Mage_Sales_Model_Order $order
|
720 |
*/
|
721 |
$order = $payment->getOrder();
|
722 |
$currencycode = $order->getOrderCurrencyCode();
|
723 |
-
|
724 |
if ( ! in_array( $currencycode, $this->_supportedCurrencies ) ) {
|
725 |
$base->log( 'Unacceptable currency code (' . $currencycode . ').' );
|
726 |
Mage::throwException( Mage::helper( 'cgp' )->__( 'Selected currency code "%s" is not compatible with CardGate', $currencycode ) );
|
727 |
}
|
728 |
-
|
729 |
$apiresult = array();
|
730 |
try {
|
731 |
-
$apiresult = $this->doApiCall('refund', array(
|
732 |
'refund' => array(
|
733 |
'site_id' => $this->getConfigData( 'site_id' ),
|
734 |
'transaction_id' => $trxid,
|
735 |
'amount' => sprintf( '%.0f', ceil( $amount * 100 ) ),
|
736 |
'currency' => $currencycode
|
737 |
)
|
738 |
-
|
739 |
));
|
740 |
$result = $apiresult['result'];
|
741 |
} catch ( Exception $e ) {
|
742 |
$base->log( 'Refund failed! ' . $e->getCode() . '/' . $e->getMessage() );
|
743 |
Mage::throwException( Mage::helper( 'cgp' )->__( 'CardGate refund for Transaction %s failed. Reason: %s', $trxid, $e->getCode() . '/' . $e->getMessage() ) );
|
744 |
}
|
745 |
-
|
746 |
$base->log( 'CardGate refund request for ' . $trxid . ' amount: ' . $currencycode . ' ' . $amount . '. Response: ' . $apiresult['body'] );
|
747 |
-
|
748 |
if ( $apiresult['code'] < 200 || $apiresult['code'] > 299 || ! is_array( $result ) || isset( $result['error'] ) ) {
|
749 |
$base->log( 'CardGate refund for Transaction ' . $trxid . ' declined. Got: ' . $apiresult['body'] );
|
750 |
Mage::throwException( Mage::helper( 'cgp' )->__( 'CardGate refund for Transaction %s declined. Reason: %s', $trxid, ( isset( $result['error']['message'] ) ? $result['error']['message'] : "({$apiresult['code']}) {$apiresult['body']}" ) ) );
|
@@ -756,43 +813,43 @@ abstract class Cardgate_Cgp_Model_Gateway_Abstract extends Mage_Payment_Model_Me
|
|
756 |
$refundpayment = Mage::getModel( 'sales/order_payment' )->setMethod( $this->_code )
|
757 |
->setTransactionId( $result['refund']['transaction_id'] )
|
758 |
->setIsTransactionClosed( true );
|
759 |
-
|
760 |
$order->setPayment( $refundpayment );
|
761 |
$refundpayment->addTransaction( Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND, null, false, "CardGate refund {$result['refund']['transaction_id']}" );
|
762 |
-
|
763 |
$order->save();
|
764 |
-
|
765 |
if ( $result['refund']['action'] == 'redirect' ) {
|
766 |
$order->addStatusHistoryComment( Mage::helper( 'cgp' )->__( "Action required for Cardgate refund <b>Order # %s</b> <b>(transaction # %s)</b>. <a href='%s' target='_blank'>Click here</a>", $order->getIncrementId(), $result['refund']['transaction_id'], $result['refund']['url'] ) );
|
767 |
-
|
768 |
$storeId = $order->getStore()->getId();
|
769 |
$ident = Mage::getStoreConfig( 'cgp/settings/notification_email' );
|
770 |
$sender_email = Mage::getStoreConfig( 'trans_email/ident_general/email', $storeId );
|
771 |
$sender_name = Mage::getStoreConfig( 'trans_email/ident_general/name', $storeId );
|
772 |
$recipient_email = Mage::getStoreConfig( 'trans_email/ident_' . $ident . '/email', $storeId );
|
773 |
$recipient_name = Mage::getStoreConfig( 'trans_email/ident_' . $ident . '/name', $storeId );
|
774 |
-
|
775 |
$mail = new Zend_Mail();
|
776 |
$mail->setFrom( $sender_email, $sender_name );
|
777 |
$mail->addTo( $recipient_email, $recipient_name );
|
778 |
$mail->setSubject( Mage::helper( "cgp" )->__( 'Cardgate refund action required' ) );
|
779 |
-
$mail->setBodyText(
|
780 |
Mage::helper( "cgp" )->__( 'Action required for Cardgate refund Order # %s (transaction # %s). See URL %s', $order->getIncrementId(), $result['refund']['transaction_id'], $result['refund']['url'] ) );
|
781 |
-
$mail->setBodyHtml(
|
782 |
-
Mage::helper( "cgp" )->__(
|
783 |
-
"Action required for Cardgate refund <b>Order # %s</b> <b>(transaction # %s)</b>. <a href='%s' target='_blank'>Click here</a>",
|
784 |
$order->getIncrementId(), $result['refund']['transaction_id'], $result['refund']['url'] ) );
|
785 |
$mail->send();
|
786 |
-
|
787 |
Mage::getSingleton( 'core/session' )->addWarning( Mage::helper( 'cgp' )->__( "Action required for Cardgate refund <b>Order # %s</b> <b>(transaction # %s)</b>. <a href='%s' target='_blank'>Click here</a>", $order->getIncrementId(), $result['refund']['transaction_id'], $result['refund']['url'] ) );
|
788 |
}
|
789 |
-
|
790 |
}
|
791 |
} else {
|
792 |
$base->log( 'CardGate refund failed because transaction could not be found' );
|
793 |
Mage::throwException( sprintf( Mage::helper( 'cgp' )->__( 'CardGate refund failed because transaction could not be found' ) ) );
|
794 |
}
|
795 |
-
|
796 |
return $this;
|
797 |
}
|
798 |
|
121 |
|
122 |
protected $_canCapturePartial = true;
|
123 |
|
124 |
+
protected $_canCompleteByMerchant = false; // customers need to complete transactions
|
125 |
+
|
126 |
+
protected $_infoBlockType = 'cgp/info_payment';
|
127 |
+
|
128 |
+
public function __construct()
|
129 |
+
{
|
130 |
+
/**
|
131 |
+
* @var Cardgate_Cgp_Model_Base $base
|
132 |
+
*/
|
133 |
+
$base = Mage::getSingleton( 'cgp/base' );
|
134 |
+
if ( ! $base->isRESTCapable() ) {
|
135 |
+
$this->_canRefund = false;
|
136 |
+
$this->_canRefundInvoicePartial = false;
|
137 |
+
}
|
138 |
+
}
|
139 |
+
|
140 |
/**
|
141 |
* Return Gateway Url
|
142 |
*
|
207 |
/**
|
208 |
* Magento tries to set the order from payment/, instead of cgp/
|
209 |
*
|
210 |
+
* @param Mage_Sales_Model_Order $order
|
211 |
* @return void
|
212 |
*/
|
213 |
public function setSortOrder ( $order ) {
|
217 |
/**
|
218 |
* Append the current model to the URL
|
219 |
*
|
220 |
+
* @param string $url
|
221 |
* @return string
|
222 |
*/
|
223 |
function getModelUrl ( $url ) {
|
242 |
/**
|
243 |
* Retrieve config value for store by path
|
244 |
*
|
245 |
+
* @param string $path
|
246 |
+
* @param mixed $store
|
247 |
* @return mixed
|
248 |
*/
|
249 |
public function getConfigData ( $field, $storeId = null ) {
|
250 |
if ( $storeId === null ) {
|
251 |
$storeId = $this->getStore();
|
252 |
}
|
253 |
+
|
254 |
$configSettings = Mage::getStoreConfig( $this->_module . '/settings', $storeId );
|
255 |
if ( ! is_array( $configSettings ) )
|
256 |
$configSettings = array();
|
258 |
if ( ! is_array( $configGateway ) )
|
259 |
$configGateway = array();
|
260 |
$config = array_merge( $configSettings, $configGateway );
|
261 |
+
|
262 |
return @$config[$field];
|
263 |
}
|
264 |
|
270 |
public function validate () {
|
271 |
parent::validate();
|
272 |
$base = Mage::getSingleton( 'cgp/base' );
|
273 |
+
|
274 |
$currency_code = $this->getQuote()->getBaseCurrencyCode();
|
275 |
if ( empty( $currency_code ) ) {
|
276 |
$currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
|
279 |
$base->log( 'Unacceptable currency code (' . $currency_code . ').' );
|
280 |
Mage::throwException( Mage::helper( 'cgp' )->__( 'Selected currency code "%s" is not compatible with CardGate', $currency_code ) );
|
281 |
}
|
282 |
+
|
283 |
return $this;
|
284 |
}
|
285 |
|
286 |
/**
|
287 |
* Change order status
|
288 |
*
|
289 |
+
* @param Mage_Sales_Model_Order $order
|
290 |
* @return void
|
291 |
*/
|
292 |
protected function initiateTransactionStatus ( $order ) {
|
307 |
* @return array
|
308 |
*/
|
309 |
public function getCheckoutFormFields () {
|
|
|
310 |
$extra_data = $_SESSION['cgp_formdata']['payment']['cgp'];
|
|
|
311 |
$order = $this->getOrder();
|
312 |
+
|
313 |
+
try {
|
314 |
+
$order->getPayment()->setAdditionalInformation('cardgate_redirected',time());
|
315 |
+
$order->save();
|
316 |
+
} catch (Exception $e) {
|
317 |
+
/* ignore */
|
318 |
+
}
|
319 |
+
|
320 |
+
return $this->getRegisterFields($order, $extra_data);
|
321 |
+
}
|
322 |
+
|
323 |
+
/**
|
324 |
+
*
|
325 |
+
* @param Mage_Sales_Model_Order $order
|
326 |
+
* @param array $extra_data
|
327 |
+
* @return string[]|number[]|unknown[]|NULL[]|mixed[]
|
328 |
+
*/
|
329 |
+
public function getRegisterFields($order, $extra_data = array()) {
|
330 |
+
|
331 |
+
$base = Mage::getSingleton( 'cgp/base' );
|
332 |
if ( ! $this->getConfigData( 'orderemail_at_payment' ) ) {
|
333 |
$order->sendNewOrderEmail();
|
334 |
$order->setEmailSent( true );
|
335 |
}
|
336 |
$customer = $order->getBillingAddress();
|
337 |
$ship_customer = $order->getShippingAddress();
|
338 |
+
|
339 |
$s_arr = array();
|
340 |
$s_arr['language'] = $this->getConfigData( 'lang' );
|
341 |
+
|
342 |
$cartitems = array();
|
343 |
+
|
344 |
foreach ( $order->getAllItems() as $itemId => $item ) {
|
345 |
if ( $item->getQtyToInvoice() > 0 ) {
|
346 |
$aAdditionalCartData = array();
|
360 |
), $aAdditionalCartData );
|
361 |
}
|
362 |
}
|
363 |
+
|
364 |
if ( $order->getDiscountAmount() < 0 ) {
|
365 |
$amount = $order->getDiscountAmount();
|
366 |
$applyAfter = Mage::helper( 'tax' )->applyTaxAfterDiscount( $order->getStoreId() );
|
367 |
$priceIncludesTax = Mage::helper( 'tax' )->priceIncludesTax( $order->getStoreId() );
|
368 |
+
|
369 |
if ( $applyAfter == true && $priceIncludesTax == false ) {
|
370 |
// With this setting active the discount will not have the
|
371 |
// correct value.
|
386 |
$amount -= $newAmount;
|
387 |
}
|
388 |
}
|
389 |
+
|
390 |
$cartitems[] = array(
|
391 |
'quantity' => '1',
|
392 |
'sku' => 'cg-discount',
|
398 |
'type' => 4
|
399 |
);
|
400 |
}
|
401 |
+
|
402 |
$tax_info = $order->getFullTaxInfo();
|
|
|
403 |
// add shipping
|
404 |
if ( $order->getShippingAmount() > 0 ) {
|
405 |
+
|
406 |
$flags = 8;
|
407 |
if ( ! isset( $tax_info[0]['percent'] ) ) {
|
408 |
$tax_rate = 0;
|
422 |
'type' => 2
|
423 |
);
|
424 |
}
|
425 |
+
|
426 |
// add invoice fee
|
427 |
if ( $order->getPayment()->getAdditionalInformation( 'invoice_fee' ) > 0 ) {
|
428 |
+
|
429 |
$tax_rate = $order->getPayment()->getAdditionalInformation( 'invoice_fee_rate' );
|
430 |
$cartitems[] = array(
|
431 |
'quantity' => '1',
|
438 |
'type' => 5
|
439 |
);
|
440 |
}
|
441 |
+
|
442 |
// add Magestore affiliateplus discount
|
443 |
if ( ! is_null( $order->getAffiliateplusDiscount() ) && $order->getAffiliateplusDiscount() != 0 ) {
|
444 |
$cartitems[] = array(
|
452 |
'type' => 4
|
453 |
);
|
454 |
}
|
455 |
+
|
456 |
// add ET Payment Extra Charge
|
457 |
if ( ! is_null( $order->getEtPaymentExtraCharge() ) && $order->getEtPaymentExtraCharge() != 0 ) {
|
458 |
$cartitems[] = array(
|
466 |
'type' => 5
|
467 |
);
|
468 |
}
|
469 |
+
|
470 |
// failsafe
|
471 |
$cartpricetotal = $cartvattotal = 0;
|
472 |
foreach ( $cartitems as $cartitem ) {
|
473 |
$cartpricetotal += ceil( ( $cartitem['price'] * $cartitem['quantity'] ) * 100 );
|
474 |
$cartvattotal += ceil( ( $cartitem['vat_amount'] * $cartitem['quantity'] ) * 100 );
|
475 |
}
|
476 |
+
//$cartvattotal-=1;
|
477 |
+
if ( $cartvattotal != ceil( $order->getTaxAmount() * 100 ) ) {
|
478 |
+
$cartitems[] = array(
|
479 |
+
'quantity' => '1',
|
480 |
+
'sku' => 'cg-vatcorrection',
|
481 |
+
'name' => 'VAT Correction',
|
482 |
+
'price' => sprintf( '%01.2f', ( ceil( $order->getTaxAmount() * 100 ) / 100 ) - ( $cartvattotal / 100 ) ),
|
483 |
+
'vat_amount' => sprintf( '%01.2f', ( ceil( $order->getTaxAmount() * 100 ) / 100 ) - ( $cartvattotal / 100 ) ),
|
484 |
+
'vat_inc' => 1,
|
485 |
+
'vat' => 100,
|
486 |
+
'type' => 7
|
487 |
+
);
|
488 |
+
$cartpricetotal += ceil( $order->getTaxAmount() * 100 ) - $cartvattotal;
|
489 |
+
}
|
490 |
if ( $cartpricetotal != ceil( $order->getGrandTotal() * 100 )) {
|
491 |
$iCorrectionAmount = ( ceil( $order->getGrandTotal() * 100 ) / 100 ) - ( $cartpricetotal / 100 );
|
492 |
$cartitems[] = array(
|
500 |
'type' => ( $iCorrectionAmount > 0 ) ? 1 : 4
|
501 |
);
|
502 |
}
|
503 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
504 |
$s_arr['cartitems'] = serialize( $cartitems );
|
505 |
+
|
506 |
switch ( $this->_model ) {
|
507 |
// CreditCards
|
508 |
case 'visa':
|
514 |
case 'vpay':
|
515 |
$s_arr['option'] = 'creditcard';
|
516 |
break;
|
517 |
+
|
518 |
// DIRECTebanking, Sofortbanking
|
519 |
case 'sofortbanking':
|
520 |
$s_arr['option'] = 'directebanking';
|
521 |
break;
|
522 |
+
|
523 |
// iDEAL
|
524 |
case 'ideal':
|
525 |
$s_arr['option'] = 'ideal';
|
526 |
$s_arr['suboption'] = $extra_data['ideal_issuer_id'];
|
527 |
break;
|
528 |
+
|
|
|
|
|
|
|
|
|
|
|
529 |
// Mister Cash
|
530 |
case 'mistercash':
|
531 |
$s_arr['option'] = 'bancontact';
|
532 |
break;
|
533 |
+
|
534 |
+
/*// Giropay
|
535 |
+
case 'giropay':
|
536 |
+
$s_arr['option'] = 'giropay';
|
537 |
+
break;
|
538 |
+
|
539 |
// PayPal
|
540 |
case 'paypal':
|
541 |
$s_arr['option'] = 'paypal';
|
542 |
break;
|
543 |
+
|
544 |
// Webmoney
|
545 |
case 'webmoney':
|
546 |
$s_arr['option'] = 'webmoney';
|
547 |
+
break;*/
|
548 |
+
|
549 |
// Klarna
|
550 |
case 'klarna':
|
551 |
$s_arr['option'] = 'klarna';
|
557 |
}
|
558 |
$s_arr['language'] = $extra_data['klarna-language'];
|
559 |
$s_arr['account'] = 0;
|
560 |
+
|
561 |
break;
|
562 |
+
|
563 |
// Klarna
|
564 |
case 'klarnaaccount':
|
565 |
$s_arr['option'] = 'klarna';
|
566 |
+
|
567 |
if ( isset( $extra_data['klarna-account-personal-number'] ) ) {
|
568 |
$s_arr['dob'] = $extra_data['klarna-account-personal-number'];
|
569 |
} else {
|
572 |
}
|
573 |
$s_arr['language'] = $extra_data['klarna-account-language'];
|
574 |
$s_arr['account'] = 1;
|
575 |
+
|
576 |
break;
|
577 |
+
|
578 |
+
/*// Banktransfer
|
579 |
case 'banktransfer':
|
580 |
$s_arr['option'] = 'banktransfer';
|
581 |
break;
|
582 |
+
|
583 |
// Directdebit
|
584 |
case 'directdebit':
|
585 |
$s_arr['option'] = 'directdebit';
|
586 |
break;
|
587 |
+
|
588 |
// Przelewy24
|
589 |
case 'przelewy24':
|
590 |
$s_arr['option'] = 'przelewy24';
|
591 |
break;
|
592 |
+
|
593 |
// Afterpay
|
594 |
case 'afterpay':
|
595 |
$s_arr['option'] = 'afterpay';
|
596 |
break;
|
597 |
+
|
598 |
// Bitcoin
|
599 |
case 'bitcoin':
|
600 |
$s_arr['option'] = 'bitcoin';
|
601 |
break;
|
602 |
+
|
603 |
+
// POS (offline PM)
|
604 |
+
case 'pos':
|
605 |
+
$s_arr['option'] = 'pos';
|
606 |
+
break;
|
607 |
+
|
608 |
+
// paysafecard
|
609 |
+
case 'paysafecard':
|
610 |
+
$s_arr['option'] = 'paysafecard';
|
611 |
+
break;*/
|
612 |
+
|
613 |
// Default
|
614 |
default:
|
615 |
+
$s_arr['option'] = $this->_model;
|
616 |
$s_arr['suboption'] = '';
|
617 |
break;
|
618 |
}
|
619 |
+
|
620 |
// Add new state
|
621 |
$this->initiateTransactionStatus( $order );
|
622 |
+
|
623 |
$s_arr['siteid'] = $this->getConfigData( 'site_id' );
|
624 |
$s_arr['ref'] = $order->getIncrementId();
|
625 |
+
|
626 |
$s_arr['first_name'] = $customer->getFirstname();
|
627 |
$s_arr['last_name'] = $customer->getLastname();
|
628 |
$s_arr['company_name'] = $customer->getCompany();
|
633 |
$s_arr['postal_code'] = $customer->getPostcode();
|
634 |
$s_arr['phone_number'] = $customer->getTelephone();
|
635 |
$s_arr['state'] = $customer->getRegionCode();
|
636 |
+
|
637 |
// CURO protocol... because..
|
638 |
$s_arr['shipto_firstname'] = $ship_customer->getFirstname();
|
639 |
$s_arr['shipto_lastname'] = $ship_customer->getLastname();
|
645 |
$s_arr['shipto_zipcode'] = $ship_customer->getPostcode();
|
646 |
$s_arr['shipto_phone'] = $ship_customer->getTelephone();
|
647 |
$s_arr['shipto_state'] = $ship_customer->getRegionCode();
|
648 |
+
|
649 |
if ( $this->getConfigData( 'use_backoffice_urls' ) == false ) {
|
650 |
$s_arr['return_url'] = Mage::getUrl( 'cgp/standard/success/', array(
|
651 |
'_secure' => true
|
654 |
'_secure' => true
|
655 |
) );
|
656 |
}
|
657 |
+
|
658 |
$s_arr['shop_version'] = 'Magento ' . Mage::getVersion();
|
659 |
$s_arr['plugin_name'] = 'Cardgate_Cgp';
|
660 |
$s_arr['plugin_version'] = $this->getPluginVersion();
|
661 |
+
$s_arr['extra'] = $order->getQuoteId();
|
662 |
+
|
663 |
if ( $base->isTest() ) {
|
664 |
+
//$s_arr['test'] = '1';
|
665 |
$hash_prefix = 'TEST';
|
666 |
} else {
|
667 |
$hash_prefix = '';
|
668 |
}
|
669 |
+
|
670 |
$s_arr['amount'] = sprintf( '%.0f', ceil( $order->getGrandTotal() * 100 ) );
|
671 |
$s_arr['currency'] = $order->getOrderCurrencyCode();
|
672 |
$s_arr['description'] = str_replace( '%id%', $order->getIncrementId(), $this->getConfigData( 'order_description' ) );
|
673 |
$s_arr['hash'] = md5( $hash_prefix . $this->getConfigData( 'site_id' ) . $s_arr['amount'] . $s_arr['ref'] . $this->getConfigData( 'hash_key' ) );
|
674 |
+
|
675 |
// Logging
|
676 |
$base->log( 'Initiating a new transaction' );
|
677 |
$base->log( 'Sending customer to Card Gate Plus with values:' );
|
678 |
$base->log( 'URL = ' . $this->getGatewayUrl() );
|
679 |
$base->log( $s_arr );
|
680 |
+
|
681 |
$locale = Mage::app()->getLocale()->getLocaleCode();
|
682 |
return $s_arr;
|
683 |
}
|
690 |
* Do RESTful API call
|
691 |
* @param string $entrypoint
|
692 |
* @param string $calldata
|
693 |
+
* @return Zend_Http_Response
|
694 |
+
* @throws Zend_Http_Client_Exception
|
695 |
*/
|
696 |
public function doApiCall( $entrypoint, $calldata = array() ) {
|
697 |
$config = array(
|
699 |
'timeout' => 30,
|
700 |
'verifypeer' => 0
|
701 |
);
|
702 |
+
|
703 |
$data = array();
|
704 |
$data['shop_version'] = 'Magento ' . Mage::getVersion();
|
705 |
$data['plugin_name'] = 'Cardgate_Cgp';
|
706 |
$data['plugin_version'] = $this->getPluginVersion();
|
707 |
$data = array_merge( $data, $calldata );
|
708 |
+
|
709 |
$APIid = $this->getConfigData( 'api_id' );
|
710 |
$APIkey = $this->getConfigData( 'api_key' );
|
711 |
$headers = array(
|
712 |
'Accept: application/json'
|
713 |
);
|
714 |
+
|
715 |
$client = new Varien_Http_Client();
|
716 |
$client->setUri( $this->getAPIUrl() . $entrypoint )
|
717 |
->setAuth( $APIid, $APIkey, Varien_Http_Client::AUTH_BASIC )
|
725 |
$result = json_decode( $responsebody, true );
|
726 |
return array( 'code'=>$responsecode, 'result'=>$result, 'body'=>$responsebody );
|
727 |
}
|
728 |
+
|
729 |
+
public function register ( $order, $emptyMethod = false ) {
|
730 |
+
/**
|
731 |
+
*
|
732 |
+
* @var Cardgate_Cgp_Model_Base $base
|
733 |
+
*/
|
734 |
+
$base = Mage::getModel( 'cgp/base' );
|
735 |
+
$registerdata = $this->getRegisterFields($order);
|
736 |
+
$registerdata['ip'] = '0.0.0.0'; // unknown at this point
|
737 |
+
|
738 |
+
$apiresult = array();
|
739 |
+
try {
|
740 |
+
if ( $emptyMethod ) {
|
741 |
+
unset ( $registerdata['option'] );
|
742 |
+
}
|
743 |
+
$apiresult = $this->doApiCall( ( $registerdata['option'] ? $registerdata['option'].'/' : '' ) . 'payment', $registerdata );
|
744 |
+
$result = $apiresult['result'];
|
745 |
+
} catch ( Exception $e ) {
|
746 |
+
$base->log( 'Refund failed! ' . $e->getCode() . '/' . $e->getMessage() );
|
747 |
+
Mage::throwException( Mage::helper( 'cgp' )->__( 'CardGate register for order %s failed. Reason: %s', $order->getId(), $e->getCode() . '/' . $e->getMessage() ) );
|
748 |
+
}
|
749 |
+
return $apiresult;
|
750 |
+
}
|
751 |
+
|
752 |
/**
|
753 |
* Refund a capture transaction
|
754 |
*
|
755 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
756 |
+
* @param float $amount
|
757 |
*/
|
758 |
public function refund ( Varien_Object $payment, $amount ) {
|
759 |
+
|
760 |
/**
|
761 |
*
|
762 |
* @var Cardgate_Cgp_Model_Base $base
|
763 |
*/
|
764 |
$base = Mage::getModel( 'cgp/base' );
|
765 |
+
|
766 |
$trxid = $this->_getParentTransactionId( $payment );
|
767 |
$base->log( "CG REFUND " . $trxid . " -- " . $amount );
|
768 |
if ( $trxid ) {
|
770 |
$base->log( "Transaction {$trxid} is locked, can't refund now. Aborting." );
|
771 |
Mage::throwException( "Transaction {$trxid} is locked, can't refund now. Aborting." );
|
772 |
}
|
773 |
+
|
774 |
/**
|
775 |
*
|
776 |
* @var Mage_Sales_Model_Order $order
|
777 |
*/
|
778 |
$order = $payment->getOrder();
|
779 |
$currencycode = $order->getOrderCurrencyCode();
|
780 |
+
|
781 |
if ( ! in_array( $currencycode, $this->_supportedCurrencies ) ) {
|
782 |
$base->log( 'Unacceptable currency code (' . $currencycode . ').' );
|
783 |
Mage::throwException( Mage::helper( 'cgp' )->__( 'Selected currency code "%s" is not compatible with CardGate', $currencycode ) );
|
784 |
}
|
785 |
+
|
786 |
$apiresult = array();
|
787 |
try {
|
788 |
+
$apiresult = $this->doApiCall('refund', array(
|
789 |
'refund' => array(
|
790 |
'site_id' => $this->getConfigData( 'site_id' ),
|
791 |
'transaction_id' => $trxid,
|
792 |
'amount' => sprintf( '%.0f', ceil( $amount * 100 ) ),
|
793 |
'currency' => $currencycode
|
794 |
)
|
795 |
+
|
796 |
));
|
797 |
$result = $apiresult['result'];
|
798 |
} catch ( Exception $e ) {
|
799 |
$base->log( 'Refund failed! ' . $e->getCode() . '/' . $e->getMessage() );
|
800 |
Mage::throwException( Mage::helper( 'cgp' )->__( 'CardGate refund for Transaction %s failed. Reason: %s', $trxid, $e->getCode() . '/' . $e->getMessage() ) );
|
801 |
}
|
802 |
+
|
803 |
$base->log( 'CardGate refund request for ' . $trxid . ' amount: ' . $currencycode . ' ' . $amount . '. Response: ' . $apiresult['body'] );
|
804 |
+
|
805 |
if ( $apiresult['code'] < 200 || $apiresult['code'] > 299 || ! is_array( $result ) || isset( $result['error'] ) ) {
|
806 |
$base->log( 'CardGate refund for Transaction ' . $trxid . ' declined. Got: ' . $apiresult['body'] );
|
807 |
Mage::throwException( Mage::helper( 'cgp' )->__( 'CardGate refund for Transaction %s declined. Reason: %s', $trxid, ( isset( $result['error']['message'] ) ? $result['error']['message'] : "({$apiresult['code']}) {$apiresult['body']}" ) ) );
|
813 |
$refundpayment = Mage::getModel( 'sales/order_payment' )->setMethod( $this->_code )
|
814 |
->setTransactionId( $result['refund']['transaction_id'] )
|
815 |
->setIsTransactionClosed( true );
|
816 |
+
|
817 |
$order->setPayment( $refundpayment );
|
818 |
$refundpayment->addTransaction( Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND, null, false, "CardGate refund {$result['refund']['transaction_id']}" );
|
819 |
+
|
820 |
$order->save();
|
821 |
+
|
822 |
if ( $result['refund']['action'] == 'redirect' ) {
|
823 |
$order->addStatusHistoryComment( Mage::helper( 'cgp' )->__( "Action required for Cardgate refund <b>Order # %s</b> <b>(transaction # %s)</b>. <a href='%s' target='_blank'>Click here</a>", $order->getIncrementId(), $result['refund']['transaction_id'], $result['refund']['url'] ) );
|
824 |
+
|
825 |
$storeId = $order->getStore()->getId();
|
826 |
$ident = Mage::getStoreConfig( 'cgp/settings/notification_email' );
|
827 |
$sender_email = Mage::getStoreConfig( 'trans_email/ident_general/email', $storeId );
|
828 |
$sender_name = Mage::getStoreConfig( 'trans_email/ident_general/name', $storeId );
|
829 |
$recipient_email = Mage::getStoreConfig( 'trans_email/ident_' . $ident . '/email', $storeId );
|
830 |
$recipient_name = Mage::getStoreConfig( 'trans_email/ident_' . $ident . '/name', $storeId );
|
831 |
+
|
832 |
$mail = new Zend_Mail();
|
833 |
$mail->setFrom( $sender_email, $sender_name );
|
834 |
$mail->addTo( $recipient_email, $recipient_name );
|
835 |
$mail->setSubject( Mage::helper( "cgp" )->__( 'Cardgate refund action required' ) );
|
836 |
+
$mail->setBodyText(
|
837 |
Mage::helper( "cgp" )->__( 'Action required for Cardgate refund Order # %s (transaction # %s). See URL %s', $order->getIncrementId(), $result['refund']['transaction_id'], $result['refund']['url'] ) );
|
838 |
+
$mail->setBodyHtml(
|
839 |
+
Mage::helper( "cgp" )->__(
|
840 |
+
"Action required for Cardgate refund <b>Order # %s</b> <b>(transaction # %s)</b>. <a href='%s' target='_blank'>Click here</a>",
|
841 |
$order->getIncrementId(), $result['refund']['transaction_id'], $result['refund']['url'] ) );
|
842 |
$mail->send();
|
843 |
+
|
844 |
Mage::getSingleton( 'core/session' )->addWarning( Mage::helper( 'cgp' )->__( "Action required for Cardgate refund <b>Order # %s</b> <b>(transaction # %s)</b>. <a href='%s' target='_blank'>Click here</a>", $order->getIncrementId(), $result['refund']['transaction_id'], $result['refund']['url'] ) );
|
845 |
}
|
846 |
+
|
847 |
}
|
848 |
} else {
|
849 |
$base->log( 'CardGate refund failed because transaction could not be found' );
|
850 |
Mage::throwException( sprintf( Mage::helper( 'cgp' )->__( 'CardGate refund failed because transaction could not be found' ) ) );
|
851 |
}
|
852 |
+
|
853 |
return $this;
|
854 |
}
|
855 |
|
app/code/local/Cardgate/Cgp/Model/Gateway/Idealqr.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento CardGate payment extension
|
5 |
+
*
|
6 |
+
* @category Mage
|
7 |
+
* @package Cardgate_Cgp
|
8 |
+
*/
|
9 |
+
class Cardgate_Cgp_Model_Gateway_Idealqr extends Cardgate_Cgp_Model_Gateway_Abstract
|
10 |
+
{
|
11 |
+
|
12 |
+
protected $_code = 'cgp_idealqr';
|
13 |
+
|
14 |
+
protected $_model = 'idealqr';
|
15 |
+
|
16 |
+
protected $_canUseInternal = true;
|
17 |
+
}
|
app/code/local/Cardgate/Cgp/Model/Gateway/Paysafecard.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento CardGate payment extension
|
5 |
+
*
|
6 |
+
* @category Mage
|
7 |
+
* @package Cardgate_Cgp
|
8 |
+
*/
|
9 |
+
class Cardgate_Cgp_Model_Gateway_Paysafecard extends Cardgate_Cgp_Model_Gateway_Abstract
|
10 |
+
{
|
11 |
+
|
12 |
+
protected $_code = 'cgp_paysafecard';
|
13 |
+
|
14 |
+
protected $_model = 'paysafecard';
|
15 |
+
|
16 |
+
protected $_canUseInternal = true;
|
17 |
+
}
|
app/code/local/Cardgate/Cgp/Model/Gateway/Pos.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento CardGate payment extension
|
5 |
+
*
|
6 |
+
* @category Mage
|
7 |
+
* @package Cardgate_Cgp
|
8 |
+
*/
|
9 |
+
class Cardgate_Cgp_Model_Gateway_Pos extends Cardgate_Cgp_Model_Gateway_Abstract
|
10 |
+
{
|
11 |
+
|
12 |
+
protected $_code = 'cgp_pos';
|
13 |
+
|
14 |
+
protected $_model = 'pos';
|
15 |
+
|
16 |
+
protected $_canUseInternal = true;
|
17 |
+
protected $_canUseCheckout = false;
|
18 |
+
protected $_canReviewPayment = true;
|
19 |
+
protected $_canCompleteByMerchant = true;
|
20 |
+
}
|
app/code/local/Cardgate/Cgp/Model/Observer.php
CHANGED
@@ -14,13 +14,39 @@ class Cardgate_Cgp_Model_Observer extends Mage_Core_Model_Abstract
|
|
14 |
$quote = $observer->getEvent()->getSessionQuote()->getQuote();
|
15 |
self::addInvoiceFeeToQuote( $quote );
|
16 |
}
|
17 |
-
|
18 |
public function salesQuoteCollectTotalsAfter ( Varien_Event_Observer $observer )
|
19 |
{
|
20 |
$quote = $observer->getEvent()->getQuote();
|
21 |
self::addInvoiceFeeToQuote( $quote );
|
22 |
}
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
protected static function addInvoiceFeeToQuote( $quote )
|
25 |
{
|
26 |
$quote->setInvoiceFee( 0 );
|
@@ -30,23 +56,23 @@ class Cardgate_Cgp_Model_Observer extends Mage_Core_Model_Abstract
|
|
30 |
$quote->setInvoiceTaxAmount( 0 );
|
31 |
$quote->setBaseInvoiceTaxAmount( 0 );
|
32 |
$quote->setInvoiceFeeRate( 0 );
|
33 |
-
|
34 |
foreach ( $quote->getAllAddresses() as $address ) {
|
35 |
$quote->setInvoiceFee( ( float ) $quote->getInvoiceFee() + $address->getInvoiceFee() );
|
36 |
$quote->setBaseInvoiceFee( ( float ) $quote->getBaseInvoiceFee() + $address->getBaseInvoiceFee() );
|
37 |
-
|
38 |
$quoteFeeExclVat = $quote->getInvoiceFeeExcludedVat();
|
39 |
$addressFeeExclCat = $address->getInvoiceFeeExcludedVat();
|
40 |
$quote->setInvoiceFeeExcludedVat( ( float ) $quoteFeeExclVat + $addressFeeExclCat );
|
41 |
-
|
42 |
$quoteBaseFeeExclVat = $quote->getBaseInvoiceFeeExcludedVat();
|
43 |
$addressBaseFeeExclVat = $address->getBaseInvoiceFeeExcludedVat();
|
44 |
$quote->setBaseInvoiceFeeExcludedVat( ( float ) $quoteBaseFeeExclVat + $addressBaseFeeExclVat );
|
45 |
-
|
46 |
$quoteFeeTaxAmount = $quote->getInvoiceTaxAmount();
|
47 |
$addressFeeTaxAmount = $address->getInvoiceTaxAmount();
|
48 |
$quote->setInvoiceTaxAmount( ( float ) $quoteFeeTaxAmount + $addressFeeTaxAmount );
|
49 |
-
|
50 |
$quoteBaseFeeTaxAmount = $quote->getBaseInvoiceTaxAmount();
|
51 |
$addressBaseFeeTaxAmount = $address->getBaseInvoiceTaxAmount();
|
52 |
$quote->setBaseInvoiceTaxAmount( ( float ) $quoteBaseFeeTaxAmount + $addressBaseFeeTaxAmount );
|
@@ -57,17 +83,17 @@ class Cardgate_Cgp_Model_Observer extends Mage_Core_Model_Abstract
|
|
57 |
public function salesOrderPaymentPlaceEnd ( Varien_Event_Observer $observer )
|
58 |
{
|
59 |
$payment = $observer->getPayment();
|
60 |
-
|
61 |
if ( substr( $payment->getMethodInstance()->getCode(), 0, 3 ) != 'cgp' ) {
|
62 |
return;
|
63 |
}
|
64 |
-
|
65 |
$info = $payment->getMethodInstance()->getInfoInstance();
|
66 |
$quote = Mage::getSingleton( 'checkout/session' )->getQuote();
|
67 |
if ( ! $quote->getId() ) {
|
68 |
$quote = Mage::getSingleton( 'adminhtml/session_quote' )->getQuote();
|
69 |
}
|
70 |
-
|
71 |
$info->setAdditionalInformation( 'invoice_fee', $quote->getInvoiceFee() );
|
72 |
$info->setAdditionalInformation( 'base_invoice_fee', $quote->getBaseInvoiceFee() );
|
73 |
$info->setAdditionalInformation( 'invoice_fee_exluding_vat', $quote->getInvoiceFeeExcludedVat() );
|
@@ -75,7 +101,7 @@ class Cardgate_Cgp_Model_Observer extends Mage_Core_Model_Abstract
|
|
75 |
$info->setAdditionalInformation( 'invoice_tax_amount', $quote->getInvoiceTaxAmount() );
|
76 |
$info->setAdditionalInformation( 'base_invoice_tax_amount', $quote->getBaseInvoiceTaxAmount() );
|
77 |
$info->setAdditionalInformation( 'invoice_fee_rate', $quote->getInvoiceFeeRate() );
|
78 |
-
|
79 |
$info->save();
|
80 |
}
|
81 |
}
|
14 |
$quote = $observer->getEvent()->getSessionQuote()->getQuote();
|
15 |
self::addInvoiceFeeToQuote( $quote );
|
16 |
}
|
17 |
+
|
18 |
public function salesQuoteCollectTotalsAfter ( Varien_Event_Observer $observer )
|
19 |
{
|
20 |
$quote = $observer->getEvent()->getQuote();
|
21 |
self::addInvoiceFeeToQuote( $quote );
|
22 |
}
|
23 |
+
|
24 |
+
public function adminhtmlCheckoutSubmitAllAfter ( Varien_Event_Observer $observer )
|
25 |
+
{
|
26 |
+
/**
|
27 |
+
* @var Cardgate_Cgp_Model_Base $base
|
28 |
+
*/
|
29 |
+
$base = Mage::getSingleton( 'cgp/base' );
|
30 |
+
if ( ! $base->isRESTCapable() ) {
|
31 |
+
return;
|
32 |
+
}
|
33 |
+
|
34 |
+
$quote = $observer->getEvent()->getQuote();
|
35 |
+
$order = $observer->getEvent()->getOrder();
|
36 |
+
$payment = $order->getPayment();
|
37 |
+
|
38 |
+
if ( substr( $payment->getMethodInstance()->getCode(), 0, 3 ) != 'cgp' ) {
|
39 |
+
return;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @var Cardgate_Cgp_Model_Gateway_Abstract $paymentmethod
|
44 |
+
*/
|
45 |
+
$paymentmethod = $payment->getMethodInstance();
|
46 |
+
$registerdata = $paymentmethod->register($order);
|
47 |
+
// YYY: Do we need $registerdata?
|
48 |
+
}
|
49 |
+
|
50 |
protected static function addInvoiceFeeToQuote( $quote )
|
51 |
{
|
52 |
$quote->setInvoiceFee( 0 );
|
56 |
$quote->setInvoiceTaxAmount( 0 );
|
57 |
$quote->setBaseInvoiceTaxAmount( 0 );
|
58 |
$quote->setInvoiceFeeRate( 0 );
|
59 |
+
|
60 |
foreach ( $quote->getAllAddresses() as $address ) {
|
61 |
$quote->setInvoiceFee( ( float ) $quote->getInvoiceFee() + $address->getInvoiceFee() );
|
62 |
$quote->setBaseInvoiceFee( ( float ) $quote->getBaseInvoiceFee() + $address->getBaseInvoiceFee() );
|
63 |
+
|
64 |
$quoteFeeExclVat = $quote->getInvoiceFeeExcludedVat();
|
65 |
$addressFeeExclCat = $address->getInvoiceFeeExcludedVat();
|
66 |
$quote->setInvoiceFeeExcludedVat( ( float ) $quoteFeeExclVat + $addressFeeExclCat );
|
67 |
+
|
68 |
$quoteBaseFeeExclVat = $quote->getBaseInvoiceFeeExcludedVat();
|
69 |
$addressBaseFeeExclVat = $address->getBaseInvoiceFeeExcludedVat();
|
70 |
$quote->setBaseInvoiceFeeExcludedVat( ( float ) $quoteBaseFeeExclVat + $addressBaseFeeExclVat );
|
71 |
+
|
72 |
$quoteFeeTaxAmount = $quote->getInvoiceTaxAmount();
|
73 |
$addressFeeTaxAmount = $address->getInvoiceTaxAmount();
|
74 |
$quote->setInvoiceTaxAmount( ( float ) $quoteFeeTaxAmount + $addressFeeTaxAmount );
|
75 |
+
|
76 |
$quoteBaseFeeTaxAmount = $quote->getBaseInvoiceTaxAmount();
|
77 |
$addressBaseFeeTaxAmount = $address->getBaseInvoiceTaxAmount();
|
78 |
$quote->setBaseInvoiceTaxAmount( ( float ) $quoteBaseFeeTaxAmount + $addressBaseFeeTaxAmount );
|
83 |
public function salesOrderPaymentPlaceEnd ( Varien_Event_Observer $observer )
|
84 |
{
|
85 |
$payment = $observer->getPayment();
|
86 |
+
|
87 |
if ( substr( $payment->getMethodInstance()->getCode(), 0, 3 ) != 'cgp' ) {
|
88 |
return;
|
89 |
}
|
90 |
+
|
91 |
$info = $payment->getMethodInstance()->getInfoInstance();
|
92 |
$quote = Mage::getSingleton( 'checkout/session' )->getQuote();
|
93 |
if ( ! $quote->getId() ) {
|
94 |
$quote = Mage::getSingleton( 'adminhtml/session_quote' )->getQuote();
|
95 |
}
|
96 |
+
|
97 |
$info->setAdditionalInformation( 'invoice_fee', $quote->getInvoiceFee() );
|
98 |
$info->setAdditionalInformation( 'base_invoice_fee', $quote->getBaseInvoiceFee() );
|
99 |
$info->setAdditionalInformation( 'invoice_fee_exluding_vat', $quote->getInvoiceFeeExcludedVat() );
|
101 |
$info->setAdditionalInformation( 'invoice_tax_amount', $quote->getInvoiceTaxAmount() );
|
102 |
$info->setAdditionalInformation( 'base_invoice_tax_amount', $quote->getBaseInvoiceTaxAmount() );
|
103 |
$info->setAdditionalInformation( 'invoice_fee_rate', $quote->getInvoiceFeeRate() );
|
104 |
+
|
105 |
$info->save();
|
106 |
}
|
107 |
}
|
app/code/local/Cardgate/Cgp/Model/Paymentlink.php
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento CardGate payment extension
|
5 |
+
*
|
6 |
+
* @category Mage
|
7 |
+
* @package Cardgate_Cgp
|
8 |
+
*/
|
9 |
+
class Cardgate_Cgp_Model_Paymentlink extends Mage_Core_Model_Abstract {
|
10 |
+
|
11 |
+
public function queueNewPaymentEmail ( Mage_Sales_Model_Order $order, $forceMode = false, $action = "payment" ) {
|
12 |
+
$storeId = $order->getStore()->getId();
|
13 |
+
|
14 |
+
// Get the destination email addresses to send copies to
|
15 |
+
$copyTo = false;
|
16 |
+
$data = Mage::getStoreConfig( 'cgp/email_paymentlink/copy_to', $storeId );
|
17 |
+
if (!empty($data)) {
|
18 |
+
$copyTo = explode(',', $data);
|
19 |
+
}
|
20 |
+
|
21 |
+
$copyMethod = Mage::getStoreConfig( 'cgp/email_paymentlink/copy_method', $storeId );
|
22 |
+
|
23 |
+
// Start store emulation process
|
24 |
+
/** @var $appEmulation Mage_Core_Model_App_Emulation */
|
25 |
+
$appEmulation = Mage::getSingleton( 'core/app_emulation' );
|
26 |
+
$initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation( $storeId );
|
27 |
+
|
28 |
+
try {
|
29 |
+
// Retrieve specified view block from appropriate design package
|
30 |
+
// (depends on emulated store)
|
31 |
+
$paymentBlock = Mage::helper( 'payment' )->getInfoBlock( $order->getPayment() )
|
32 |
+
->setIsSecureMode( true );
|
33 |
+
$paymentBlock->getMethod()->setStore( $storeId );
|
34 |
+
$paymentBlockHtml = $paymentBlock->toHtml();
|
35 |
+
} catch ( Exception $exception ) {
|
36 |
+
// Stop store emulation process
|
37 |
+
$appEmulation->stopEnvironmentEmulation( $initialEnvironmentInfo );
|
38 |
+
throw $exception;
|
39 |
+
}
|
40 |
+
|
41 |
+
// Stop store emulation process
|
42 |
+
$appEmulation->stopEnvironmentEmulation( $initialEnvironmentInfo );
|
43 |
+
|
44 |
+
// Retrieve corresponding email template id and customer name
|
45 |
+
if ( $order->getCustomerIsGuest() ) {
|
46 |
+
|
47 |
+
$templateId = Mage::getStoreConfig( 'cgp/email_paymentlink/guest_template', $storeId );
|
48 |
+
//$templateId = Mage::getStoreConfig( Mage_Sales_Model_Order::XML_PATH_EMAIL_GUEST_TEMPLATE, $storeId );
|
49 |
+
$customerName = $order->getBillingAddress()->getName();
|
50 |
+
} else {
|
51 |
+
$templateId = Mage::getStoreConfig( 'cgp/email_paymentlink/template', $storeId );
|
52 |
+
//$templateId = Mage::getStoreConfig( Mage_Sales_Model_Order::XML_PATH_EMAIL_TEMPLATE, $storeId );
|
53 |
+
$customerName = $order->getCustomerName();
|
54 |
+
}
|
55 |
+
|
56 |
+
/** @var $mailer Mage_Core_Model_Email_Template_Mailer */
|
57 |
+
$mailer = Mage::getModel( 'core/email_template_mailer' );
|
58 |
+
/** @var $emailInfo Mage_Core_Model_Email_Info */
|
59 |
+
$emailInfo = Mage::getModel( 'core/email_info' );
|
60 |
+
$emailInfo->addTo( $order->getCustomerEmail(), $customerName );
|
61 |
+
if ( $copyTo && $copyMethod == 'bcc' ) {
|
62 |
+
// Add bcc to customer email
|
63 |
+
foreach ( $copyTo as $email ) {
|
64 |
+
$emailInfo->addBcc( $email );
|
65 |
+
}
|
66 |
+
}
|
67 |
+
$mailer->addEmailInfo( $emailInfo );
|
68 |
+
|
69 |
+
// Email copies are sent as separated emails if their copy method is
|
70 |
+
// 'copy'
|
71 |
+
if ( $copyTo && $copyMethod == 'copy' ) {
|
72 |
+
foreach ( $copyTo as $email ) {
|
73 |
+
$emailInfo = Mage::getModel( 'core/email_info' );
|
74 |
+
$emailInfo->addTo( $email );
|
75 |
+
$mailer->addEmailInfo( $emailInfo );
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
$base = Mage::getModel( 'cgp/base' );
|
80 |
+
$hash = md5( $order->getCustomerEmail() . $base->getConfigData( 'site_id' ) . $base->getConfigData( 'hash_key' ) . $action );
|
81 |
+
|
82 |
+
// Set all required params and send emails
|
83 |
+
$mailer->setSender( Mage::getStoreConfig( 'cgp/email_paymentlink/identity', $storeId ) );
|
84 |
+
$mailer->setStoreId( $storeId );
|
85 |
+
$mailer->setTemplateId( $templateId );
|
86 |
+
$mailer->setTemplateParams( array(
|
87 |
+
'payment_link' => Mage::app()->getStore()->getUrl('cgp/standard/resume', array( 'action'=>$action, 'order'=>$order->getIncrementId(), 'hash'=>$hash ) ),
|
88 |
+
'order' => $order,
|
89 |
+
'billing' => $order->getBillingAddress(),
|
90 |
+
'payment_html' => $paymentBlockHtml
|
91 |
+
) );
|
92 |
+
|
93 |
+
/** @var $emailQueue Mage_Core_Model_Email_Queue */
|
94 |
+
$emailQueue = Mage::getModel( 'core/email_queue' );
|
95 |
+
$emailQueue->setEntityId( $order->getId() )
|
96 |
+
->setEntityType( Mage_Sales_Model_Order::ENTITY )
|
97 |
+
->setEventType( 'resend_paymentlink' )
|
98 |
+
->setIsForceCheck( ! $forceMode );
|
99 |
+
|
100 |
+
$mailer->setQueue( $emailQueue )->send();
|
101 |
+
$emailQueue->send();
|
102 |
+
|
103 |
+
//$this->setEmailSent( true );
|
104 |
+
//$this->_getResource()->saveAttribute( $this, 'email_sent' );
|
105 |
+
|
106 |
+
return true;
|
107 |
+
}
|
108 |
+
|
109 |
+
}
|
app/code/local/Cardgate/Cgp/controllers/Adminhtml/CardgateController.php
ADDED
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento CardGate payment extension
|
5 |
+
*
|
6 |
+
* @category Mage
|
7 |
+
* @package Cardgate_Cgp
|
8 |
+
*/
|
9 |
+
class Cardgate_Cgp_Adminhtml_CardgateController extends Mage_Adminhtml_Controller_Action {
|
10 |
+
|
11 |
+
public function indexAction () {
|
12 |
+
$this->loadLayout();
|
13 |
+
|
14 |
+
$this->_title( $this->__( 'CardGate' ) );
|
15 |
+
|
16 |
+
$this->renderLayout();
|
17 |
+
}
|
18 |
+
|
19 |
+
public function resendAction () {
|
20 |
+
$this->loadLayout();
|
21 |
+
|
22 |
+
$this->_title( $this->__( 'CardGate' ) )
|
23 |
+
->_title( $this->__( 'Send payment link' ) );
|
24 |
+
|
25 |
+
$block = $this->getLayout()->createBlock( 'Cardgate_Cgp_Block_Adminhtml_Paymentlink_Resend' );
|
26 |
+
$this->getLayout()
|
27 |
+
->getBlock( 'content' )
|
28 |
+
->append( $block );
|
29 |
+
$this->renderLayout();
|
30 |
+
}
|
31 |
+
|
32 |
+
public function resendPaymentAction () {
|
33 |
+
$this->loadLayout();
|
34 |
+
$this->_title( $this->__( 'CardGate' ) )
|
35 |
+
->_title( $this->__( 'Send payment link' ) );
|
36 |
+
|
37 |
+
/**
|
38 |
+
*
|
39 |
+
* @var Mage_Sales_Model_Order $order
|
40 |
+
*/
|
41 |
+
$order = Mage::getModel( 'sales/order' )->load( $this->getRequest()
|
42 |
+
->get( 'orderid' ) );
|
43 |
+
$order = Mage::getModel( 'sales/order' )->load( $this->getRequest()
|
44 |
+
->get( 'orderid' ) );
|
45 |
+
if ( empty( $order ) ) {
|
46 |
+
$this->addText( Mage::helper( 'cgp' )->__( 'Error loading order #%s' ), $this->getRequest()
|
47 |
+
->get( 'orderid' ) );
|
48 |
+
}
|
49 |
+
$payment = $order->getPayment();
|
50 |
+
if ( empty( $payment ) ) {
|
51 |
+
$this->addText( Mage::helper( 'cgp' )->__( 'Error loading payment info for order #%s' ), $this->getRequest()
|
52 |
+
->get( 'orderid' ) );
|
53 |
+
}
|
54 |
+
try {
|
55 |
+
$title = $payment->getMethodInstance()->getTitle();
|
56 |
+
} catch ( Exception $e ) {
|
57 |
+
/* ignore */
|
58 |
+
}
|
59 |
+
if ( empty( $title ) ) {
|
60 |
+
$title = $payment->getMethod();
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
*
|
65 |
+
* @var Cardgate_Cgp_Model_Paymentlink $paymentlink
|
66 |
+
*/
|
67 |
+
$paymentlink = Mage::getModel( 'cgp/paymentlink' );
|
68 |
+
$paymentlink->queueNewPaymentEmail( $order, true, 'payment' );
|
69 |
+
|
70 |
+
Mage::getSingleton( 'core/session' )->addSuccess( Mage::helper( 'cgp' )->__( "Payment link mail sent using method \'%s\'", $title ) );
|
71 |
+
$this->_redirect( '*/sales_order/view', array(
|
72 |
+
'order_id' => $order->getId()
|
73 |
+
) );
|
74 |
+
}
|
75 |
+
|
76 |
+
public function resendCheckoutAction () {
|
77 |
+
$this->loadLayout();
|
78 |
+
$this->_title( $this->__( 'CardGate' ) )
|
79 |
+
->_title( $this->__( 'Send payment link' ) );
|
80 |
+
|
81 |
+
/**
|
82 |
+
*
|
83 |
+
* @var Mage_Sales_Model_Order $order
|
84 |
+
*/
|
85 |
+
$order = Mage::getModel( 'sales/order' )->load( $this->getRequest()
|
86 |
+
->get( 'orderid' ) );
|
87 |
+
|
88 |
+
/**
|
89 |
+
*
|
90 |
+
* @var Cardgate_Cgp_Model_Paymentlink $paymentlink
|
91 |
+
*/
|
92 |
+
$paymentlink = Mage::getModel( 'cgp/paymentlink' );
|
93 |
+
$paymentlink->queueNewPaymentEmail( $order, true, 'checkout' );
|
94 |
+
|
95 |
+
Mage::getSingleton( 'core/session' )->addSuccess( Mage::helper( 'cgp' )->__( "Payment link mail sent allowing all available paymentmethods" ) );
|
96 |
+
$this->_redirect( '*/sales_order/view', array(
|
97 |
+
'order_id' => $order->getId()
|
98 |
+
) );
|
99 |
+
}
|
100 |
+
|
101 |
+
}
|
app/code/local/Cardgate/Cgp/controllers/StandardController.php
CHANGED
@@ -13,18 +13,18 @@ class Cardgate_Cgp_StandardController extends Mage_Core_Controller_Front_Action
|
|
13 |
/**
|
14 |
* Verify the callback
|
15 |
*
|
16 |
-
* @param array $data
|
17 |
* @return boolean
|
18 |
*/
|
19 |
protected function validate ( $data ) {
|
20 |
$base = Mage::getSingleton( 'cgp/base' );
|
21 |
-
|
22 |
$hashString = ( ( $data['is_test'] || $data['testmode'] ) ? 'TEST' : '' ) . $data['transaction_id'] . $data['currency'] . $data['amount'] . $data['ref'] . $data['status'] . $base->getConfigData( 'hash_key' );
|
23 |
-
|
24 |
if ( md5( $hashString ) == $data['hash'] ) {
|
25 |
return true;
|
26 |
}
|
27 |
-
|
28 |
return false;
|
29 |
}
|
30 |
|
@@ -38,10 +38,10 @@ class Cardgate_Cgp_StandardController extends Mage_Core_Controller_Front_Action
|
|
38 |
if ( $this->_gatewayModel ) {
|
39 |
return $this->_gatewayModel;
|
40 |
}
|
41 |
-
|
42 |
$model = $this->getRequest()->getParam( 'model' );
|
43 |
$model = preg_replace( '/[^[[:alnum:]]]+/', '', $model );
|
44 |
-
|
45 |
if ( ! empty( $model ) ) {
|
46 |
return 'gateway_' . $model;
|
47 |
} else {
|
@@ -55,13 +55,13 @@ class Cardgate_Cgp_StandardController extends Mage_Core_Controller_Front_Action
|
|
55 |
public function redirectAction () {
|
56 |
$paymentModel = 'cgp/' . $this->getGatewayModel();
|
57 |
Mage::register( 'cgp_model', $paymentModel );
|
58 |
-
|
59 |
$session = Mage::getSingleton( 'checkout/session' );
|
60 |
$session->setCardgateQuoteId( $session->getQuoteId() );
|
61 |
-
|
62 |
$this->loadLayout();
|
63 |
$block = $this->getLayout()->createBlock( 'Cardgate_Cgp_Block_Redirect' );
|
64 |
-
|
65 |
$this->getLayout()
|
66 |
->getBlock( 'content' )
|
67 |
->append( $block );
|
@@ -72,20 +72,9 @@ class Cardgate_Cgp_StandardController extends Mage_Core_Controller_Front_Action
|
|
72 |
* After a failed transaction a customer will be send here
|
73 |
*/
|
74 |
public function cancelAction () {
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
break;
|
79 |
-
case 305:
|
80 |
-
break;
|
81 |
-
case 300:
|
82 |
-
$message = $this->__( 'Your payment has failed. If you wish, you can try using a different payment method.' );
|
83 |
-
break;
|
84 |
-
}
|
85 |
-
if ( isset( $message ) ) {
|
86 |
-
Mage::getSingleton( 'core/session' )->addError( $message );
|
87 |
-
}
|
88 |
-
|
89 |
$base = Mage::getSingleton( 'cgp/base' );
|
90 |
$session = Mage::getSingleton( 'checkout/session' );
|
91 |
/*
|
@@ -112,7 +101,7 @@ class Cardgate_Cgp_StandardController extends Mage_Core_Controller_Front_Action
|
|
112 |
* }
|
113 |
*/
|
114 |
$quote = Mage::getModel( 'sales/quote' )->load( $session->getCardgateQuoteId() );
|
115 |
-
|
116 |
if ( $quote->getId() ) {
|
117 |
$quote->setIsActive( true );
|
118 |
if ( $quote->getReservedOrderId() ) {
|
@@ -121,7 +110,7 @@ class Cardgate_Cgp_StandardController extends Mage_Core_Controller_Front_Action
|
|
121 |
}
|
122 |
$quote->save();
|
123 |
}
|
124 |
-
|
125 |
// clear session flag so that it will redirect to the gateway, and not
|
126 |
// to cancel
|
127 |
// $session->setCgpOnestepCheckout(false);
|
@@ -137,10 +126,19 @@ class Cardgate_Cgp_StandardController extends Mage_Core_Controller_Front_Action
|
|
137 |
if ( $quote->getId() ) {
|
138 |
$quote->setIsActive( false );
|
139 |
$quote->delete();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
}
|
141 |
// clear session flag so that next order will redirect to the gateway
|
142 |
// $session->setCgpOnestepCheckout(false);
|
143 |
-
|
144 |
$this->_redirect( 'checkout/onepage/success', array(
|
145 |
'_secure' => true
|
146 |
) );
|
@@ -152,7 +150,7 @@ class Cardgate_Cgp_StandardController extends Mage_Core_Controller_Front_Action
|
|
152 |
public function controlAction () {
|
153 |
$base = Mage::getModel( 'cgp/base' );
|
154 |
$data = $this->getRequest()->getPost();
|
155 |
-
|
156 |
// Verify callback hash
|
157 |
if ( ! $this->getRequest()->isPost() || ! $this->validate( $data ) ) {
|
158 |
$message = 'Callback hash validation failed!';
|
@@ -160,18 +158,18 @@ class Cardgate_Cgp_StandardController extends Mage_Core_Controller_Front_Action
|
|
160 |
echo $message;
|
161 |
exit();
|
162 |
}
|
163 |
-
|
164 |
// Process callback
|
165 |
if ( intval( $data['amount'] ) < 0 ) {
|
166 |
$base->setCallbackData( $data )->processRefundCallback();
|
167 |
} else {
|
168 |
$base->setCallbackData( $data )->processCallback();
|
169 |
}
|
170 |
-
|
171 |
// Obtain quote and status
|
172 |
$status = ( int ) $data['status'];
|
173 |
$quote = Mage::getModel( 'sales/quote' )->load( $data['extra'] );
|
174 |
-
|
175 |
if ( 200 <= $status && $status <= 299 ) {
|
176 |
// Set Mage_Sales_Model_Quote to inactive and delete
|
177 |
if ( $quote->getId() ) {
|
@@ -191,11 +189,11 @@ class Cardgate_Cgp_StandardController extends Mage_Core_Controller_Front_Action
|
|
191 |
$quote->save();
|
192 |
}
|
193 |
}
|
194 |
-
|
195 |
// Display transaction_id and status
|
196 |
echo $data['transaction_id'] . '.' . $data['status'];
|
197 |
}
|
198 |
-
|
199 |
public function testAction () {
|
200 |
$base = Mage::getModel( 'cgp/base' );
|
201 |
switch ( $this->getRequest()->getParam('action') ) {
|
@@ -204,7 +202,7 @@ class Cardgate_Cgp_StandardController extends Mage_Core_Controller_Front_Action
|
|
204 |
if ( $this->getRequest()->getParam('hash') != md5( $base->getConfigData( 'site_id' ) . $base->getConfigData( 'hash_key' ) ) ) {
|
205 |
die ( 'HASHKEY ERROR' );
|
206 |
}
|
207 |
-
|
208 |
/**
|
209 |
* @var Cardgate_Cgp_Model_Gateway_Default $gateway
|
210 |
*/
|
@@ -225,7 +223,7 @@ class Cardgate_Cgp_StandardController extends Mage_Core_Controller_Front_Action
|
|
225 |
break;
|
226 |
}
|
227 |
}
|
228 |
-
|
229 |
public function versionAction () {
|
230 |
$base = Mage::getModel( 'cgp/base' );
|
231 |
if ( $this->getRequest()->getParam('hash') != md5( $base->getConfigData( 'site_id' ) . $base->getConfigData( 'hash_key' ) ) ) {
|
@@ -237,5 +235,136 @@ class Cardgate_Cgp_StandardController extends Mage_Core_Controller_Front_Action
|
|
237 |
$gateway = Mage::getModel( 'cgp/gateway_default');
|
238 |
die ( json_encode( array ( 'plugin_version'=>$gateway->getPluginVersion(), 'magento_version'=>Mage::getVersion() ) ) );
|
239 |
}
|
240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
}
|
13 |
/**
|
14 |
* Verify the callback
|
15 |
*
|
16 |
+
* @param array $data
|
17 |
* @return boolean
|
18 |
*/
|
19 |
protected function validate ( $data ) {
|
20 |
$base = Mage::getSingleton( 'cgp/base' );
|
21 |
+
|
22 |
$hashString = ( ( $data['is_test'] || $data['testmode'] ) ? 'TEST' : '' ) . $data['transaction_id'] . $data['currency'] . $data['amount'] . $data['ref'] . $data['status'] . $base->getConfigData( 'hash_key' );
|
23 |
+
|
24 |
if ( md5( $hashString ) == $data['hash'] ) {
|
25 |
return true;
|
26 |
}
|
27 |
+
|
28 |
return false;
|
29 |
}
|
30 |
|
38 |
if ( $this->_gatewayModel ) {
|
39 |
return $this->_gatewayModel;
|
40 |
}
|
41 |
+
|
42 |
$model = $this->getRequest()->getParam( 'model' );
|
43 |
$model = preg_replace( '/[^[[:alnum:]]]+/', '', $model );
|
44 |
+
|
45 |
if ( ! empty( $model ) ) {
|
46 |
return 'gateway_' . $model;
|
47 |
} else {
|
55 |
public function redirectAction () {
|
56 |
$paymentModel = 'cgp/' . $this->getGatewayModel();
|
57 |
Mage::register( 'cgp_model', $paymentModel );
|
58 |
+
|
59 |
$session = Mage::getSingleton( 'checkout/session' );
|
60 |
$session->setCardgateQuoteId( $session->getQuoteId() );
|
61 |
+
|
62 |
$this->loadLayout();
|
63 |
$block = $this->getLayout()->createBlock( 'Cardgate_Cgp_Block_Redirect' );
|
64 |
+
|
65 |
$this->getLayout()
|
66 |
->getBlock( 'content' )
|
67 |
->append( $block );
|
72 |
* After a failed transaction a customer will be send here
|
73 |
*/
|
74 |
public function cancelAction () {
|
75 |
+
$message = $this->__( 'Your payment has failed. If you wish, you can try using a different payment method or try again.' );
|
76 |
+
Mage::getSingleton( 'core/session' )->addError( $message );
|
77 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
$base = Mage::getSingleton( 'cgp/base' );
|
79 |
$session = Mage::getSingleton( 'checkout/session' );
|
80 |
/*
|
101 |
* }
|
102 |
*/
|
103 |
$quote = Mage::getModel( 'sales/quote' )->load( $session->getCardgateQuoteId() );
|
104 |
+
|
105 |
if ( $quote->getId() ) {
|
106 |
$quote->setIsActive( true );
|
107 |
if ( $quote->getReservedOrderId() ) {
|
110 |
}
|
111 |
$quote->save();
|
112 |
}
|
113 |
+
|
114 |
// clear session flag so that it will redirect to the gateway, and not
|
115 |
// to cancel
|
116 |
// $session->setCgpOnestepCheckout(false);
|
126 |
if ( $quote->getId() ) {
|
127 |
$quote->setIsActive( false );
|
128 |
$quote->delete();
|
129 |
+
} else {
|
130 |
+
/**
|
131 |
+
*
|
132 |
+
* @var Mage_Checkout_Model_Session $session
|
133 |
+
*/
|
134 |
+
$session = Mage::getSingleton( 'checkout/session' );
|
135 |
+
if ($this->getRequest()->getParam('code', false) == '200') {
|
136 |
+
$session->addSuccess( $this->__( 'Transaction successfully completed.' ) );
|
137 |
+
}
|
138 |
}
|
139 |
// clear session flag so that next order will redirect to the gateway
|
140 |
// $session->setCgpOnestepCheckout(false);
|
141 |
+
|
142 |
$this->_redirect( 'checkout/onepage/success', array(
|
143 |
'_secure' => true
|
144 |
) );
|
150 |
public function controlAction () {
|
151 |
$base = Mage::getModel( 'cgp/base' );
|
152 |
$data = $this->getRequest()->getPost();
|
153 |
+
|
154 |
// Verify callback hash
|
155 |
if ( ! $this->getRequest()->isPost() || ! $this->validate( $data ) ) {
|
156 |
$message = 'Callback hash validation failed!';
|
158 |
echo $message;
|
159 |
exit();
|
160 |
}
|
161 |
+
|
162 |
// Process callback
|
163 |
if ( intval( $data['amount'] ) < 0 ) {
|
164 |
$base->setCallbackData( $data )->processRefundCallback();
|
165 |
} else {
|
166 |
$base->setCallbackData( $data )->processCallback();
|
167 |
}
|
168 |
+
|
169 |
// Obtain quote and status
|
170 |
$status = ( int ) $data['status'];
|
171 |
$quote = Mage::getModel( 'sales/quote' )->load( $data['extra'] );
|
172 |
+
|
173 |
if ( 200 <= $status && $status <= 299 ) {
|
174 |
// Set Mage_Sales_Model_Quote to inactive and delete
|
175 |
if ( $quote->getId() ) {
|
189 |
$quote->save();
|
190 |
}
|
191 |
}
|
192 |
+
|
193 |
// Display transaction_id and status
|
194 |
echo $data['transaction_id'] . '.' . $data['status'];
|
195 |
}
|
196 |
+
|
197 |
public function testAction () {
|
198 |
$base = Mage::getModel( 'cgp/base' );
|
199 |
switch ( $this->getRequest()->getParam('action') ) {
|
202 |
if ( $this->getRequest()->getParam('hash') != md5( $base->getConfigData( 'site_id' ) . $base->getConfigData( 'hash_key' ) ) ) {
|
203 |
die ( 'HASHKEY ERROR' );
|
204 |
}
|
205 |
+
|
206 |
/**
|
207 |
* @var Cardgate_Cgp_Model_Gateway_Default $gateway
|
208 |
*/
|
223 |
break;
|
224 |
}
|
225 |
}
|
226 |
+
|
227 |
public function versionAction () {
|
228 |
$base = Mage::getModel( 'cgp/base' );
|
229 |
if ( $this->getRequest()->getParam('hash') != md5( $base->getConfigData( 'site_id' ) . $base->getConfigData( 'hash_key' ) ) ) {
|
235 |
$gateway = Mage::getModel( 'cgp/gateway_default');
|
236 |
die ( json_encode( array ( 'plugin_version'=>$gateway->getPluginVersion(), 'magento_version'=>Mage::getVersion() ) ) );
|
237 |
}
|
238 |
+
|
239 |
+
public function resumeAction () {
|
240 |
+
$base = Mage::getModel( 'cgp/base' );
|
241 |
+
/**
|
242 |
+
*
|
243 |
+
* @var Mage_Checkout_Model_Session $session
|
244 |
+
*/
|
245 |
+
$session = Mage::getSingleton( 'checkout/session' );
|
246 |
+
|
247 |
+
$order_id = $this->getRequest()->getParam( 'order' );
|
248 |
+
if ( !$order_id ) {
|
249 |
+
$session->addError( $this->__( 'An error occurred' ) );
|
250 |
+
$this->_redirect( 'checkout/cart' );
|
251 |
+
$this->getResponse()->sendHeadersAndExit();
|
252 |
+
exit;
|
253 |
+
}
|
254 |
+
|
255 |
+
/**
|
256 |
+
*
|
257 |
+
* @var Mage_Sales_Model_Order $order
|
258 |
+
*/
|
259 |
+
$order = Mage::getSingleton( 'sales/order' )->loadByIncrementId( $order_id );
|
260 |
+
|
261 |
+
if ( $this->getRequest()->getParam('hash') != md5( $order->getCustomerEmail() . $base->getConfigData( 'site_id' ) . $base->getConfigData( 'hash_key' ) . $this->getRequest()->getParam( 'action' ) ) ) {
|
262 |
+
$session->addError( $this->__( 'A security error occurred' ) );
|
263 |
+
}
|
264 |
+
|
265 |
+
if ( !$order->getPayment() ) {
|
266 |
+
$this->resumeOrder( $order, true ); // This redirects the client.
|
267 |
+
exit; // We won't reach this statement.
|
268 |
+
}
|
269 |
+
|
270 |
+
if ( $order->getPayment() && $order->getPayment()->getAmountPaid() > 0 ) {
|
271 |
+
$session->addError( $this->__( 'This order is already paid.' ) );
|
272 |
+
$this->_redirect( 'checkout/cart' );
|
273 |
+
$this->getResponse()->sendHeadersAndExit();
|
274 |
+
exit;
|
275 |
+
}
|
276 |
+
|
277 |
+
switch ( $this->getRequest()->getParam( 'action' ) ) {
|
278 |
+
case "payment":
|
279 |
+
|
280 |
+
/**
|
281 |
+
*
|
282 |
+
* @var Cardgate_Cgp_Model_Gateway_Abstract $method
|
283 |
+
*/
|
284 |
+
$method = $order->getPayment()->getMethodInstance();
|
285 |
+
if (!$method || substr( $method->getCode(), 0, 4 ) != 'cgp_' ) {
|
286 |
+
$session->addWarning( $this->__( 'Payment method is not available. Please choose another method.' ) );
|
287 |
+
$this->resumeOrder( $order, true ); // This redirects the client.
|
288 |
+
exit; // We won't reach this statement.
|
289 |
+
}
|
290 |
+
$result = $method->register( $order );
|
291 |
+
if ( isset( $result['result'] ) && isset( $result['result']['payment'] ) && isset( $result['result']['payment']['issuer_auth_url'] ) ) {
|
292 |
+
$this->_redirectUrl( $result['result']['payment']['issuer_auth_url'] );
|
293 |
+
$this->getResponse()->sendHeadersAndExit();
|
294 |
+
exit; // We won't reach this statement.
|
295 |
+
} else {
|
296 |
+
$session->addWarning( $this->__( 'An exception occurred registering the transaction. Please try again.' ) );
|
297 |
+
$this->resumeOrder( $order, true ); // This redirects the client.
|
298 |
+
exit; // We won't reach this statement.
|
299 |
+
}
|
300 |
+
|
301 |
+
break;
|
302 |
+
|
303 |
+
case "checkout":
|
304 |
+
|
305 |
+
/**
|
306 |
+
*
|
307 |
+
* @var Cardgate_Cgp_Model_Gateway_Abstract $method
|
308 |
+
*/
|
309 |
+
$method = Mage::getModel( 'cgp/gateway_default');
|
310 |
+
$result = $method->register( $order, true );
|
311 |
+
if ( isset( $result['result'] ) && isset( $result['result']['payment'] ) && isset( $result['result']['payment']['issuer_auth_url'] ) ) {
|
312 |
+
$this->_redirectUrl( $result['result']['payment']['issuer_auth_url'] );
|
313 |
+
$this->getResponse()->sendHeadersAndExit();
|
314 |
+
exit; // We won't reach this statement.
|
315 |
+
} else {
|
316 |
+
$session->addWarning( $this->__( 'An exception occurred registering the transaction. Please try again.' ) );
|
317 |
+
$this->resumeOrder( $order, true ); // This redirects the client.
|
318 |
+
exit; // We won't reach this statement.
|
319 |
+
}
|
320 |
+
|
321 |
+
break;
|
322 |
+
}
|
323 |
+
|
324 |
+
$this->_redirect( 'checkout/cart' );
|
325 |
+
}
|
326 |
+
|
327 |
+
/**
|
328 |
+
*
|
329 |
+
* @param Mage_Sales_Model_Order $order
|
330 |
+
* @param bool $bDoLogin
|
331 |
+
*/
|
332 |
+
private function resumeOrder( $order, $bDoLogin=false ) {
|
333 |
+
/**
|
334 |
+
*
|
335 |
+
* @var Mage_Checkout_Model_Session $session
|
336 |
+
*/
|
337 |
+
$session = Mage::getSingleton( 'checkout/session' );
|
338 |
+
/**
|
339 |
+
*
|
340 |
+
* @var Mage_Sales_Model_Quote $quote
|
341 |
+
*/
|
342 |
+
$quote = Mage::getModel( 'sales/quote' )->load( $order->getQuoteId() );
|
343 |
+
if ( $quote ) {
|
344 |
+
$quote->setIsActive( true );
|
345 |
+
$quote->save();
|
346 |
+
/**
|
347 |
+
*
|
348 |
+
* @var Mage_Checkout_Model_Session $session
|
349 |
+
*/
|
350 |
+
$session->replaceQuote( $quote );
|
351 |
+
$session->getQuote()->setOrigOrderId( $order->getIncrementId() );
|
352 |
+
|
353 |
+
if ( $bDoLogin && $order->getCustomerId() ) {
|
354 |
+
$customer = Mage::getModel( 'customer/customer' )->load( $order->getCustomerId(), 'entity_id' );
|
355 |
+
/**
|
356 |
+
*
|
357 |
+
* @var Mage_Customer_Model_Session $custsession
|
358 |
+
*/
|
359 |
+
$custsession = Mage::getSingleton( 'customer/session' );
|
360 |
+
$custsession->setCustomer( $customer );
|
361 |
+
}
|
362 |
+
|
363 |
+
$session->addSuccess( $this->__( 'Your order is resumed.' ) );
|
364 |
+
}
|
365 |
+
|
366 |
+
$this->_redirect( 'checkout/cart' );
|
367 |
+
$this->getResponse()->sendHeadersAndExit();
|
368 |
+
}
|
369 |
+
|
370 |
}
|
app/code/local/Cardgate/Cgp/etc/config.xml
CHANGED
@@ -8,18 +8,32 @@
|
|
8 |
*/
|
9 |
-->
|
10 |
<config>
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
<rewrite>
|
24 |
<sales_order_totals>Cardgate_Cgp_Block_Paymentfee_Adminhtml_Sales_Order_Totals</sales_order_totals>
|
25 |
<sales_order_invoice_totals>Cardgate_Cgp_Block_Paymentfee_Adminhtml_Sales_Order_Totals</sales_order_invoice_totals>
|
@@ -33,435 +47,523 @@
|
|
33 |
<order_totals>Cardgate_Cgp_Block_Paymentfee_Order_Totals_Fee</order_totals>
|
34 |
</rewrite>
|
35 |
</sales>
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
|
|
69 |
<order_creditmemo>
|
70 |
-
|
71 |
<cgp_total>
|
72 |
<class>cgp/paymentfee_creditmemo_total</class>
|
73 |
<after>subtotal,discount,shipping,tax</after>
|
74 |
<before>cost_total,grand_total</before>
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
|
79 |
|
80 |
<order_invoice>
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
</sales>
|
88 |
-
|
89 |
<pdf>
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
<sales_order_payment_place_end>
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
<!--
|
142 |
<sales_order_load_after>
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
<events>
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
|
|
186 |
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
<cgp_cartebleue translate="title" module="cgp">
|
389 |
-
<active>0</active>
|
390 |
-
<model>cgp/gateway_cartebleue</model>
|
391 |
-
<title>Carte Bleue</title>
|
392 |
-
</cgp_cartebleue>
|
393 |
-
<cgp_cartebancaire translate="title" module="cgp">
|
394 |
-
<active>0</active>
|
395 |
-
<model>cgp/gateway_cartebancaire</model>
|
396 |
-
<title>Carte Bancaire</title>
|
397 |
-
</cgp_cartebancaire>
|
398 |
-
<cgp_vpay translate="title" module="cgp">
|
399 |
-
<active>0</active>
|
400 |
-
<model>cgp/gateway_vpay</model>
|
401 |
-
<title>V-Pay</title>
|
402 |
-
</cgp_vpay>
|
403 |
-
<cgp_sofortbanking translate="title" module="cgp">
|
404 |
-
<active>0</active>
|
405 |
-
<model>cgp/gateway_sofortbanking</model>
|
406 |
-
<title>SofortBanking</title>
|
407 |
-
</cgp_sofortbanking>
|
408 |
-
<cgp_ideal translate="title" module="cgp">
|
409 |
-
<active>0</active>
|
410 |
-
<model>cgp/gateway_ideal</model>
|
411 |
-
<title>iDEAL</title>
|
412 |
-
</cgp_ideal>
|
413 |
-
<cgp_mistercash translate="title" module="cgp">
|
414 |
-
<active>0</active>
|
415 |
-
<model>cgp/gateway_mistercash</model>
|
416 |
-
<title>MisterCash</title>
|
417 |
-
</cgp_mistercash>
|
418 |
-
<cgp_paypal translate="title" module="cgp">
|
419 |
-
<active>0</active>
|
420 |
-
<model>cgp/gateway_paypal</model>
|
421 |
-
<title>PayPal</title>
|
422 |
-
</cgp_paypal>
|
423 |
-
<cgp_webmoney translate="title" module="cgp">
|
424 |
-
<active>0</active>
|
425 |
-
<model>cgp/gateway_webmoney</model>
|
426 |
-
<title>Webmoney</title>
|
427 |
-
</cgp_webmoney>
|
428 |
-
<cgp_klarna translate="title" module="cgp">
|
429 |
-
<active>0</active>
|
430 |
-
<model>cgp/gateway_klarna</model>
|
431 |
-
<title>Klarna Invoice</title>
|
432 |
-
</cgp_klarna>
|
433 |
-
<cgp_klarnaaccount translate="title" module="cgp">
|
434 |
-
<active>0</active>
|
435 |
-
<model>cgp/gateway_klarnaaccount</model>
|
436 |
-
<title>Klarna Account</title>
|
437 |
-
</cgp_klarnaaccount>
|
438 |
-
<cgp_giropay translate="title" module="cgp">
|
439 |
-
<active>0</active>
|
440 |
-
<model>cgp/gateway_giropay</model>
|
441 |
-
<title>Giropay</title>
|
442 |
-
</cgp_giropay>
|
443 |
-
<cgp_banktransfer translate="title" module="cgp">
|
444 |
-
<active>0</active>
|
445 |
-
<model>cgp/gateway_banktransfer</model>
|
446 |
-
<title>Bank Transfer</title>
|
447 |
-
</cgp_banktransfer>
|
448 |
-
<cgp_directdebit translate="title" module="cgp">
|
449 |
-
<active>0</active>
|
450 |
-
<model>cgp/gateway_directdebit</model>
|
451 |
-
<title>Direct Debit</title>
|
452 |
-
</cgp_directdebit>
|
453 |
-
<cgp_przelewy24 translate="title" module="cgp">
|
454 |
-
<active>0</active>
|
455 |
-
<model>cgp/gateway_przelewy24</model>
|
456 |
-
<title>Przelewy24</title>
|
457 |
-
</cgp_przelewy24>
|
458 |
-
<cgp_afterpay translate="title" module="cgp">
|
459 |
-
<active>0</active>
|
460 |
-
<model>cgp/gateway_afterpay</model>
|
461 |
-
<title>Afterpay</title>
|
462 |
-
</cgp_afterpay>
|
463 |
-
</cgp>
|
464 |
-
</default>
|
465 |
|
466 |
|
467 |
</config>
|
8 |
*/
|
9 |
-->
|
10 |
<config>
|
11 |
+
<modules>
|
12 |
+
<Cardgate_Cgp>
|
13 |
+
<version>1.2.1</version>
|
14 |
+
</Cardgate_Cgp>
|
15 |
+
</modules>
|
16 |
+
|
17 |
+
<global>
|
18 |
+
<template>
|
19 |
+
<email>
|
20 |
+
<cgp_email_paymentlink_template translate="label" module="cgp">
|
21 |
+
<label>Send Paymentlink</label>
|
22 |
+
<file>cgp/paymentlink.html</file>
|
23 |
+
<type>html</type>
|
24 |
+
</cgp_email_paymentlink_template>
|
25 |
+
<cgp_email_paymentlink_guest_template translate="label" module="cgp">
|
26 |
+
<label>Send Paymentlink for Guest</label>
|
27 |
+
<file>cgp/paymentlink_guest.html</file>
|
28 |
+
<type>html</type>
|
29 |
+
</cgp_email_paymentlink_guest_template>
|
30 |
+
</email>
|
31 |
+
</template>
|
32 |
+
<blocks>
|
33 |
+
<cgp>
|
34 |
+
<class>Cardgate_Cgp_Block</class>
|
35 |
+
</cgp>
|
36 |
+
<adminhtml>
|
37 |
<rewrite>
|
38 |
<sales_order_totals>Cardgate_Cgp_Block_Paymentfee_Adminhtml_Sales_Order_Totals</sales_order_totals>
|
39 |
<sales_order_invoice_totals>Cardgate_Cgp_Block_Paymentfee_Adminhtml_Sales_Order_Totals</sales_order_invoice_totals>
|
47 |
<order_totals>Cardgate_Cgp_Block_Paymentfee_Order_Totals_Fee</order_totals>
|
48 |
</rewrite>
|
49 |
</sales>
|
50 |
+
</blocks>
|
51 |
+
<helpers>
|
52 |
+
<cgp>
|
53 |
+
<class>Cardgate_Cgp_Helper</class>
|
54 |
+
</cgp>
|
55 |
+
</helpers>
|
56 |
+
|
57 |
+
<models>
|
58 |
+
<cgp>
|
59 |
+
<class>Cardgate_Cgp_Model</class>
|
60 |
+
</cgp>
|
61 |
+
<sales>
|
62 |
+
<rewrite>Mage_Sales_Model_Order_Payment
|
63 |
+
<quote>Cardgate_Cgp_Model_Paymentfee_Quote_Quote</quote>
|
64 |
+
<order_invoice_total_tax>Cardgate_Cgp_Model_Paymentfee_Invoice_Tax</order_invoice_total_tax>
|
65 |
+
</rewrite>
|
66 |
+
</sales>
|
67 |
+
</models>
|
68 |
+
|
69 |
+
<sales>
|
70 |
+
<quote>
|
71 |
+
<totals>
|
72 |
+
<cgp_fee>
|
73 |
+
<class>cgp/paymentfee_quote_total</class>
|
74 |
+
<after>subtotal,discount,shipping</after>
|
75 |
+
<before>tax,grand_total</before>
|
76 |
+
<renderer>cgp/paymentfee_checkout_fee</renderer>
|
77 |
+
</cgp_fee>
|
78 |
+
<cgp_tax>
|
79 |
+
<class>cgp/paymentfee_quote_taxTotal</class>
|
80 |
+
<after>subtotal,discount,shipping,tax</after>
|
81 |
+
<before>grand_total</before>
|
82 |
+
</cgp_tax>
|
83 |
+
</totals>
|
84 |
+
</quote>
|
85 |
<order_creditmemo>
|
86 |
+
<totals>
|
87 |
<cgp_total>
|
88 |
<class>cgp/paymentfee_creditmemo_total</class>
|
89 |
<after>subtotal,discount,shipping,tax</after>
|
90 |
<before>cost_total,grand_total</before>
|
91 |
+
</cgp_total>
|
92 |
+
</totals>
|
93 |
+
</order_creditmemo>
|
94 |
|
95 |
|
96 |
<order_invoice>
|
97 |
+
<totals>
|
98 |
+
<cgp_total>
|
99 |
+
<class>cgp/paymentfee_invoice_total</class>
|
100 |
+
</cgp_total>
|
101 |
+
</totals>
|
102 |
+
</order_invoice>
|
103 |
</sales>
|
104 |
+
|
105 |
<pdf>
|
106 |
+
<totals>
|
107 |
+
<invoice_fee translate="title">
|
108 |
+
<title>Invoice fee</title>
|
109 |
+
<source_field>cgp</source_field>
|
110 |
+
<font_size>7</font_size>
|
111 |
+
<display_zero>1</display_zero>
|
112 |
+
<sort_order>550</sort_order>
|
113 |
+
<model>cgp/paymentfee_invoice_pdf_total</model>
|
114 |
+
</invoice_fee>
|
115 |
+
</totals>
|
116 |
+
</pdf>
|
117 |
+
<resources>
|
118 |
+
<cgp_setup>
|
119 |
+
<setup>
|
120 |
+
<module>Cardgate_Cgp</module>
|
121 |
+
</setup>
|
122 |
+
<connection>
|
123 |
+
<use>core_setup</use>
|
124 |
+
</connection>
|
125 |
+
</cgp_setup>
|
126 |
+
<cgp_read>
|
127 |
+
<connection>
|
128 |
+
<use>core_read</use>
|
129 |
+
</connection>
|
130 |
+
</cgp_read>
|
131 |
+
<cgp_write>
|
132 |
+
<connection>
|
133 |
+
<use>core_write</use>
|
134 |
+
</connection>
|
135 |
+
</cgp_write>
|
136 |
+
</resources>
|
137 |
+
<events>
|
138 |
+
<sales_quote_collect_totals_after>
|
139 |
+
<observers>
|
140 |
+
<cgp>
|
141 |
+
<type>singleton</type>
|
142 |
+
<class>cgp/observer</class>
|
143 |
+
<method>salesQuoteCollectTotalsAfter</method>
|
144 |
+
</cgp>
|
145 |
+
</observers>
|
146 |
+
</sales_quote_collect_totals_after>
|
147 |
+
|
148 |
<sales_order_payment_place_end>
|
149 |
+
<observers>
|
150 |
+
<cgp>
|
151 |
+
<type>singleton</type>
|
152 |
+
<class>cgp/observer</class>
|
153 |
+
<method>salesOrderPaymentPlaceEnd</method>
|
154 |
+
</cgp>
|
155 |
+
</observers>
|
156 |
+
</sales_order_payment_place_end>
|
157 |
<!--
|
158 |
<sales_order_load_after>
|
159 |
+
<observers>
|
160 |
+
<cgp>
|
161 |
+
<type>singleton</type>
|
162 |
+
<class>cgp/observer</class>
|
163 |
+
<method>salesOrderLoadAfter</method>
|
164 |
+
</cgp>
|
165 |
+
</observers>
|
166 |
+
</sales_order_load_after>-->
|
167 |
+
</events>
|
168 |
+
</global>
|
169 |
+
|
170 |
+
<adminhtml>
|
171 |
<events>
|
172 |
+
<sales_quote_collect_totals_after>
|
173 |
+
<observers>
|
174 |
+
<cgp>
|
175 |
+
<type>singleton</type>
|
176 |
+
<class>cgp/observer</class>
|
177 |
+
<method>salesQuoteCollectTotalsAfter</method>
|
178 |
+
</cgp>
|
179 |
+
</observers>
|
180 |
+
</sales_quote_collect_totals_after>
|
181 |
+
|
182 |
+
<sales_order_payment_place_end>
|
183 |
+
<observers>
|
184 |
+
<cgp>
|
185 |
+
<type>singleton</type>
|
186 |
+
<class>cgp/observer</class>
|
187 |
+
<method>salesOrderPaymentPlaceEnd</method>
|
188 |
+
</cgp>
|
189 |
+
</observers>
|
190 |
+
</sales_order_payment_place_end>
|
191 |
+
|
192 |
+
<create_order_session_quote_initialized>
|
193 |
+
<observers>
|
194 |
+
<cgp>
|
195 |
+
<type>singleton</type>
|
196 |
+
<class>cgp/observer</class>
|
197 |
+
<method>initFromOrderSessionQuoteInitialized</method>
|
198 |
+
</cgp>
|
199 |
+
</observers>
|
200 |
+
</create_order_session_quote_initialized>
|
201 |
+
|
202 |
+
<checkout_submit_all_after>
|
203 |
+
<observers>
|
204 |
+
<cgp>
|
205 |
+
<type>singleton</type>
|
206 |
+
<class>cgp/observer</class>
|
207 |
+
<method>adminhtmlCheckoutSubmitAllAfter</method>
|
208 |
+
</cgp>
|
209 |
+
</observers>
|
210 |
+
</checkout_submit_all_after>
|
211 |
+
</events>
|
212 |
+
|
213 |
+
<acl>
|
214 |
+
<resources>
|
215 |
+
<admin>
|
216 |
+
<children>
|
217 |
+
<system>
|
218 |
+
<children>
|
219 |
+
<config>
|
220 |
+
<children>
|
221 |
+
<cgp>
|
222 |
+
<title>CardGate Settings</title>
|
223 |
+
</cgp>
|
224 |
+
</children>
|
225 |
+
</config>
|
226 |
+
</children>
|
227 |
+
</system>
|
228 |
+
</children>
|
229 |
+
</admin>
|
230 |
+
</resources>
|
231 |
+
</acl>
|
232 |
+
|
233 |
+
<translate>
|
234 |
+
<modules>
|
235 |
+
<Cardgate_Cgp>
|
236 |
+
<files>
|
237 |
+
<default>Cardgate_Cgp.csv</default>
|
238 |
+
</files>
|
239 |
+
</Cardgate_Cgp>
|
240 |
+
</modules>
|
241 |
+
</translate>
|
242 |
+
|
243 |
+
<layout>
|
244 |
+
<updates>
|
245 |
+
<cgp>
|
246 |
+
<file>cardgate.xml</file>
|
247 |
+
</cgp>
|
248 |
+
</updates>
|
249 |
+
</layout>
|
250 |
+
|
251 |
+
<acl>
|
252 |
+
<resources>
|
253 |
+
<admin>
|
254 |
+
<children>
|
255 |
+
<system>
|
256 |
+
<children>
|
257 |
+
<config>
|
258 |
+
<children>
|
259 |
+
<cgp>
|
260 |
+
<title>CardGate+ Settings</title>
|
261 |
+
</cgp>
|
262 |
+
</children>
|
263 |
+
</config>
|
264 |
+
</children>
|
265 |
+
</system>
|
266 |
+
</children>
|
267 |
+
</admin>
|
268 |
+
</resources>
|
269 |
+
</acl>
|
270 |
+
</adminhtml>
|
271 |
+
|
272 |
+
<admin>
|
273 |
+
<routers>
|
274 |
+
<adminhtml>
|
275 |
+
<args>
|
276 |
+
<modules>
|
277 |
+
<Cardgate_Cgp before="Mage_Adminhtml">Cardgate_Cgp_Adminhtml</Cardgate_Cgp>
|
278 |
+
</modules>
|
279 |
+
</args>
|
280 |
+
</adminhtml>
|
281 |
+
</routers>
|
282 |
+
</admin>
|
283 |
|
284 |
+
<frontend>
|
285 |
+
<routers>
|
286 |
+
<cgp>
|
287 |
+
<use>standard</use>
|
288 |
+
<args>
|
289 |
+
<module>Cardgate_Cgp</module>
|
290 |
+
<frontName>cgp</frontName>
|
291 |
+
</args>
|
292 |
+
</cgp>
|
293 |
+
</routers>
|
294 |
+
<translate>
|
295 |
+
<modules>
|
296 |
+
<Cardgate_Cgp>
|
297 |
+
<files>
|
298 |
+
<default>Cardgate_Cgp.csv</default>
|
299 |
+
</files>
|
300 |
+
</Cardgate_Cgp>
|
301 |
+
</modules>
|
302 |
+
</translate>
|
303 |
+
</frontend>
|
304 |
|
305 |
+
<default>
|
306 |
+
<payment>
|
307 |
+
<cgp_visa>
|
308 |
+
<active>1</active>
|
309 |
+
<model>cgp/gateway_visa</model>
|
310 |
+
<title>CGP Visa</title>
|
311 |
+
</cgp_visa>
|
312 |
+
<cgp_mastercard>
|
313 |
+
<active>1</active>
|
314 |
+
<model>cgp/gateway_mastercard</model>
|
315 |
+
<title>CGP MasterCard</title>
|
316 |
+
</cgp_mastercard>
|
317 |
+
<cgp_americanexpress>
|
318 |
+
<active>1</active>
|
319 |
+
<model>cgp/gateway_americanexpress</model>
|
320 |
+
<title>CGP AmericanExpress</title>
|
321 |
+
</cgp_americanexpress>
|
322 |
+
<cgp_maestro>
|
323 |
+
<active>1</active>
|
324 |
+
<model>cgp/gateway_maestro</model>
|
325 |
+
<title>CGP Maestro</title>
|
326 |
+
</cgp_maestro>
|
327 |
+
<cgp_cartebleue>
|
328 |
+
<active>1</active>
|
329 |
+
<model>cgp/gateway_cartebleue</model>
|
330 |
+
<title>CGP CarteBleue</title>
|
331 |
+
</cgp_cartebleue>
|
332 |
+
<cgp_cartebancaire>
|
333 |
+
<active>1</active>
|
334 |
+
<model>cgp/gateway_cartebancaire</model>
|
335 |
+
<title>CGP CarteBancaire</title>
|
336 |
+
</cgp_cartebancaire>
|
337 |
+
<cgp_vpay>
|
338 |
+
<active>1</active>
|
339 |
+
<model>cgp/gateway_vpay</model>
|
340 |
+
<title>CGP V-Pay</title>
|
341 |
+
</cgp_vpay>
|
342 |
+
<cgp_sofortbanking>
|
343 |
+
<active>1</active>
|
344 |
+
<model>cgp/gateway_sofortbanking</model>
|
345 |
+
<title>CGP SofortBanking</title>
|
346 |
+
</cgp_sofortbanking>
|
347 |
+
<cgp_ideal>
|
348 |
+
<active>1</active>
|
349 |
+
<model>cgp/gateway_ideal</model>
|
350 |
+
<title>CGP iDEAL</title>
|
351 |
+
</cgp_ideal>
|
352 |
+
<cgp_mistercash>
|
353 |
+
<active>1</active>
|
354 |
+
<model>cgp/gateway_mistercash</model>
|
355 |
+
<title>CGP Bancontact</title>
|
356 |
+
</cgp_mistercash>
|
357 |
+
<cgp_paypal>
|
358 |
+
<active>1</active>
|
359 |
+
<model>cgp/gateway_paypal</model>
|
360 |
+
<title>CGP PayPal</title>
|
361 |
+
</cgp_paypal>
|
362 |
+
<cgp_webmoney>
|
363 |
+
<active>1</active>
|
364 |
+
<model>cgp/gateway_webmoney</model>
|
365 |
+
<title>CGP Webmoney</title>
|
366 |
+
</cgp_webmoney>
|
367 |
+
<cgp_klarna>
|
368 |
+
<active>1</active>
|
369 |
+
<model>cgp/gateway_klarna</model>
|
370 |
+
<title>CGP KlarnaInvoice</title>
|
371 |
+
</cgp_klarna>
|
372 |
+
<cgp_klarnaaccount>
|
373 |
+
<active>1</active>
|
374 |
+
<model>cgp/gateway_klarnaaccount</model>
|
375 |
+
<title>CGP KlarnaAccount</title>
|
376 |
+
</cgp_klarnaaccount>
|
377 |
+
<cgp_giropay>
|
378 |
+
<active>1</active>
|
379 |
+
<model>cgp/gateway_giropay</model>
|
380 |
+
<title>CGP Giropay</title>
|
381 |
+
</cgp_giropay>
|
382 |
+
<cgp_banktransfer>
|
383 |
+
<active>1</active>
|
384 |
+
<model>cgp/gateway_banktransfer</model>
|
385 |
+
<title>CGP Bank Transfer</title>
|
386 |
+
</cgp_banktransfer>
|
387 |
+
<cgp_directdebit>
|
388 |
+
<active>1</active>
|
389 |
+
<model>cgp/gateway_directdebit</model>
|
390 |
+
<title>CGP Direct Debit</title>
|
391 |
+
</cgp_directdebit>
|
392 |
+
<cgp_przelewy24>
|
393 |
+
<active>1</active>
|
394 |
+
<model>cgp/gateway_przelewy24</model>
|
395 |
+
<title>CGP Przelewy24</title>
|
396 |
+
</cgp_przelewy24>
|
397 |
+
<cgp_afterpay>
|
398 |
+
<active>1</active>
|
399 |
+
<model>cgp/gateway_afterpay</model>
|
400 |
+
<title>CGP Afterpay</title>
|
401 |
+
</cgp_afterpay>
|
402 |
+
<cgp_bitcoin>
|
403 |
+
<active>1</active>
|
404 |
+
<model>cgp/gateway_bitcoin</model>
|
405 |
+
<title>CGP Bitcoin</title>
|
406 |
+
</cgp_bitcoin>
|
407 |
+
<cgp_pos>
|
408 |
+
<active>1</active>
|
409 |
+
<model>cgp/gateway_pos</model>
|
410 |
+
<title>CGP POS</title>
|
411 |
+
</cgp_pos>
|
412 |
+
<cgp_paysafecard>
|
413 |
+
<active>1</active>
|
414 |
+
<model>cgp/gateway_paysafecard</model>
|
415 |
+
<title>CGP Paysafecard</title>
|
416 |
+
</cgp_paysafecard>
|
417 |
+
<cgp_idealqr>
|
418 |
+
<active>1</active>
|
419 |
+
<model>cgp/gateway_idealqr</model>
|
420 |
+
<title>CGP iDEAL QR</title>
|
421 |
+
</cgp_idealqr>
|
422 |
+
</payment>
|
423 |
|
424 |
+
<cgp>
|
425 |
+
<settings>
|
426 |
+
<active>0</active>
|
427 |
+
<lang>nl</lang>
|
428 |
+
<initialized_status>pending</initialized_status>
|
429 |
+
<complete_status>processing</complete_status>
|
430 |
+
<waitconf_status>pending_payment</waitconf_status>
|
431 |
+
<failed_status>canceled</failed_status>
|
432 |
+
<fraud_status>fraud</fraud_status>
|
433 |
+
<use_backoffice_urls>0</use_backoffice_urls>
|
434 |
+
<orderemail_at_payment>1</orderemail_at_payment>
|
435 |
+
<autocreate_invoice>1</autocreate_invoice>
|
436 |
+
<mail_invoice>1</mail_invoice>
|
437 |
+
<notification_email>general</notification_email>
|
438 |
+
<event_invoicing_failed>0</event_invoicing_failed>
|
439 |
+
<order_description>Order %id%</order_description>
|
440 |
+
<test_mode>test</test_mode>
|
441 |
+
<debug>1</debug>
|
442 |
+
</settings>
|
443 |
+
<email_paymentlink>
|
444 |
+
<enabled>1</enabled>
|
445 |
+
<template>cgp_email_paymentlink_template</template>
|
446 |
+
<guest_template>cgp_email_paymentlink_guest_template</guest_template>
|
447 |
+
<identity>sales</identity>
|
448 |
+
<copy_method>bcc</copy_method>
|
449 |
+
</email_paymentlink>
|
450 |
+
<cgp_visa translate="title" module="cgp">
|
451 |
+
<active>0</active>
|
452 |
+
<model>cgp/gateway_visa</model>
|
453 |
+
<title>Visa</title>
|
454 |
+
</cgp_visa>
|
455 |
+
<cgp_mastercard translate="title" module="cgp">
|
456 |
+
<active>0</active>
|
457 |
+
<model>cgp/gateway_mastercard</model>
|
458 |
+
<title>MasterCard</title>
|
459 |
+
</cgp_mastercard>
|
460 |
+
<cgp_americanexpress translate="title" module="cgp">
|
461 |
+
<active>0</active>
|
462 |
+
<model>cgp/gateway_americanexpress</model>
|
463 |
+
<title>AmericanExpress</title>
|
464 |
+
</cgp_americanexpress>
|
465 |
+
<cgp_maestro translate="title" module="cgp">
|
466 |
+
<active>0</active>
|
467 |
+
<model>cgp/gateway_maestro</model>
|
468 |
+
<title>Maestro</title>
|
469 |
+
</cgp_maestro>
|
470 |
+
<cgp_cartebleue translate="title" module="cgp">
|
471 |
+
<active>0</active>
|
472 |
+
<model>cgp/gateway_cartebleue</model>
|
473 |
+
<title>Carte Bleue</title>
|
474 |
+
</cgp_cartebleue>
|
475 |
+
<cgp_cartebancaire translate="title" module="cgp">
|
476 |
+
<active>0</active>
|
477 |
+
<model>cgp/gateway_cartebancaire</model>
|
478 |
+
<title>Carte Bancaire</title>
|
479 |
+
</cgp_cartebancaire>
|
480 |
+
<cgp_vpay translate="title" module="cgp">
|
481 |
+
<active>0</active>
|
482 |
+
<model>cgp/gateway_vpay</model>
|
483 |
+
<title>V-Pay</title>
|
484 |
+
</cgp_vpay>
|
485 |
+
<cgp_sofortbanking translate="title" module="cgp">
|
486 |
+
<active>0</active>
|
487 |
+
<model>cgp/gateway_sofortbanking</model>
|
488 |
+
<title>SofortBanking</title>
|
489 |
+
</cgp_sofortbanking>
|
490 |
+
<cgp_ideal translate="title" module="cgp">
|
491 |
+
<active>0</active>
|
492 |
+
<model>cgp/gateway_ideal</model>
|
493 |
+
<title>iDEAL</title>
|
494 |
+
</cgp_ideal>
|
495 |
+
<cgp_mistercash translate="title" module="cgp">
|
496 |
+
<active>0</active>
|
497 |
+
<model>cgp/gateway_mistercash</model>
|
498 |
+
<title>Bancontact/Mistercash</title>
|
499 |
+
</cgp_mistercash>
|
500 |
+
<cgp_paypal translate="title" module="cgp">
|
501 |
+
<active>0</active>
|
502 |
+
<model>cgp/gateway_paypal</model>
|
503 |
+
<title>PayPal</title>
|
504 |
+
</cgp_paypal>
|
505 |
+
<cgp_webmoney translate="title" module="cgp">
|
506 |
+
<active>0</active>
|
507 |
+
<model>cgp/gateway_webmoney</model>
|
508 |
+
<title>Webmoney</title>
|
509 |
+
</cgp_webmoney>
|
510 |
+
<cgp_klarna translate="title" module="cgp">
|
511 |
+
<active>0</active>
|
512 |
+
<model>cgp/gateway_klarna</model>
|
513 |
+
<title>Klarna Invoice</title>
|
514 |
+
</cgp_klarna>
|
515 |
+
<cgp_klarnaaccount translate="title" module="cgp">
|
516 |
+
<active>0</active>
|
517 |
+
<model>cgp/gateway_klarnaaccount</model>
|
518 |
+
<title>Klarna Account</title>
|
519 |
+
</cgp_klarnaaccount>
|
520 |
+
<cgp_giropay translate="title" module="cgp">
|
521 |
+
<active>0</active>
|
522 |
+
<model>cgp/gateway_giropay</model>
|
523 |
+
<title>Giropay</title>
|
524 |
+
</cgp_giropay>
|
525 |
+
<cgp_banktransfer translate="title" module="cgp">
|
526 |
+
<active>0</active>
|
527 |
+
<model>cgp/gateway_banktransfer</model>
|
528 |
+
<title>Bank Transfer</title>
|
529 |
+
</cgp_banktransfer>
|
530 |
+
<cgp_directdebit translate="title" module="cgp">
|
531 |
+
<active>0</active>
|
532 |
+
<model>cgp/gateway_directdebit</model>
|
533 |
+
<title>Direct Debit</title>
|
534 |
+
</cgp_directdebit>
|
535 |
+
<cgp_przelewy24 translate="title" module="cgp">
|
536 |
+
<active>0</active>
|
537 |
+
<model>cgp/gateway_przelewy24</model>
|
538 |
+
<title>Przelewy24</title>
|
539 |
+
</cgp_przelewy24>
|
540 |
+
<cgp_afterpay translate="title" module="cgp">
|
541 |
+
<active>0</active>
|
542 |
+
<model>cgp/gateway_afterpay</model>
|
543 |
+
<title>Afterpay</title>
|
544 |
+
</cgp_afterpay>
|
545 |
+
<cgp_bitcoin translate="title" module="cgp">
|
546 |
+
<active>0</active>
|
547 |
+
<model>cgp/gateway_bitcoin</model>
|
548 |
+
<title>Bitcoin</title>
|
549 |
+
</cgp_bitcoin>
|
550 |
+
<cgp_pos translate="title" module="cgp">
|
551 |
+
<active>0</active>
|
552 |
+
<model>cgp/gateway_pos</model>
|
553 |
+
<title>POS</title>
|
554 |
+
</cgp_pos>
|
555 |
+
<cgp_paysafecard translate="title" module="cgp">
|
556 |
+
<active>0</active>
|
557 |
+
<model>cgp/gateway_paysafecard</model>
|
558 |
+
<title>paysafecard</title>
|
559 |
+
</cgp_paysafecard>
|
560 |
+
<cgp_idealqr translate="title" module="cgp">
|
561 |
+
<active>0</active>
|
562 |
+
<model>cgp/gateway_idealqr</model>
|
563 |
+
<title>iDEAL QR via je mobiel</title>
|
564 |
+
</cgp_idealqr>
|
565 |
+
</cgp>
|
566 |
+
</default>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
567 |
|
568 |
|
569 |
</config>
|
app/code/local/Cardgate/Cgp/etc/system.xml
CHANGED
@@ -253,6 +253,62 @@
|
|
253 |
</fields>
|
254 |
</settings>
|
255 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
<cgp_visa translate="label" module="cgp">
|
257 |
<label>Visa</label>
|
258 |
<sort_order>200</sort_order>
|
@@ -2058,6 +2114,272 @@
|
|
2058 |
</fields>
|
2059 |
</cgp_bitcoin>
|
2060 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2061 |
</groups>
|
2062 |
</cgp>
|
2063 |
|
253 |
</fields>
|
254 |
</settings>
|
255 |
|
256 |
+
<email_paymentlink translate="comment">
|
257 |
+
<label>Betaallink Email</label>
|
258 |
+
<sort_order>2</sort_order>
|
259 |
+
<show_in_default>1</show_in_default>
|
260 |
+
<show_in_website>1</show_in_website>
|
261 |
+
<show_in_store>1</show_in_store>
|
262 |
+
<fields>
|
263 |
+
<identity translate="label">
|
264 |
+
<label>New Order Confirmation Email Sender</label>
|
265 |
+
<frontend_type>select</frontend_type>
|
266 |
+
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
267 |
+
<sort_order>1</sort_order>
|
268 |
+
<show_in_default>1</show_in_default>
|
269 |
+
<show_in_website>1</show_in_website>
|
270 |
+
<show_in_store>1</show_in_store>
|
271 |
+
</identity>
|
272 |
+
<template translate="label">
|
273 |
+
<label>New Order Confirmation Template</label>
|
274 |
+
<frontend_type>select</frontend_type>
|
275 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
276 |
+
<sort_order>2</sort_order>
|
277 |
+
<show_in_default>1</show_in_default>
|
278 |
+
<show_in_website>1</show_in_website>
|
279 |
+
<show_in_store>1</show_in_store>
|
280 |
+
</template>
|
281 |
+
<guest_template translate="label">
|
282 |
+
<label>New Order Confirmation Template for Guest</label>
|
283 |
+
<frontend_type>select</frontend_type>
|
284 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
285 |
+
<sort_order>3</sort_order>
|
286 |
+
<show_in_default>1</show_in_default>
|
287 |
+
<show_in_website>1</show_in_website>
|
288 |
+
<show_in_store>1</show_in_store>
|
289 |
+
</guest_template>
|
290 |
+
<copy_to translate="label comment">
|
291 |
+
<label>Send Order Email Copy To</label>
|
292 |
+
<frontend_type>text</frontend_type>
|
293 |
+
<sort_order>4</sort_order>
|
294 |
+
<show_in_default>1</show_in_default>
|
295 |
+
<show_in_website>1</show_in_website>
|
296 |
+
<show_in_store>1</show_in_store>
|
297 |
+
<comment>Comma-separated.</comment>
|
298 |
+
</copy_to>
|
299 |
+
<copy_method translate="label">
|
300 |
+
<label>Send Order Email Copy Method</label>
|
301 |
+
<frontend_type>select</frontend_type>
|
302 |
+
<source_model>adminhtml/system_config_source_email_method</source_model>
|
303 |
+
<sort_order>5</sort_order>
|
304 |
+
<show_in_default>1</show_in_default>
|
305 |
+
<show_in_website>1</show_in_website>
|
306 |
+
<show_in_store>1</show_in_store>
|
307 |
+
</copy_method>
|
308 |
+
</fields>
|
309 |
+
</email_paymentlink>
|
310 |
+
|
311 |
+
|
312 |
<cgp_visa translate="label" module="cgp">
|
313 |
<label>Visa</label>
|
314 |
<sort_order>200</sort_order>
|
2114 |
</fields>
|
2115 |
</cgp_bitcoin>
|
2116 |
|
2117 |
+
|
2118 |
+
<cgp_pos translate="label" module="cgp">
|
2119 |
+
<label>POS</label>
|
2120 |
+
<sort_order>400</sort_order>
|
2121 |
+
<show_in_default>1</show_in_default>
|
2122 |
+
<show_in_website>1</show_in_website>
|
2123 |
+
<show_in_store>1</show_in_store>
|
2124 |
+
<fields>
|
2125 |
+
<active translate="label">
|
2126 |
+
<label>Enabled</label>
|
2127 |
+
<frontend_type>select</frontend_type>
|
2128 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
2129 |
+
<sort_order>1</sort_order>
|
2130 |
+
<show_in_default>1</show_in_default>
|
2131 |
+
<show_in_website>1</show_in_website>
|
2132 |
+
<show_in_store>1</show_in_store>
|
2133 |
+
</active>
|
2134 |
+
<title translate="label">
|
2135 |
+
<label>Title</label>
|
2136 |
+
<frontend_type>text</frontend_type>
|
2137 |
+
<sort_order>10</sort_order>
|
2138 |
+
<show_in_default>1</show_in_default>
|
2139 |
+
<show_in_website>1</show_in_website>
|
2140 |
+
<show_in_store>1</show_in_store>
|
2141 |
+
</title>
|
2142 |
+
<allowspecific translate="label">
|
2143 |
+
<label>Payment from applicable countries</label>
|
2144 |
+
<frontend_type>allowspecific</frontend_type>
|
2145 |
+
<sort_order>20</sort_order>
|
2146 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
2147 |
+
<show_in_default>1</show_in_default>
|
2148 |
+
<show_in_website>1</show_in_website>
|
2149 |
+
<show_in_store>1</show_in_store>
|
2150 |
+
</allowspecific>
|
2151 |
+
<specificcountry translate="label">
|
2152 |
+
<label>Payment from Specific countries</label>
|
2153 |
+
<frontend_type>multiselect</frontend_type>
|
2154 |
+
<sort_order>30</sort_order>
|
2155 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
2156 |
+
<show_in_default>1</show_in_default>
|
2157 |
+
<show_in_website>1</show_in_website>
|
2158 |
+
<show_in_store>1</show_in_store>
|
2159 |
+
</specificcountry>
|
2160 |
+
<sort_order translate="label">
|
2161 |
+
<label>Sort order</label>
|
2162 |
+
<frontend_type>text</frontend_type>
|
2163 |
+
<sort_order>100</sort_order>
|
2164 |
+
<show_in_default>1</show_in_default>
|
2165 |
+
<show_in_website>1</show_in_website>
|
2166 |
+
<show_in_store>1</show_in_store>
|
2167 |
+
</sort_order>
|
2168 |
+
<payment_fee translate="label">
|
2169 |
+
<label>Payment fee</label>
|
2170 |
+
<sort_order>110</sort_order>
|
2171 |
+
<show_in_default>1</show_in_default>
|
2172 |
+
<show_in_website>1</show_in_website>
|
2173 |
+
<show_in_store>1</show_in_store>
|
2174 |
+
<comment>Payment fee amount. A positive amount will be used as a fixed amount, a negative amount as percentage. Using both is also possible by separation with a semicolon. Eg. 0.30;-1.2 results in 30 cents + 1.2% of the order amount.</comment>
|
2175 |
+
</payment_fee>
|
2176 |
+
<payment_fee_tax translate="label">
|
2177 |
+
<label>Payment fee tax class</label>
|
2178 |
+
<frontend_type>select</frontend_type>
|
2179 |
+
<source_model>adminhtml/system_config_source_shipping_taxclass</source_model>
|
2180 |
+
<sort_order>120</sort_order>
|
2181 |
+
<show_in_default>1</show_in_default>
|
2182 |
+
<show_in_store>1</show_in_store>
|
2183 |
+
<show_in_website>1</show_in_website>
|
2184 |
+
<comment>Choose the fee's tax class</comment>
|
2185 |
+
</payment_fee_tax>
|
2186 |
+
<payment_fee_inc_ex translate="label">
|
2187 |
+
<label>Including/Excluding Tax</label>
|
2188 |
+
<frontend_type>select</frontend_type>
|
2189 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
2190 |
+
<sort_order>130</sort_order>
|
2191 |
+
<show_in_default>1</show_in_default>
|
2192 |
+
<show_in_website>1</show_in_website>
|
2193 |
+
<show_in_store>1</show_in_store>
|
2194 |
+
<comment>Yes = fee entered including tax / No = fee entered excluding tax</comment>
|
2195 |
+
</payment_fee_inc_ex>
|
2196 |
+
<payment_fee_label translate="label,comment">
|
2197 |
+
<label>Payment fee label</label>
|
2198 |
+
<sort_order>140</sort_order>
|
2199 |
+
<show_in_default>1</show_in_default>
|
2200 |
+
<show_in_website>1</show_in_website>
|
2201 |
+
<show_in_store>1</show_in_store>
|
2202 |
+
<comment>Short description which is shown on orders/invoices</comment>
|
2203 |
+
</payment_fee_label>
|
2204 |
+
</fields>
|
2205 |
+
</cgp_pos>
|
2206 |
+
|
2207 |
+
<cgp_paysafecard translate="label" module="cgp">
|
2208 |
+
<label>paysafecard</label><!-- Yeah. No typo here, it's fully lowercase... -->
|
2209 |
+
<sort_order>410</sort_order>
|
2210 |
+
<show_in_default>1</show_in_default>
|
2211 |
+
<show_in_website>1</show_in_website>
|
2212 |
+
<show_in_store>1</show_in_store>
|
2213 |
+
<fields>
|
2214 |
+
<active translate="label">
|
2215 |
+
<label>Enabled</label>
|
2216 |
+
<frontend_type>select</frontend_type>
|
2217 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
2218 |
+
<sort_order>1</sort_order>
|
2219 |
+
<show_in_default>1</show_in_default>
|
2220 |
+
<show_in_website>1</show_in_website>
|
2221 |
+
<show_in_store>1</show_in_store>
|
2222 |
+
</active>
|
2223 |
+
<title translate="label">
|
2224 |
+
<label>Title</label>
|
2225 |
+
<frontend_type>text</frontend_type>
|
2226 |
+
<sort_order>10</sort_order>
|
2227 |
+
<show_in_default>1</show_in_default>
|
2228 |
+
<show_in_website>1</show_in_website>
|
2229 |
+
<show_in_store>1</show_in_store>
|
2230 |
+
</title>
|
2231 |
+
<allowspecific translate="label">
|
2232 |
+
<label>Payment from applicable countries</label>
|
2233 |
+
<frontend_type>allowspecific</frontend_type>
|
2234 |
+
<sort_order>20</sort_order>
|
2235 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
2236 |
+
<show_in_default>1</show_in_default>
|
2237 |
+
<show_in_website>1</show_in_website>
|
2238 |
+
<show_in_store>1</show_in_store>
|
2239 |
+
</allowspecific>
|
2240 |
+
<specificcountry translate="label">
|
2241 |
+
<label>Payment from Specific countries</label>
|
2242 |
+
<frontend_type>multiselect</frontend_type>
|
2243 |
+
<sort_order>30</sort_order>
|
2244 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
2245 |
+
<show_in_default>1</show_in_default>
|
2246 |
+
<show_in_website>1</show_in_website>
|
2247 |
+
<show_in_store>1</show_in_store>
|
2248 |
+
</specificcountry>
|
2249 |
+
<sort_order translate="label">
|
2250 |
+
<label>Sort order</label>
|
2251 |
+
<frontend_type>text</frontend_type>
|
2252 |
+
<sort_order>100</sort_order>
|
2253 |
+
<show_in_default>1</show_in_default>
|
2254 |
+
<show_in_website>1</show_in_website>
|
2255 |
+
<show_in_store>1</show_in_store>
|
2256 |
+
</sort_order>
|
2257 |
+
<payment_fee translate="label">
|
2258 |
+
<label>Payment fee</label>
|
2259 |
+
<sort_order>110</sort_order>
|
2260 |
+
<show_in_default>1</show_in_default>
|
2261 |
+
<show_in_website>1</show_in_website>
|
2262 |
+
<show_in_store>1</show_in_store>
|
2263 |
+
<comment>Payment fee amount. A positive amount will be used as a fixed amount, a negative amount as percentage. Using both is also possible by separation with a semicolon. Eg. 0.30;-1.2 results in 30 cents + 1.2% of the order amount.</comment>
|
2264 |
+
</payment_fee>
|
2265 |
+
<payment_fee_tax translate="label">
|
2266 |
+
<label>Payment fee tax class</label>
|
2267 |
+
<frontend_type>select</frontend_type>
|
2268 |
+
<source_model>adminhtml/system_config_source_shipping_taxclass</source_model>
|
2269 |
+
<sort_order>120</sort_order>
|
2270 |
+
<show_in_default>1</show_in_default>
|
2271 |
+
<show_in_store>1</show_in_store>
|
2272 |
+
<show_in_website>1</show_in_website>
|
2273 |
+
<comment>Choose the fee's tax class</comment>
|
2274 |
+
</payment_fee_tax>
|
2275 |
+
<payment_fee_inc_ex translate="label">
|
2276 |
+
<label>Including/Excluding Tax</label>
|
2277 |
+
<frontend_type>select</frontend_type>
|
2278 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
2279 |
+
<sort_order>130</sort_order>
|
2280 |
+
<show_in_default>1</show_in_default>
|
2281 |
+
<show_in_website>1</show_in_website>
|
2282 |
+
<show_in_store>1</show_in_store>
|
2283 |
+
<comment>Yes = fee entered including tax / No = fee entered excluding tax</comment>
|
2284 |
+
</payment_fee_inc_ex>
|
2285 |
+
<payment_fee_label translate="label,comment">
|
2286 |
+
<label>Payment fee label</label>
|
2287 |
+
<sort_order>140</sort_order>
|
2288 |
+
<show_in_default>1</show_in_default>
|
2289 |
+
<show_in_website>1</show_in_website>
|
2290 |
+
<show_in_store>1</show_in_store>
|
2291 |
+
<comment>Short description which is shown on orders/invoices</comment>
|
2292 |
+
</payment_fee_label>
|
2293 |
+
</fields>
|
2294 |
+
</cgp_paysafecard>
|
2295 |
+
<cgp_idealqr translate="label" module="cgp">
|
2296 |
+
<label>iDEAL QR mobiel</label><!-- Yeah. No typo here, it's fully lowercase... -->
|
2297 |
+
<sort_order>285</sort_order>
|
2298 |
+
<show_in_default>1</show_in_default>
|
2299 |
+
<show_in_website>1</show_in_website>
|
2300 |
+
<show_in_store>1</show_in_store>
|
2301 |
+
<fields>
|
2302 |
+
<active translate="label">
|
2303 |
+
<label>Enabled</label>
|
2304 |
+
<frontend_type>select</frontend_type>
|
2305 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
2306 |
+
<sort_order>1</sort_order>
|
2307 |
+
<show_in_default>1</show_in_default>
|
2308 |
+
<show_in_website>1</show_in_website>
|
2309 |
+
<show_in_store>1</show_in_store>
|
2310 |
+
</active>
|
2311 |
+
<title translate="label">
|
2312 |
+
<label>Title</label>
|
2313 |
+
<frontend_type>text</frontend_type>
|
2314 |
+
<sort_order>10</sort_order>
|
2315 |
+
<show_in_default>1</show_in_default>
|
2316 |
+
<show_in_website>1</show_in_website>
|
2317 |
+
<show_in_store>1</show_in_store>
|
2318 |
+
</title>
|
2319 |
+
<allowspecific translate="label">
|
2320 |
+
<label>Payment from applicable countries</label>
|
2321 |
+
<frontend_type>allowspecific</frontend_type>
|
2322 |
+
<sort_order>20</sort_order>
|
2323 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
2324 |
+
<show_in_default>1</show_in_default>
|
2325 |
+
<show_in_website>1</show_in_website>
|
2326 |
+
<show_in_store>1</show_in_store>
|
2327 |
+
</allowspecific>
|
2328 |
+
<specificcountry translate="label">
|
2329 |
+
<label>Payment from Specific countries</label>
|
2330 |
+
<frontend_type>multiselect</frontend_type>
|
2331 |
+
<sort_order>30</sort_order>
|
2332 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
2333 |
+
<show_in_default>1</show_in_default>
|
2334 |
+
<show_in_website>1</show_in_website>
|
2335 |
+
<show_in_store>1</show_in_store>
|
2336 |
+
</specificcountry>
|
2337 |
+
<sort_order translate="label">
|
2338 |
+
<label>Sort order</label>
|
2339 |
+
<frontend_type>text</frontend_type>
|
2340 |
+
<sort_order>100</sort_order>
|
2341 |
+
<show_in_default>1</show_in_default>
|
2342 |
+
<show_in_website>1</show_in_website>
|
2343 |
+
<show_in_store>1</show_in_store>
|
2344 |
+
</sort_order>
|
2345 |
+
<payment_fee translate="label">
|
2346 |
+
<label>Payment fee</label>
|
2347 |
+
<sort_order>110</sort_order>
|
2348 |
+
<show_in_default>1</show_in_default>
|
2349 |
+
<show_in_website>1</show_in_website>
|
2350 |
+
<show_in_store>1</show_in_store>
|
2351 |
+
<comment>Payment fee amount. A positive amount will be used as a fixed amount, a negative amount as percentage. Using both is also possible by separation with a semicolon. Eg. 0.30;-1.2 results in 30 cents + 1.2% of the order amount.</comment>
|
2352 |
+
</payment_fee>
|
2353 |
+
<payment_fee_tax translate="label">
|
2354 |
+
<label>Payment fee tax class</label>
|
2355 |
+
<frontend_type>select</frontend_type>
|
2356 |
+
<source_model>adminhtml/system_config_source_shipping_taxclass</source_model>
|
2357 |
+
<sort_order>120</sort_order>
|
2358 |
+
<show_in_default>1</show_in_default>
|
2359 |
+
<show_in_store>1</show_in_store>
|
2360 |
+
<show_in_website>1</show_in_website>
|
2361 |
+
<comment>Choose the fee's tax class</comment>
|
2362 |
+
</payment_fee_tax>
|
2363 |
+
<payment_fee_inc_ex translate="label">
|
2364 |
+
<label>Including/Excluding Tax</label>
|
2365 |
+
<frontend_type>select</frontend_type>
|
2366 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
2367 |
+
<sort_order>130</sort_order>
|
2368 |
+
<show_in_default>1</show_in_default>
|
2369 |
+
<show_in_website>1</show_in_website>
|
2370 |
+
<show_in_store>1</show_in_store>
|
2371 |
+
<comment>Yes = fee entered including tax / No = fee entered excluding tax</comment>
|
2372 |
+
</payment_fee_inc_ex>
|
2373 |
+
<payment_fee_label translate="label,comment">
|
2374 |
+
<label>Payment fee label</label>
|
2375 |
+
<sort_order>140</sort_order>
|
2376 |
+
<show_in_default>1</show_in_default>
|
2377 |
+
<show_in_website>1</show_in_website>
|
2378 |
+
<show_in_store>1</show_in_store>
|
2379 |
+
<comment>Short description which is shown on orders/invoices</comment>
|
2380 |
+
</payment_fee_label>
|
2381 |
+
</fields>
|
2382 |
+
</cgp_idealqr>
|
2383 |
</groups>
|
2384 |
</cgp>
|
2385 |
|
app/code/local/Cardgate/Cgp/sql/cgp_setup/mysql4-upgrade-1.2.0-1.2.1.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// $installer = $this;
|
4 |
+
// $installer->startSetup();
|
5 |
+
|
6 |
+
// $installer->getConnection()->addColumn($this->getTable('sales/order'), 'cardgate_resent', 'TIMESTAMP default NULL');
|
7 |
+
|
8 |
+
// $installer->endSetup();
|
app/design/frontend/base/default/template/cardgate/cgp/email/sales/order_new.html
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject {{var store.getFrontendName()}}: Betaaluitnodiging bestelling # {{var order.increment_id}} @-->
|
2 |
+
<!--@vars
|
3 |
+
{"store url=\"\"":"Store Url",
|
4 |
+
"var logo_url":"Email Logo Image Url",
|
5 |
+
"var logo_alt":"Email Logo Image Alt",
|
6 |
+
"htmlescape var=$order.getCustomerName()":"Customer Name",
|
7 |
+
"var store.getFrontendName()":"Store Name",
|
8 |
+
"store url=\"customer/account/\"":"Customer Account Url",
|
9 |
+
"var order.increment_id":"Order Id",
|
10 |
+
"var order.getCreatedAtFormated('long')":"Order Created At (datetime)",
|
11 |
+
"var order.getBillingAddress().format('html')":"Billing Address",
|
12 |
+
"var payment_html":"Payment Details",
|
13 |
+
"var order.getShippingAddress().format('html')":"Shipping Address",
|
14 |
+
"var order.getShippingDescription()":"Shipping Description",
|
15 |
+
"layout handle=\"sales_email_order_items\" order=$order":"Order Items Grid",
|
16 |
+
"var order.getEmailCustomerNote()":"Email Order Note"}
|
17 |
+
@-->
|
18 |
+
<!--@styles
|
19 |
+
@-->
|
20 |
+
|
21 |
+
{{template config_path="design/email/header"}}
|
22 |
+
{{inlinecss file="email-inline.css"}}
|
23 |
+
|
24 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
25 |
+
<tr>
|
26 |
+
<td>
|
27 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
28 |
+
<tr>
|
29 |
+
<td class="email-heading">
|
30 |
+
<h1>Beste {{htmlescape var=$order.getCustomerName()}},</h1>
|
31 |
+
<p>Bedankt voor uw bestelling bij {{var store.getFrontendName()}}.</p>
|
32 |
+
<p>Zodra uw bestelling voldaan is wordt uw bestelling verzonden. Een samenvatting van uw bestelling vindt u hieronder. Nogmaals bedankt voor uw bestelling.</p>
|
33 |
+
</td>
|
34 |
+
<td class="store-info">
|
35 |
+
<h4>Heeft u vragen over uw bestelling?</h4>
|
36 |
+
<p>
|
37 |
+
{{depend store_phone}}
|
38 |
+
<b>Bel ons:</b>
|
39 |
+
<a href="tel:{{var phone}}">{{var store_phone}}</a><br>
|
40 |
+
{{/depend}}
|
41 |
+
{{depend store_hours}}
|
42 |
+
<span class="no-link">{{var store_hours}}</span><br>
|
43 |
+
{{/depend}}
|
44 |
+
{{depend store_email}}
|
45 |
+
<b>E-Mail:</b> <a href="mailto:{{var store_email}}">{{var store_email}}</a>
|
46 |
+
{{/depend}}
|
47 |
+
</p>
|
48 |
+
</td>
|
49 |
+
</tr>
|
50 |
+
</table>
|
51 |
+
</td>
|
52 |
+
</tr>
|
53 |
+
<tr>
|
54 |
+
<td class="order-details">
|
55 |
+
<h3><a href="">Klik hier om uw bestelling te voltooien</h3>
|
56 |
+
<h3>Uw bestelling met bestelnummer <span class="no-link">#{{var order.increment_id}}</span></h3>
|
57 |
+
<p>Geplaatst op {{var order.getCreatedAtFormated('long')}}</p>
|
58 |
+
</td>
|
59 |
+
</tr>
|
60 |
+
<tr class="order-information">
|
61 |
+
<td>
|
62 |
+
{{if order.getEmailCustomerNote()}}
|
63 |
+
<table cellspacing="0" cellpadding="0" class="message-container">
|
64 |
+
<tr>
|
65 |
+
<td>{{var order.getEmailCustomerNote()}}</td>
|
66 |
+
</tr>
|
67 |
+
</table>
|
68 |
+
{{/if}}
|
69 |
+
{{layout handle="sales_email_order_items" order=$order}}
|
70 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
71 |
+
<tr>
|
72 |
+
<td class="address-details">
|
73 |
+
<h6>Factuurgegevens:</h6>
|
74 |
+
<p><span class="no-link">{{var order.getBillingAddress().format('html')}}</span></p>
|
75 |
+
</td>
|
76 |
+
{{depend order.getIsNotVirtual()}}
|
77 |
+
<td class="address-details">
|
78 |
+
<h6>Adresgegevens:</h6>
|
79 |
+
<p><span class="no-link">{{var order.getShippingAddress().format('html')}}</span></p>
|
80 |
+
</td>
|
81 |
+
{{/depend}}
|
82 |
+
</tr>
|
83 |
+
<tr>
|
84 |
+
{{depend order.getIsNotVirtual()}}
|
85 |
+
<td class="method-info">
|
86 |
+
<h6>Verzendwijze:</h6>
|
87 |
+
<p>{{var order.shipping_description}}</p>
|
88 |
+
</td>
|
89 |
+
{{/depend}}
|
90 |
+
<td class="method-info">
|
91 |
+
<h6>Betaalwijze:</h6>
|
92 |
+
{{var payment_html}}
|
93 |
+
</td>
|
94 |
+
</tr>
|
95 |
+
</table>
|
96 |
+
</td>
|
97 |
+
</tr>
|
98 |
+
</table>
|
99 |
+
|
100 |
+
{{template config_path="design/email/footer"}}
|
app/design/frontend/base/default/template/cardgate/cgp/email/sales/order_new_guest.html
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject Uw bestelling # {{var order.increment_id}} @-->
|
2 |
+
<!--@vars
|
3 |
+
{"store url=\"\"":"Store Url",
|
4 |
+
"var logo_url":"Email Logo Image Url",
|
5 |
+
"var logo_alt":"Email Logo Image Alt",
|
6 |
+
"htmlescape var=$order.getCustomerName()":"Customer Name",
|
7 |
+
"var store.getFrontendName()":"Store Name",
|
8 |
+
"store url=\"customer/account/\"":"Customer Account Url",
|
9 |
+
"var order.increment_id":"Order Id",
|
10 |
+
"var order.getCreatedAtFormated('long')":"Order Created At (datetime)",
|
11 |
+
"var order.getBillingAddress().format('html')":"Billing Address",
|
12 |
+
"var payment_html":"Payment Details",
|
13 |
+
"var order.getShippingAddress().format('html')":"Shipping Address",
|
14 |
+
"var order.getShippingDescription()":"Shipping Description",
|
15 |
+
"layout handle=\"sales_email_order_items\" order=$order":"Order Items Grid",
|
16 |
+
"var order.getEmailCustomerNote()":"Email Order Note"}
|
17 |
+
@-->
|
18 |
+
<!--@styles
|
19 |
+
@-->
|
20 |
+
|
21 |
+
{{template config_path="design/email/header"}}
|
22 |
+
{{inlinecss file="email-inline.css"}}
|
23 |
+
|
24 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
25 |
+
<tr>
|
26 |
+
<td>
|
27 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
28 |
+
<tr>
|
29 |
+
<td class="email-heading">
|
30 |
+
<h1>Beste {{htmlescape var=$order.getBillingAddress().getName()}},</h1>
|
31 |
+
<p>Bedankt voor uw bestelling bij {{var store.getFrontendName()}}.</p>
|
32 |
+
<p>Zodra uw bestelling wordt verzonden, ontvangt u een email met een link om uw bestelling te volgen. Een samenvatting van uw bestelling vindt u hieronder. Nogmaals bedankt voor uw bestelling.</p>
|
33 |
+
</td>
|
34 |
+
<td class="store-info">
|
35 |
+
<h4>Heeft u vragen over uw bestelling?</h4>
|
36 |
+
<p>
|
37 |
+
{{depend store_phone}}
|
38 |
+
<b>Bel ons:</b>
|
39 |
+
<a href="tel:{{var phone}}">{{var store_phone}}</a><br>
|
40 |
+
{{/depend}}
|
41 |
+
{{depend store_hours}}
|
42 |
+
<span class="no-link">{{var store_hours}}</span><br>
|
43 |
+
{{/depend}}
|
44 |
+
{{depend store_email}}
|
45 |
+
<b>E-Mail:</b> <a href="mailto:{{var store_email}}">{{var store_email}}</a>
|
46 |
+
{{/depend}}
|
47 |
+
</p>
|
48 |
+
</td>
|
49 |
+
</tr>
|
50 |
+
</table>
|
51 |
+
</td>
|
52 |
+
</tr>
|
53 |
+
<tr>
|
54 |
+
<td class="order-details">
|
55 |
+
<h3>Uw bestelling met bestelnummer <span class="no-link">#{{var order.increment_id}}</span></h3>
|
56 |
+
<p>Geplaatst op {{var order.getCreatedAtFormated('long')}}</p>
|
57 |
+
</td>
|
58 |
+
</tr>
|
59 |
+
<tr class="order-information">
|
60 |
+
<td>
|
61 |
+
{{if order.getEmailCustomerNote()}}
|
62 |
+
<table cellspacing="0" cellpadding="0" class="message-container">
|
63 |
+
<tr>
|
64 |
+
<td>{{var order.getEmailCustomerNote()}}</td>
|
65 |
+
</tr>
|
66 |
+
</table>
|
67 |
+
{{/if}}
|
68 |
+
{{layout handle="sales_email_order_items" order=$order}}
|
69 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
70 |
+
<tr>
|
71 |
+
<td class="address-details">
|
72 |
+
<h6>Factuurgegevens:</h6>
|
73 |
+
<p><span class="no-link">{{var order.getBillingAddress().format('html')}}</span></p>
|
74 |
+
</td>
|
75 |
+
{{depend order.getIsNotVirtual()}}
|
76 |
+
<td class="address-details">
|
77 |
+
<h6>Adresgegevens:</h6>
|
78 |
+
<p><span class="no-link">{{var order.getShippingAddress().format('html')}}</span></p>
|
79 |
+
</td>
|
80 |
+
{{/depend}}
|
81 |
+
</tr>
|
82 |
+
<tr>
|
83 |
+
{{depend order.getIsNotVirtual()}}
|
84 |
+
<td class="method-info">
|
85 |
+
<h6>Verzendwijze:</h6>
|
86 |
+
<p>{{var order.shipping_description}}</p>
|
87 |
+
</td>
|
88 |
+
{{/depend}}
|
89 |
+
<td class="method-info">
|
90 |
+
<h6>Betaalwijze:</h6>
|
91 |
+
{{var payment_html}}
|
92 |
+
</td>
|
93 |
+
</tr>
|
94 |
+
</table>
|
95 |
+
</td>
|
96 |
+
</tr>
|
97 |
+
</table>
|
98 |
+
|
99 |
+
{{template config_path="design/email/footer"}}
|
app/locale/en_US/template/email/cgp/paymentlink.html
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject {{var store.getFrontendName()}}: Payment invitation Order # {{var order.increment_id}} @-->
|
2 |
+
<!--@vars
|
3 |
+
{"store url=\"\"":"Store Url",
|
4 |
+
"var logo_url":"Email Logo Image Url",
|
5 |
+
"var logo_alt":"Email Logo Image Alt",
|
6 |
+
"htmlescape var=$order.getCustomerName()":"Customer Name",
|
7 |
+
"var store.getFrontendName()":"Store Name",
|
8 |
+
"store url=\"customer/account/\"":"Customer Account Url",
|
9 |
+
"var order.increment_id":"Order Id",
|
10 |
+
"var order.getCreatedAtFormated('long')":"Order Created At (datetime)",
|
11 |
+
"var order.getBillingAddress().format('html')":"Billing Address",
|
12 |
+
"var payment_html":"Payment Details",
|
13 |
+
"var order.getShippingAddress().format('html')":"Shipping Address",
|
14 |
+
"var order.getShippingDescription()":"Shipping Description",
|
15 |
+
"layout handle=\"sales_email_order_items\" order=$order":"Order Items Grid",
|
16 |
+
"var order.getEmailCustomerNote()":"Email Order Note"}
|
17 |
+
@-->
|
18 |
+
<!--@styles
|
19 |
+
@-->
|
20 |
+
|
21 |
+
{{template config_path="design/email/header"}}
|
22 |
+
{{inlinecss file="email-inline.css"}}
|
23 |
+
|
24 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
25 |
+
<tr>
|
26 |
+
<td>
|
27 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
28 |
+
<tr>
|
29 |
+
<td class="email-heading">
|
30 |
+
<h1>Thank you for your order from {{var store.getFrontendName()}}.</h1>
|
31 |
+
<p>Once your payment is complete we will ship your order. Your order summary is below. Thank you again for your business.</p>
|
32 |
+
</td>
|
33 |
+
<td class="store-info">
|
34 |
+
<h4>Order Questions?</h4>
|
35 |
+
<p>
|
36 |
+
{{depend store_phone}}
|
37 |
+
<b>Call Us:</b>
|
38 |
+
<a href="tel:{{var phone}}">{{var store_phone}}</a><br>
|
39 |
+
{{/depend}}
|
40 |
+
{{depend store_hours}}
|
41 |
+
<span class="no-link">{{var store_hours}}</span><br>
|
42 |
+
{{/depend}}
|
43 |
+
{{depend store_email}}
|
44 |
+
<b>Email:</b> <a href="mailto:{{var store_email}}">{{var store_email}}</a>
|
45 |
+
{{/depend}}
|
46 |
+
</p>
|
47 |
+
</td>
|
48 |
+
</tr>
|
49 |
+
</table>
|
50 |
+
</td>
|
51 |
+
</tr>
|
52 |
+
<tr>
|
53 |
+
<td class="order-details">
|
54 |
+
<h3><a href="{{var payment_link}}">Click here to complete your order</a></h3>
|
55 |
+
<h3>Your order <span class="no-link">#{{var order.increment_id}}</span></h3>
|
56 |
+
<p>Placed on {{var order.getCreatedAtFormated('long')}}</p>
|
57 |
+
</td>
|
58 |
+
</tr>
|
59 |
+
<tr class="order-information">
|
60 |
+
<td>
|
61 |
+
{{if order.getEmailCustomerNote()}}
|
62 |
+
<table cellspacing="0" cellpadding="0" class="message-container">
|
63 |
+
<tr>
|
64 |
+
<td>{{var order.getEmailCustomerNote()}}</td>
|
65 |
+
</tr>
|
66 |
+
</table>
|
67 |
+
{{/if}}
|
68 |
+
{{layout handle="sales_email_order_items" order=$order}}
|
69 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
70 |
+
<tr>
|
71 |
+
<td class="address-details">
|
72 |
+
<h6>Bill to:</h6>
|
73 |
+
<p><span class="no-link">{{var order.getBillingAddress().format('html')}}</span></p>
|
74 |
+
</td>
|
75 |
+
{{depend order.getIsNotVirtual()}}
|
76 |
+
<td class="address-details">
|
77 |
+
<h6>Ship to:</h6>
|
78 |
+
<p><span class="no-link">{{var order.getShippingAddress().format('html')}}</span></p>
|
79 |
+
</td>
|
80 |
+
{{/depend}}
|
81 |
+
</tr>
|
82 |
+
<tr>
|
83 |
+
{{depend order.getIsNotVirtual()}}
|
84 |
+
<td class="method-info">
|
85 |
+
<h6>Shipping method:</h6>
|
86 |
+
<p>{{var order.shipping_description}}</p>
|
87 |
+
</td>
|
88 |
+
{{/depend}}
|
89 |
+
<td class="method-info">
|
90 |
+
<h6>Payment method:</h6>
|
91 |
+
{{var payment_html}}
|
92 |
+
</td>
|
93 |
+
</tr>
|
94 |
+
</table>
|
95 |
+
</td>
|
96 |
+
</tr>
|
97 |
+
</table>
|
98 |
+
|
99 |
+
{{template config_path="design/email/footer"}}
|
app/locale/en_US/template/email/cgp/paymentlink_guest.html
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject {{var store.getFrontendName()}}: Payment invitation Order # {{var order.increment_id}} @-->
|
2 |
+
<!--@vars
|
3 |
+
{"store url=\"\"":"Store Url",
|
4 |
+
"var logo_url":"Email Logo Image Url",
|
5 |
+
"var logo_alt":"Email Logo Image Alt",
|
6 |
+
"htmlescape var=$order.getCustomerName()":"Customer Name",
|
7 |
+
"var store.getFrontendName()":"Store Name",
|
8 |
+
"store url=\"customer/account/\"":"Customer Account Url",
|
9 |
+
"var order.increment_id":"Order Id",
|
10 |
+
"var order.getCreatedAtFormated('long')":"Order Created At (datetime)",
|
11 |
+
"var order.getBillingAddress().format('html')":"Billing Address",
|
12 |
+
"var payment_html":"Payment Details",
|
13 |
+
"var order.getShippingAddress().format('html')":"Shipping Address",
|
14 |
+
"var order.getShippingDescription()":"Shipping Description",
|
15 |
+
"layout handle=\"sales_email_order_items\" order=$order":"Order Items Grid",
|
16 |
+
"var order.getEmailCustomerNote()":"Email Order Note"}
|
17 |
+
@-->
|
18 |
+
<!--@styles
|
19 |
+
@-->
|
20 |
+
|
21 |
+
{{template config_path="design/email/header"}}
|
22 |
+
{{inlinecss file="email-inline.css"}}
|
23 |
+
|
24 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
25 |
+
<tr>
|
26 |
+
<td>
|
27 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
28 |
+
<tr>
|
29 |
+
<td class="email-heading">
|
30 |
+
<h1>Thank you for your order from {{var store.getFrontendName()}}.</h1>
|
31 |
+
<p>Once your payment is complete we will ship your order. Your order summary is below. Thank you again for your business.</p>
|
32 |
+
</td>
|
33 |
+
<td class="store-info">
|
34 |
+
<h4>Order Questions?</h4>
|
35 |
+
<p>
|
36 |
+
{{depend store_phone}}
|
37 |
+
<b>Call Us:</b>
|
38 |
+
<a href="tel:{{var phone}}">{{var store_phone}}</a><br>
|
39 |
+
{{/depend}}
|
40 |
+
{{depend store_hours}}
|
41 |
+
<span class="no-link">{{var store_hours}}</span><br>
|
42 |
+
{{/depend}}
|
43 |
+
{{depend store_email}}
|
44 |
+
<b>Email:</b> <a href="mailto:{{var store_email}}">{{var store_email}}</a>
|
45 |
+
{{/depend}}
|
46 |
+
</p>
|
47 |
+
</td>
|
48 |
+
</tr>
|
49 |
+
</table>
|
50 |
+
</td>
|
51 |
+
</tr>
|
52 |
+
<tr>
|
53 |
+
<td class="order-details">
|
54 |
+
<h3><a href="{{var payment_link}}">Click here to complete your order</a></h3>
|
55 |
+
<h3>Your order <span class="no-link">#{{var order.increment_id}}</span></h3>
|
56 |
+
<p>Placed on {{var order.getCreatedAtFormated('long')}}</p>
|
57 |
+
</td>
|
58 |
+
</tr>
|
59 |
+
<tr class="order-information">
|
60 |
+
<td>
|
61 |
+
{{if order.getEmailCustomerNote()}}
|
62 |
+
<table cellspacing="0" cellpadding="0" class="message-container">
|
63 |
+
<tr>
|
64 |
+
<td>{{var order.getEmailCustomerNote()}}</td>
|
65 |
+
</tr>
|
66 |
+
</table>
|
67 |
+
{{/if}}
|
68 |
+
{{layout handle="sales_email_order_items" order=$order}}
|
69 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
70 |
+
<tr>
|
71 |
+
<td class="address-details">
|
72 |
+
<h6>Bill to:</h6>
|
73 |
+
<p><span class="no-link">{{var order.getBillingAddress().format('html')}}</span></p>
|
74 |
+
</td>
|
75 |
+
{{depend order.getIsNotVirtual()}}
|
76 |
+
<td class="address-details">
|
77 |
+
<h6>Ship to:</h6>
|
78 |
+
<p><span class="no-link">{{var order.getShippingAddress().format('html')}}</span></p>
|
79 |
+
</td>
|
80 |
+
{{/depend}}
|
81 |
+
</tr>
|
82 |
+
<tr>
|
83 |
+
{{depend order.getIsNotVirtual()}}
|
84 |
+
<td class="method-info">
|
85 |
+
<h6>Shipping method:</h6>
|
86 |
+
<p>{{var order.shipping_description}}</p>
|
87 |
+
</td>
|
88 |
+
{{/depend}}
|
89 |
+
<td class="method-info">
|
90 |
+
<h6>Payment method:</h6>
|
91 |
+
{{var payment_html}}
|
92 |
+
</td>
|
93 |
+
</tr>
|
94 |
+
</table>
|
95 |
+
</td>
|
96 |
+
</tr>
|
97 |
+
</table>
|
98 |
+
|
99 |
+
{{template config_path="design/email/footer"}}
|
app/locale/nl_NL/Cardgate_Cgp.csv
CHANGED
@@ -70,8 +70,7 @@
|
|
70 |
"Direct Debit","Incasso"
|
71 |
"Bank transfer: Waiting for customer action.","Overboeking: Wacht op consument."
|
72 |
"Direct debit: Waiting for confirmation.","Incasso: wacht op bevestiging."
|
73 |
-
"Your payment
|
74 |
-
"Your payment has failed. If you wish, you can try using a different payment method.","Uw betaling is niet geslaagd. Indien gewenst, kunt u een andere betaalmethode proberen."
|
75 |
"Payment fee","Betaaltoeslag"
|
76 |
"Payment fee amount. A positive amount will be used as a fixed amount, a negative amount as percentage. Using both is also possible by separation with a semicolon. Eg. 0.30;-1.2 results in 30 cents + 1.2% of the order amount.","Betaaltoeslag bedrag. Een positief getal wordt als vast bedrag gebruikt, een negatief getal als percentage. Beide opgeven is ook mogelijk door deze te scheiden met een punt-comma. Voorbeeld: 0.30;-1.2 resulteert in 30 cent + 1.2% van het orderbedrag."
|
77 |
"Payment fee tax class","Betaaltoeslag BTW tarief"
|
@@ -113,4 +112,20 @@
|
|
113 |
"Action required for Cardgate refund <b>Order # %s</b> <b>(transaction # %s)</b>. <a href='%s' target='_blank'>Click here</a>","Handeling benodigd voor Cardgate terugboeking <b>Order # %s</b> <b>(transactie # %s)</b>. <a href='%s' target='_blank'>Klik hier</a>"
|
114 |
"CardGate refund failed because transaction could not be found","CardGate terugboeking mislukt omdat de transactie niet gevonden kon worden"
|
115 |
"Unclaimed inventory because order changed to 'Canceled' state.","Voorraad teruggeboekt omdat de order wijzigde naar 'Geannuleerd' status."
|
116 |
-
"Reclaimed inventory because order changed from 'Canceled' to 'Processing' state.","Voorraad herboekt omdat de order wijzigde van 'Geannuleerd' naar 'Bezig met verwerken' status."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
"Direct Debit","Incasso"
|
71 |
"Bank transfer: Waiting for customer action.","Overboeking: Wacht op consument."
|
72 |
"Direct debit: Waiting for confirmation.","Incasso: wacht op bevestiging."
|
73 |
+
"Your payment has failed. If you wish, you can try using a different payment method or try again.","Uw betaling is niet geslaagd. Indien gewenst, kunt u een andere betaalmethode proberen of het opnieuw proberen."
|
|
|
74 |
"Payment fee","Betaaltoeslag"
|
75 |
"Payment fee amount. A positive amount will be used as a fixed amount, a negative amount as percentage. Using both is also possible by separation with a semicolon. Eg. 0.30;-1.2 results in 30 cents + 1.2% of the order amount.","Betaaltoeslag bedrag. Een positief getal wordt als vast bedrag gebruikt, een negatief getal als percentage. Beide opgeven is ook mogelijk door deze te scheiden met een punt-comma. Voorbeeld: 0.30;-1.2 resulteert in 30 cent + 1.2% van het orderbedrag."
|
76 |
"Payment fee tax class","Betaaltoeslag BTW tarief"
|
112 |
"Action required for Cardgate refund <b>Order # %s</b> <b>(transaction # %s)</b>. <a href='%s' target='_blank'>Click here</a>","Handeling benodigd voor Cardgate terugboeking <b>Order # %s</b> <b>(transactie # %s)</b>. <a href='%s' target='_blank'>Klik hier</a>"
|
113 |
"CardGate refund failed because transaction could not be found","CardGate terugboeking mislukt omdat de transactie niet gevonden kon worden"
|
114 |
"Unclaimed inventory because order changed to 'Canceled' state.","Voorraad teruggeboekt omdat de order wijzigde naar 'Geannuleerd' status."
|
115 |
+
"Reclaimed inventory because order changed from 'Canceled' to 'Processing' state.","Voorraad herboekt omdat de order wijzigde van 'Geannuleerd' naar 'Bezig met verwerken' status."
|
116 |
+
"Send payment link","Verstuur betaallink"
|
117 |
+
"CardGate transaction information %s","CardGate transactie informatie %s"
|
118 |
+
"Error loading order #%s","Fout tijdens laden order #%s"
|
119 |
+
"Error loading payment info for order #%s","Fout tijdens laden betaalingsinformatie van order #%s"
|
120 |
+
"Send payment link for order #%s to email '%s'","Verstuur betaallink voor order #%s naar email '%s'"
|
121 |
+
"Send direct payment link using method '%s'","Verstuur directe betaallink voor methode '%s'"
|
122 |
+
"Send direct payment link allowing all available paymentmethods","Verstuur directe betaallink en sta alle toegestane betaalmethoden toe"
|
123 |
+
"Payment link mail sent using method \'%s\'","Betaallink email verzonden voor methode '%s'"
|
124 |
+
"Payment link mail sent allowing all available paymentmethods","Betaallink email verzonden voor alle toegestane betaalmethoden"
|
125 |
+
"Please notice the order is already finalized and additional transactioncosts don't change when other paymentmethods are applied.","Neem in acht dat de order al afgerond is en transactiekosten niet worden aangepast wanneer andere betaalmethoden gekozen worden."
|
126 |
+
"This order is already paid.","Deze order is al voldaan."
|
127 |
+
"A security error occurred","Een beveiligingsprobleem is opgetreden"
|
128 |
+
"An error occurred","Een fout is opgetreden"
|
129 |
+
"Payment method is not available. Please choose another method.","Betaalmethode is niet beschikbaar. Kies a.u.b. een andere methode."
|
130 |
+
"An exception occurred registering the transaction. Please try again.","Er trad een fout op bij het registreren van de transactie. Probeer het nogmaals."
|
131 |
+
"Transaction successfully completed.","Transactie succesvol voltooid."
|
app/locale/nl_NL/Cardgate_Cgp.csv.from_package
DELETED
@@ -1,96 +0,0 @@
|
|
1 |
-
"Dutch","Nederlands"
|
2 |
-
"English","Engels"
|
3 |
-
"German","Duits"
|
4 |
-
"French","Frans"
|
5 |
-
"Spanish","Spaans"
|
6 |
-
"Greek","Grieks"
|
7 |
-
"Croatian","Kroatisch"
|
8 |
-
"Italian","Italiaans"
|
9 |
-
"Czech","Tsjechisch"
|
10 |
-
"Russian","Russisch"
|
11 |
-
"Swedish","Zweeds"
|
12 |
-
"<strong>Note:</strong> Don't forget to set-up in the <a href='https://my.cardgate.com/' target='_blank'>Merchant Backoffice</a> a Control URL to 'http://www.yourdomain.com/cgp/standard/control/'.","<strong>Let op!</strong> Vergeet niet uw 'Control URL (http://www.yourdomain.com/cgp/standard/control/)' op te geven in de <a href='https://my.cardgate.com/' target='_blank'>Merchant Backoffice</a>."
|
13 |
-
"Test Mode","Test modus"
|
14 |
-
"Live Mode","Live modus"
|
15 |
-
"Test/Live Mode","Test/Live modus"
|
16 |
-
"Switching between test and live mode. If you don't have an account <a href='http://www.cardgate.com/' target='_blank'>sign up here</a>.","Schakelen tussen test en live modus. Als u nog geen account heeft, kunt u zich <a href='http://www.cardgate.com/' target='_blank'>hier aanmelden</a>."
|
17 |
-
"Site ID","Site ID"
|
18 |
-
"Fill in you site ID number. You can find your site ID number at <a href='https://my.cardgate.com/' target='_blank'>merchant back-office</a>.","Vul hier uw site ID in. Dit nummer kunt u vinden in de <a href='https://my.cardgate.com/' target='_blank'>merchant back-office</a>."
|
19 |
-
"Hash Key","Codeer Sleutel"
|
20 |
-
"Fill in you secret hash key for the site. You can create your hash key code at <a href='https://my.cardgate.com/' target='_blank'>merchant back-office</a>.","Vul hier uw codeer sleutel in. Deze kunt u aanmaken in de <a href='https://my.cardgate.com/' target='_blank'>merchant back-office</a>."
|
21 |
-
"Use back-office URLs","Gebruik back-office URLs"
|
22 |
-
"Use the return URLs as filled in at <a href='https://my.cardgate.com/' target='_blank'>merchant back-office</a> instead of the default plugin values.","Gebruik de return URLs, zoals door u aangemaakt in de <a href='https://my.cardgate.com/' target='_blank'>merchant back-office</a> i.p.v. de standaard plugin waarden."
|
23 |
-
"Create invoice after payment","Maak een factuur aan na betaling"
|
24 |
-
"Automatically create invoices after payment.","Maak automatisch een factuur aan na betaling."
|
25 |
-
"Mail invoice to customer","Email factuur aan klant"
|
26 |
-
"Gateway language","Taal betaalpagina"
|
27 |
-
"Setting a default language interface of the gateway.","Stel een standaard taal in voor de betaal pagina"
|
28 |
-
"Order description","Order omschrijving"
|
29 |
-
"Payment description that will be shown to the customer in the gateway screen. <br />Variables: <b>%id%</b> = Order ID","Omschrijving welke getoond wordt op de betaalpagina. <br />Variabele: <b>%id%</b> = Order ID"
|
30 |
-
"Payment in progress status","Betaling aan de gang status"
|
31 |
-
"Payment complete status","Betaling compleet status"
|
32 |
-
"Payment failed status","Betaling mislukt status"
|
33 |
-
"Payment fraud status","Fraude status"
|
34 |
-
"Payment from applicable countries","Betaling toegestaan vanuit"
|
35 |
-
"Payment from Specific countries","Betaling vanuit specifieke landen"
|
36 |
-
"Sort order","Volgorde"
|
37 |
-
"Debug","Debug"
|
38 |
-
"Will log details for debugging purposes in var/log/cardgateplus.log file.","Dit zal debug gegevens loggen in het bestand var/log/cardgateplus.log"
|
39 |
-
"Enabled","Ingeschakeld"
|
40 |
-
"Title","Titel"
|
41 |
-
"You will be redirected to finish your payment.","U zult worden doorgelinkt om uw betaling af te ronden."
|
42 |
-
"Selected currency code ","Geselecteerde valuta code "
|
43 |
-
" is not compatible with Card Gate Plus"," wordt niet ondersteund door Card Gate Plus"
|
44 |
-
"Transaction started, waiting for payment.","Transactie gestart, wacht op betaling"
|
45 |
-
"Paymentmethod used","Gebruikte betaalmethode"
|
46 |
-
"Additional information","Extra informatie"
|
47 |
-
"--Please select--","--Maak uw keuze--"
|
48 |
-
"------ Additional Banks ------","----- Overige Banken -----"
|
49 |
-
"Select your bank","Selecteer uw bank"
|
50 |
-
"Invoice # %s created and send to customer.","Factuur # %s is aangemaakt en verzonden naar de klant."
|
51 |
-
"Invoice # %s created.","Factuur # %s is aangemaakt."
|
52 |
-
"Hacker attempt: Order total amount does not match Card Gate Plus' gross total amount!","Hack poging: Het order bedrag komt niet overeen met het bedrag verzonden naar Card Gate Plus"
|
53 |
-
"Payment complete.","Betaling afgerond."
|
54 |
-
"Payment failed or canceled by user.","Betaling mislukt of geannuleerd door de klant."
|
55 |
-
"Transaction failed, payment is fraud.","Betaling afgewezen door anti-fraude instellingen."
|
56 |
-
"Automatically mail invoices to a customer.","Stuur facturen automatisch aan klant."
|
57 |
-
"Notifications recipient","Ontvanger van meldingen"
|
58 |
-
"Notify on failed invoice creation","Melden van mislukte poging om een factuur aan te maken"
|
59 |
-
"Automatic invoice creation failed","Het automatisch genereren van de factuur is mislukt"
|
60 |
-
"Magento was unable to create an invoice for Order # %s after a successful payment via Card Gate Plus (transaction # %s)","Het is Magento niet gelukt een factuur aan te maken voor Order # %s na een succesvolle transactie via Card Gate Plus (transactie # %s)"
|
61 |
-
"Year","Jaar"
|
62 |
-
"Month","Maand"
|
63 |
-
"Day","Dag"
|
64 |
-
"Gender","Geslacht"
|
65 |
-
"Male","Man"
|
66 |
-
"Female","Vrouw"
|
67 |
-
"Birthday","Geboortedatum"
|
68 |
-
"Your Klarna EID","Uw Klarna EID"
|
69 |
-
"Bank Transfer","Bank Overboeking"
|
70 |
-
"Klarna Invoice", "Klarna Factuur"
|
71 |
-
"Direct Debit","Incasso"
|
72 |
-
"Bank transfer: Waiting for customer action.","Overboeking: Wacht op consument."
|
73 |
-
"Direct debit: Waiting for confirmation.","Incasso: wacht op bevestiging."
|
74 |
-
"Your payment is being evaluated by the bank. Please do not attempt to pay again, until your payment is either confirmed or denied by the bank.","Uw betaling wordt beoordeeld door de bank. Probeer niet nogmaals te betalen, totdat de betaling goed- of afgekeurd is door de bank."
|
75 |
-
"Your payment has failed. If you wish, you can try using a different payment method.","Uw betaling is niet geslaagd. Indien gewenst, kunt u een andere betaalmethode proberen."
|
76 |
-
"Payment fee","Betaaltoeslag"
|
77 |
-
"Payment fee amount. A positive amount will be used as a fixed amount, a negative amount as percentage. Using both is also possible by separation with a semicolon. Eg. 0.30;-1.2 results in 30 cents + 1.2% of the order amount.","Betaaltoeslag bedrag. Een positief getal wordt als vast bedrag gebruikt, een negatief getal als percentage. Beide opgeven is ook mogelijk door deze te scheiden met een punt-comma. Voorbeeld: 0.30;-1.2 resulteert in 30 cent + 1.2% van het orderbedrag."
|
78 |
-
"Payment fee tax class","Betaaltoeslag BTW tarief"
|
79 |
-
"Choose the fee's tax class","Kies een BTW tarief voor de toeslag"
|
80 |
-
"Including/Excluding Tax","Inclusief/Exclusief BTW"
|
81 |
-
"Yes = fee entered including tax / No = fee entered excluding tax","Ja = opgegeven tarief is incl BTW / Nee = opgegeven tarief is excl BTW"
|
82 |
-
"Payment fee label","Betaaltoeslag beschrijving"
|
83 |
-
"Short description which is shown on orders/invoices","Korte omschrijving welke zichtbaar is op orders/facturen"
|
84 |
-
"Send Order Email only at payment","Verstuur bestelling Email pas bij betaling"
|
85 |
-
"Send Order Email only after payment completion.","Verstuur de bestelling Email pas als de betaling afgerond is."
|
86 |
-
"Instructions","Instructies"
|
87 |
-
"Payment failed.","Betaling mislukt."
|
88 |
-
"Payment expired.","Betaling verlopen."
|
89 |
-
"Payment canceled by user.","Betaling geannuleerd door gebruiker."
|
90 |
-
"Transaction pending: Waiting for customer action.", "Betaling pending: Wacht op actie van klant."
|
91 |
-
"Transaction pending: Waiting for confirmation.","Betaling pending: Wacht op bevestiging."
|
92 |
-
"Version","Versie"
|
93 |
-
"Benificiary","Begunstidge"
|
94 |
-
"Benificiary IBAN","Begunstidge IBAN"
|
95 |
-
"Benificiary BIC","Begunstidge BIC"
|
96 |
-
"Reference","Referentie"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/locale/nl_NL/template/email/cgp/paymentlink.html
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject {{var store.getFrontendName()}}: Betaaluitnodiging bestelling # {{var order.increment_id}} @-->
|
2 |
+
<!--@vars
|
3 |
+
{"store url=\"\"":"Store Url",
|
4 |
+
"var logo_url":"Email Logo Image Url",
|
5 |
+
"var logo_alt":"Email Logo Image Alt",
|
6 |
+
"htmlescape var=$order.getCustomerName()":"Customer Name",
|
7 |
+
"var store.getFrontendName()":"Store Name",
|
8 |
+
"store url=\"customer/account/\"":"Customer Account Url",
|
9 |
+
"var order.increment_id":"Order Id",
|
10 |
+
"var order.getCreatedAtFormated('long')":"Order Created At (datetime)",
|
11 |
+
"var order.getBillingAddress().format('html')":"Billing Address",
|
12 |
+
"var payment_html":"Payment Details",
|
13 |
+
"var order.getShippingAddress().format('html')":"Shipping Address",
|
14 |
+
"var order.getShippingDescription()":"Shipping Description",
|
15 |
+
"layout handle=\"sales_email_order_items\" order=$order":"Order Items Grid",
|
16 |
+
"var order.getEmailCustomerNote()":"Email Order Note"}
|
17 |
+
@-->
|
18 |
+
<!--@styles
|
19 |
+
@-->
|
20 |
+
|
21 |
+
{{template config_path="design/email/header"}}
|
22 |
+
{{inlinecss file="email-inline.css"}}
|
23 |
+
|
24 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
25 |
+
<tr>
|
26 |
+
<td>
|
27 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
28 |
+
<tr>
|
29 |
+
<td class="email-heading">
|
30 |
+
<h1>Beste {{htmlescape var=$order.getCustomerName()}},</h1>
|
31 |
+
<p>Bedankt voor uw bestelling bij {{var store.getFrontendName()}}.</p>
|
32 |
+
<p>Zodra uw betaling voldaan is wordt uw bestelling verzonden. Een samenvatting van uw bestelling vindt u hieronder. Nogmaals bedankt voor uw bestelling.</p>
|
33 |
+
</td>
|
34 |
+
<td class="store-info">
|
35 |
+
<h4>Heeft u vragen over uw bestelling?</h4>
|
36 |
+
<p>
|
37 |
+
{{depend store_phone}}
|
38 |
+
<b>Bel ons:</b>
|
39 |
+
<a href="tel:{{var phone}}">{{var store_phone}}</a><br>
|
40 |
+
{{/depend}}
|
41 |
+
{{depend store_hours}}
|
42 |
+
<span class="no-link">{{var store_hours}}</span><br>
|
43 |
+
{{/depend}}
|
44 |
+
{{depend store_email}}
|
45 |
+
<b>E-Mail:</b> <a href="mailto:{{var store_email}}">{{var store_email}}</a>
|
46 |
+
{{/depend}}
|
47 |
+
</p>
|
48 |
+
</td>
|
49 |
+
</tr>
|
50 |
+
</table>
|
51 |
+
</td>
|
52 |
+
</tr>
|
53 |
+
<tr>
|
54 |
+
<td class="order-details">
|
55 |
+
<h3><a href="{{var payment_link}}">Klik hier om uw bestelling te voltooien</a></h3>
|
56 |
+
<h3>Uw bestelling met bestelnummer <span class="no-link">#{{var order.increment_id}}</span></h3>
|
57 |
+
<p>Geplaatst op {{var order.getCreatedAtFormated('long')}}</p>
|
58 |
+
</td>
|
59 |
+
</tr>
|
60 |
+
<tr class="order-information">
|
61 |
+
<td>
|
62 |
+
{{if order.getEmailCustomerNote()}}
|
63 |
+
<table cellspacing="0" cellpadding="0" class="message-container">
|
64 |
+
<tr>
|
65 |
+
<td>{{var order.getEmailCustomerNote()}}</td>
|
66 |
+
</tr>
|
67 |
+
</table>
|
68 |
+
{{/if}}
|
69 |
+
{{layout handle="sales_email_order_items" order=$order}}
|
70 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
71 |
+
<tr>
|
72 |
+
<td class="address-details">
|
73 |
+
<h6>Factuurgegevens:</h6>
|
74 |
+
<p><span class="no-link">{{var order.getBillingAddress().format('html')}}</span></p>
|
75 |
+
</td>
|
76 |
+
{{depend order.getIsNotVirtual()}}
|
77 |
+
<td class="address-details">
|
78 |
+
<h6>Adresgegevens:</h6>
|
79 |
+
<p><span class="no-link">{{var order.getShippingAddress().format('html')}}</span></p>
|
80 |
+
</td>
|
81 |
+
{{/depend}}
|
82 |
+
</tr>
|
83 |
+
<tr>
|
84 |
+
{{depend order.getIsNotVirtual()}}
|
85 |
+
<td class="method-info">
|
86 |
+
<h6>Verzendwijze:</h6>
|
87 |
+
<p>{{var order.shipping_description}}</p>
|
88 |
+
</td>
|
89 |
+
{{/depend}}
|
90 |
+
<td class="method-info">
|
91 |
+
<h6>Betaalwijze:</h6>
|
92 |
+
{{var payment_html}}
|
93 |
+
</td>
|
94 |
+
</tr>
|
95 |
+
</table>
|
96 |
+
</td>
|
97 |
+
</tr>
|
98 |
+
</table>
|
99 |
+
|
100 |
+
{{template config_path="design/email/footer"}}
|
app/locale/nl_NL/template/email/cgp/paymentlink_guest.html
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject {{var store.getFrontendName()}}: Betaaluitnodiging bestelling # {{var order.increment_id}} @-->
|
2 |
+
<!--@vars
|
3 |
+
{"store url=\"\"":"Store Url",
|
4 |
+
"var logo_url":"Email Logo Image Url",
|
5 |
+
"var logo_alt":"Email Logo Image Alt",
|
6 |
+
"htmlescape var=$order.getCustomerName()":"Customer Name",
|
7 |
+
"var store.getFrontendName()":"Store Name",
|
8 |
+
"store url=\"customer/account/\"":"Customer Account Url",
|
9 |
+
"var order.increment_id":"Order Id",
|
10 |
+
"var order.getCreatedAtFormated('long')":"Order Created At (datetime)",
|
11 |
+
"var order.getBillingAddress().format('html')":"Billing Address",
|
12 |
+
"var payment_html":"Payment Details",
|
13 |
+
"var order.getShippingAddress().format('html')":"Shipping Address",
|
14 |
+
"var order.getShippingDescription()":"Shipping Description",
|
15 |
+
"layout handle=\"sales_email_order_items\" order=$order":"Order Items Grid",
|
16 |
+
"var order.getEmailCustomerNote()":"Email Order Note"}
|
17 |
+
@-->
|
18 |
+
<!--@styles
|
19 |
+
@-->
|
20 |
+
|
21 |
+
{{template config_path="design/email/header"}}
|
22 |
+
{{inlinecss file="email-inline.css"}}
|
23 |
+
|
24 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
25 |
+
<tr>
|
26 |
+
<td>
|
27 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
28 |
+
<tr>
|
29 |
+
<td class="email-heading">
|
30 |
+
<h1>Beste {{htmlescape var=$order.getBillingAddress().getName()}},</h1>
|
31 |
+
<p>Bedankt voor uw bestelling bij {{var store.getFrontendName()}}.</p>
|
32 |
+
<p>Zodra uw betaling voldaan is wordt uw bestelling verzonden. Een samenvatting van uw bestelling vindt u hieronder. Nogmaals bedankt voor uw bestelling.</p>
|
33 |
+
</td>
|
34 |
+
<td class="store-info">
|
35 |
+
<h4>Heeft u vragen over uw bestelling?</h4>
|
36 |
+
<p>
|
37 |
+
{{depend store_phone}}
|
38 |
+
<b>Bel ons:</b>
|
39 |
+
<a href="tel:{{var phone}}">{{var store_phone}}</a><br>
|
40 |
+
{{/depend}}
|
41 |
+
{{depend store_hours}}
|
42 |
+
<span class="no-link">{{var store_hours}}</span><br>
|
43 |
+
{{/depend}}
|
44 |
+
{{depend store_email}}
|
45 |
+
<b>E-Mail:</b> <a href="mailto:{{var store_email}}">{{var store_email}}</a>
|
46 |
+
{{/depend}}
|
47 |
+
</p>
|
48 |
+
</td>
|
49 |
+
</tr>
|
50 |
+
</table>
|
51 |
+
</td>
|
52 |
+
</tr>
|
53 |
+
<tr>
|
54 |
+
<td class="order-details">
|
55 |
+
<h3><a href="{{var payment_link}}">Klik hier om uw bestelling te voltooien</a></h3>
|
56 |
+
<h3>Uw bestelling met bestelnummer <span class="no-link">#{{var order.increment_id}}</span></h3>
|
57 |
+
<p>Geplaatst op {{var order.getCreatedAtFormated('long')}}</p>
|
58 |
+
</td>
|
59 |
+
</tr>
|
60 |
+
<tr class="order-information">
|
61 |
+
<td>
|
62 |
+
{{if order.getEmailCustomerNote()}}
|
63 |
+
<table cellspacing="0" cellpadding="0" class="message-container">
|
64 |
+
<tr>
|
65 |
+
<td>{{var order.getEmailCustomerNote()}}</td>
|
66 |
+
</tr>
|
67 |
+
</table>
|
68 |
+
{{/if}}
|
69 |
+
{{layout handle="sales_email_order_items" order=$order}}
|
70 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
71 |
+
<tr>
|
72 |
+
<td class="address-details">
|
73 |
+
<h6>Factuurgegevens:</h6>
|
74 |
+
<p><span class="no-link">{{var order.getBillingAddress().format('html')}}</span></p>
|
75 |
+
</td>
|
76 |
+
{{depend order.getIsNotVirtual()}}
|
77 |
+
<td class="address-details">
|
78 |
+
<h6>Adresgegevens:</h6>
|
79 |
+
<p><span class="no-link">{{var order.getShippingAddress().format('html')}}</span></p>
|
80 |
+
</td>
|
81 |
+
{{/depend}}
|
82 |
+
</tr>
|
83 |
+
<tr>
|
84 |
+
{{depend order.getIsNotVirtual()}}
|
85 |
+
<td class="method-info">
|
86 |
+
<h6>Verzendwijze:</h6>
|
87 |
+
<p>{{var order.shipping_description}}</p>
|
88 |
+
</td>
|
89 |
+
{{/depend}}
|
90 |
+
<td class="method-info">
|
91 |
+
<h6>Betaalwijze:</h6>
|
92 |
+
{{var payment_html}}
|
93 |
+
</td>
|
94 |
+
</tr>
|
95 |
+
</table>
|
96 |
+
</td>
|
97 |
+
</tr>
|
98 |
+
</table>
|
99 |
+
|
100 |
+
{{template config_path="design/email/footer"}}
|
package.xml
CHANGED
@@ -1,18 +1,22 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Cardgate_Cgp</name>
|
4 |
-
<version>1.2.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Card Gate Payment Module</summary>
|
10 |
<description>Card Gate is a Payment Service Provider from the Netherlands. We offer various payment methods against competitive rates.</description>
|
11 |
-
<notes>- Added
|
|
|
|
|
|
|
|
|
12 |
<authors><author><name>Cardgate BV</name><user>cardgateplus</user><email>support@cardgate.com</email></author></authors>
|
13 |
-
<date>
|
14 |
-
<time>
|
15 |
-
<contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><file name="cardgate_cgp.css" hash="bebfc13fca1b36867c17864ae70fdabd"/><dir name="images"><dir name="cardgate"><file name="cardgate_cgp.png" hash="b97b15baba0b27042733c8ea4b4fb6bc"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="nl_NL"><file name="Cardgate_Cgp.csv" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.0</min><max>7.1.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Cardgate_Cgp</name>
|
4 |
+
<version>1.2.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Card Gate Payment Module</summary>
|
10 |
<description>Card Gate is a Payment Service Provider from the Netherlands. We offer various payment methods against competitive rates.</description>
|
11 |
+
<notes>- Added 'send payment link email'
|
12 |
+
- Added support for orders created by admins
|
13 |
+
- Added iDEAL QR
|
14 |
+
- Added paysafecard
|
15 |
+
- Fixed correct processing of some declined creditcard transactions</notes>
|
16 |
<authors><author><name>Cardgate BV</name><user>cardgateplus</user><email>support@cardgate.com</email></author></authors>
|
17 |
+
<date>2017-04-14</date>
|
18 |
+
<time>14:36:57</time>
|
19 |
+
<contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><file name="cardgate_cgp.css" hash="bebfc13fca1b36867c17864ae70fdabd"/><dir name="images"><dir name="cardgate"><file name="cardgate_cgp.png" hash="b97b15baba0b27042733c8ea4b4fb6bc"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="nl_NL"><file name="Cardgate_Cgp.csv" hash="7383d541e93ab7506415aa87486557a2"/><dir name="template"><dir name="email"><dir name="cgp"><file name="paymentlink.html" hash="ab33a1408009855d6f280dae491ce391"/><file name="paymentlink_guest.html" hash="0ba0a7dfeedc084e4bfc01ceaedb9c2b"/></dir></dir></dir></dir><dir name="en_US"><dir name="template"><dir name="email"><dir name="cgp"><file name="paymentlink.html" hash="d1fbedec6b157543b0ea977804488c6b"/><file name="paymentlink_guest.html" hash="d1fbedec6b157543b0ea977804488c6b"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="ZzCardgate_Cgp.xml" hash="c7a72af045f4b737b50cc6c360d4300d"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="cardgate"><dir name="cgp"><dir name="checkout"><file name="fee.phtml" hash="79362bab3963195ad6727d077fe87b11"/></dir><dir name="email"><dir name="sales"><file name="order_new.html" hash="983abaac854ee17fa7bc76860ec3cff9"/><file name="order_new_guest.html" hash="0f12070e3350a89f67ae8d9c8350095a"/></dir></dir><dir name="form"><file name="banktransfer.phtml" hash="ff7a2a827a7b7a5ed9bcb5d484c30c68"/><file name="ideal.phtml" hash="42fdfee86ba3a098f5f73e9240332581"/><file name="klarna.phtml" hash="e2876171abf8e94d7b77a47ce9279561"/><file name="klarnaaccount.phtml" hash="419f88941703c8562369844bb6a1d692"/></dir><file name="redirect.phtml" hash="ecb2b0a854cd6358adeba535f8889046"/></dir></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="Cardgate"><dir name="Cgp"><dir name="Block"><dir name="Adminhtml"><dir name="Paymentlink"><file name="Resend.php" hash="fe009149884754f27fa9a7989cb6dbf6"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Version.php" hash="763fe8ee500ef1ed7db22c4f81e83b96"/></dir></dir></dir></dir><dir name="Form"><file name="Banktransfer.php" hash="be49e1b58910ee33b329badaa9fc85ce"/><file name="Ideal.php" hash="24a367e9b73955b3579438cb5eec213c"/><file name="Klarna.php" hash="c66cbcc135151dcc4337d22fc0552a46"/><file name="Klarnaaccount.php" hash="77e35328922bfb232f93896b77367c1e"/></dir><dir name="Info"><file name="Payment.php" hash="6fc6b4f3374fd2c82a2d27e83c05f9e3"/></dir><dir name="Paymentfee"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Totals.php" hash="7b2d199e11a13936213e87a54bc09e5c"/></dir></dir></dir><dir name="Checkout"><file name="Fee.php" hash="07e72679dc8ddd5f7e2db9e24bb76aa6"/></dir><dir name="Creditmemo"><file name="Totals.php" hash="87021e3b682c1abf1ae95e173730023a"/></dir><dir name="Invoice"><dir name="Totals"><file name="Fee.php" hash="40c399761dccfd494d7cfb439447c5e3"/></dir></dir><dir name="Order"><dir name="Totals"><file name="Fee.php" hash="0cde857c2b7f33cdb5927143a98f0958"/></dir></dir></dir><file name="Redirect.php" hash="2f854d58133eebad7f128a08d799f7ef"/></dir><dir name="Helper"><file name="Data.php" hash="ed47b3c61a5e701e1683a7717c6b8ef1"/><file name="Paymentfee.php" hash="23700e6d5f7f96f149214679fa6ed614"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Languages.php" hash="fb24871559fa1ce2613438ad5613a196"/><file name="Modes.php" hash="678a822a7f0c0665fc696c44937825be"/><file name="Orderstatus.php" hash="610ca9cedb01e329d821f4e407e5bfc8"/><file name="Version.php" hash="818a7ae5f4126fbb0c8fc76376e03c65"/></dir></dir></dir></dir><file name="Base.php" hash="590eb09637530d4d940e3534e1fb2248"/><dir name="Gateway"><file name="Abstract.php" hash="9515b2eba45051aa7a70c6bddad23e08"/><file name="Afterpay.php" hash="054b525c972119fd330291776c2550ac"/><file name="Americanexpress.php" hash="705926d7a69fb889f54185743f4cac9f"/><file name="Banktransfer.php" hash="d4d5712ab327c418ee2d949e49faee01"/><file name="Bitcoin.php" hash="001420be0c8d665d905bcc79275e989e"/><file name="Cartebancaire.php" hash="451bff78fa26e4bae883d0c18ca1f844"/><file name="Cartebleue.php" hash="b7974f8f8e655daaf50a899d15cc15fd"/><file name="Default.php" hash="dd934ee60d32000773f26be805d46925"/><file name="Directdebit.php" hash="7890209183bab5f47edcca60a19cd007"/><file name="Giropay.php" hash="ea35629ddfd08cd341128af6d95c8911"/><file name="Ideal.php" hash="1b5b6318c3e544659f465fdbc463fa51"/><file name="Idealqr.php" hash="99612b830026b61908ce318f8764d1cd"/><file name="Klarna.php" hash="901891d606ea469296e75251fc7abe14"/><file name="Klarnaaccount.php" hash="4d85440b0df2df05ec001c6a5d7416dd"/><file name="Maestro.php" hash="c29f0bd00282c992017a2487d12d8bda"/><file name="Mastercard.php" hash="3febe4f0ee3cc630cd959e8ce086d2ee"/><file name="Mistercash.php" hash="d618b6ab14ffa5d9810cf65232b6d2a3"/><file name="Paypal.php" hash="ad4600fdc877a84a6a4f8647ae2587df"/><file name="Paysafecard.php" hash="3a4173e24c4ded9b25270b6c1eeae4ff"/><file name="Pos.php" hash="8450a1a6a074bc04c7ea63ac5738c48a"/><file name="Przelewy24.php" hash="f49bfa8354fa2bce2add3221a04843cf"/><file name="Sofortbanking.php" hash="544531b74c8fd34e7ccd48a32210d81f"/><file name="Visa.php" hash="50cbf582c2b5192923d290fcbec35870"/><file name="Vpay.php" hash="acf7d286f343b4e663a55a8540bf45d2"/><file name="Webmoney.php" hash="72a36f0854db4c02e0477208b47faccf"/></dir><file name="Observer.php" hash="150fdf7b6d530b45ae8d2d3ad7ff9adf"/><dir name="Paymentfee"><dir name="Creditmemo"><file name="Total.php" hash="5191056c5dae3862c2a468acd3e5cbac"/></dir><dir name="Invoice"><dir name="Pdf"><file name="Total.php" hash="314df1d94874fcb856af2e0be4019782"/></dir><file name="Tax.php" hash="dc485fa37d31e13e20f578cb58075486"/><file name="Total.php" hash="f26e4dc51d0e510eb1c2c65750dec92b"/></dir><dir name="Quote"><file name="Quote.php" hash="d09d4d5c4b55770b0a50f80f0a5fa643"/><file name="TaxTotal.php" hash="a1f53b6ed1988364aa396b3bd7afa1e0"/><file name="Total.php" hash="a525e84dc0d62a4ca073a7ddb80f162b"/></dir></dir><file name="Paymentlink.php" hash="5e59973cc1734de87a130cccc072e357"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CardgateController.php" hash="f85917c188168138943c80685f70618f"/></dir><file name="StandardController.php" hash="bb9482dd9af371945241c190020e77ee"/></dir><dir name="etc"><file name="adminhtml.xml" hash="4fbe66b7e79dde67d6ac3c764230b109"/><file name="config.xml" hash="0768b8a160cd248ec0ab7ef67e341aac"/><file name="system.xml" hash="bdf811d7a7866bc97a8e08713034aaf7"/></dir><dir name="sql"><dir name="cgp_setup"><file name="mysql4-upgrade-1.2.0-1.2.1.php" hash="978d7c844cdfda957a90369495e58d2e"/></dir></dir></dir><file name=".gitignore" hash="2f0cd577d0e696bae6250e3681d0860a"/></dir></target></contents>
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>5.3.0</min><max>7.1.0</max></php></required></dependencies>
|
22 |
</package>
|