Version Notes
- fix PayPal proccessing status set on redirect to PayPal
- prevent double booking by redirecting user if he uses the browser back button
- submit billingadress instead of shipping to PayPal if the product is a digital good
- fix a bug with amount paid on automaticaly generated invoices
Download this release
Release Info
Developer | Heidelberger Payment GmbH |
Extension | HeidelpayCDEdition |
Version | 15.4.30 |
Comparing to | |
See all releases |
Code changes from version 15.3.9 to 15.4.30
- app/code/community/HeidelpayCD/Edition/Helper/Payment.php +43 -40
- app/code/community/HeidelpayCD/Edition/Model/Payment/Abstract.php +12 -4
- app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdbs.php +0 -7
- app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdeps.php +2 -0
- app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdide.php +2 -0
- app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdiv.php +0 -11
- app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdmk.php +0 -9
- app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdpal.php +10 -21
- app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdpf.php +0 -9
- app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdpp.php +0 -12
- app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdsu.php +2 -0
- app/code/community/HeidelpayCD/Edition/controllers/IndexController.php +28 -16
- app/code/community/HeidelpayCD/Edition/etc/config.xml +1 -1
- package.xml +9 -6
app/code/community/HeidelpayCD/Edition/Helper/Payment.php
CHANGED
@@ -6,9 +6,9 @@ class HeidelpayCD_Edition_Helper_Payment extends Mage_Core_Helper_Abstract
|
|
6 |
protected $_invoiceOrderEmail = true ;
|
7 |
|
8 |
protected function _getHelper()
|
9 |
-
|
10 |
return Mage::helper('hcd');
|
11 |
-
|
12 |
|
13 |
public function splitPaymentCode($PAYMENT_CODE) {
|
14 |
return preg_split('/\./' , $PAYMENT_CODE);
|
@@ -178,9 +178,9 @@ class HeidelpayCD_Edition_Helper_Payment extends Mage_Core_Helper_Abstract
|
|
178 |
$invoiceMailComment = '';
|
179 |
|
180 |
if (strtoupper($data['CRITERION_LANGUAGE']) == 'DE') {
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
};
|
185 |
|
186 |
|
@@ -199,13 +199,13 @@ class HeidelpayCD_Edition_Helper_Payment extends Mage_Core_Helper_Abstract
|
|
199 |
|
200 |
} elseif ( ( $PaymentCode[1] == 'CP' or $PaymentCode[1] == 'DB' or $PaymentCode[1] == 'FI' or $PaymentCode[1] == 'RC')
|
201 |
and ( $data['PROCESSING_RESULT'] == 'ACK' and $data['PROCESSING_STATUS_CODE'] != 80 )) {
|
202 |
-
|
203 |
/**
|
204 |
* Do nothing if status is allready successfull
|
205 |
*/
|
206 |
if ($order->getStatus() == $order->getPayment()->getMethodInstance()->getStatusSuccess() ) return ;
|
207 |
-
|
208 |
-
|
209 |
$message = (isset($data['ACCOUNT_BRAND']) and $data['ACCOUNT_BRAND'] == 'BILLSAFE') ? 'BillSafe Id: '.$data['CRITERION_BILLSAFE_REFERENCE'] : 'Heidelpay ShortID: '.$data['IDENTIFICATION_SHORTID'];
|
210 |
|
211 |
if ($PaymentCode[0] == "IV" or $PaymentCode[0] == "PP") $message = Mage::helper('hcd')->__('recived amount ').$data['PRESENTATION_AMOUNT'].' '.$data['PRESENTATION_CURRENCY'].' '.$message;
|
@@ -215,31 +215,31 @@ class HeidelpayCD_Edition_Helper_Payment extends Mage_Core_Helper_Abstract
|
|
215 |
$order->getPayment()->setIsTransactionClosed(true);
|
216 |
|
217 |
if ( $this->format($order->getGrandTotal()) == $data['PRESENTATION_AMOUNT'] and $order->getOrderCurrencyCode() == $data['PRESENTATION_CURRENCY']) {
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
$totalypaid = true ;
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
* in case rc is ack and amount is to low or curreny missmatch
|
226 |
*/
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
|
236 |
if ($order->canInvoice() and Mage::getStoreConfig($path."invioce", $data['CRITERION_STOREID']) == 1 and $totalypaid === true ) {
|
237 |
$this->log('Can Invoice ? '.($order->canInvoice()) ? 'YES': 'NO');
|
238 |
$invoice = $order->prepareInvoice();
|
|
|
239 |
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
|
240 |
$invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID);
|
241 |
-
|
242 |
-
$invoice->register();
|
243 |
$order->setIsInProcess(true);
|
244 |
$order->addStatusHistoryComment(
|
245 |
Mage::helper('hcd')->__('Automatically invoiced by Heidelpay.'),
|
@@ -259,24 +259,27 @@ class HeidelpayCD_Edition_Helper_Payment extends Mage_Core_Helper_Abstract
|
|
259 |
Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE,
|
260 |
null,
|
261 |
true,
|
262 |
-
|
263 |
);
|
|
|
264 |
$order->setIsInProcess(true);
|
265 |
}else {
|
266 |
-
$
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
$order->getPayment()->getMethodInstance()->getStatusPendig(
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
|
|
|
|
280 |
}
|
281 |
$order->save();
|
282 |
|
@@ -311,7 +314,7 @@ class HeidelpayCD_Edition_Helper_Payment extends Mage_Core_Helper_Abstract
|
|
311 |
|
312 |
if ($errorCode) {
|
313 |
if (!preg_match('/HPError-[0-9]{3}\.[0-9]{3}\.[0-9]{3}/', $this->_getHelper()->__('HPError-'.$errorCode), $matches)) //JUST return when snipet exists
|
314 |
-
|
315 |
}
|
316 |
|
317 |
return $this->_getHelper()->__('An unexpected error occurred. Please contact us to get further information.');
|
6 |
protected $_invoiceOrderEmail = true ;
|
7 |
|
8 |
protected function _getHelper()
|
9 |
+
{
|
10 |
return Mage::helper('hcd');
|
11 |
+
}
|
12 |
|
13 |
public function splitPaymentCode($PAYMENT_CODE) {
|
14 |
return preg_split('/\./' , $PAYMENT_CODE);
|
178 |
$invoiceMailComment = '';
|
179 |
|
180 |
if (strtoupper($data['CRITERION_LANGUAGE']) == 'DE') {
|
181 |
+
$locale = 'de_DE';
|
182 |
+
Mage::app()->getLocale()->setLocaleCode($locale);
|
183 |
+
Mage::getSingleton('core/translate')->setLocale($locale)->init('frontend', true);
|
184 |
};
|
185 |
|
186 |
|
199 |
|
200 |
} elseif ( ( $PaymentCode[1] == 'CP' or $PaymentCode[1] == 'DB' or $PaymentCode[1] == 'FI' or $PaymentCode[1] == 'RC')
|
201 |
and ( $data['PROCESSING_RESULT'] == 'ACK' and $data['PROCESSING_STATUS_CODE'] != 80 )) {
|
202 |
+
|
203 |
/**
|
204 |
* Do nothing if status is allready successfull
|
205 |
*/
|
206 |
if ($order->getStatus() == $order->getPayment()->getMethodInstance()->getStatusSuccess() ) return ;
|
207 |
+
|
208 |
+
|
209 |
$message = (isset($data['ACCOUNT_BRAND']) and $data['ACCOUNT_BRAND'] == 'BILLSAFE') ? 'BillSafe Id: '.$data['CRITERION_BILLSAFE_REFERENCE'] : 'Heidelpay ShortID: '.$data['IDENTIFICATION_SHORTID'];
|
210 |
|
211 |
if ($PaymentCode[0] == "IV" or $PaymentCode[0] == "PP") $message = Mage::helper('hcd')->__('recived amount ').$data['PRESENTATION_AMOUNT'].' '.$data['PRESENTATION_CURRENCY'].' '.$message;
|
215 |
$order->getPayment()->setIsTransactionClosed(true);
|
216 |
|
217 |
if ( $this->format($order->getGrandTotal()) == $data['PRESENTATION_AMOUNT'] and $order->getOrderCurrencyCode() == $data['PRESENTATION_CURRENCY']) {
|
218 |
+
$order->setState( $order->getPayment()->getMethodInstance()->getStatusSuccess(false),
|
219 |
+
$order->getPayment()->getMethodInstance()->getStatusSuccess(true),
|
220 |
+
$message );
|
221 |
$totalypaid = true ;
|
222 |
+
|
223 |
+
} else {
|
224 |
+
/*
|
225 |
* in case rc is ack and amount is to low or curreny missmatch
|
226 |
*/
|
227 |
+
$order->setState( $order->getPayment()->getMethodInstance()->getStatusPartlyPaid(false),
|
228 |
+
$order->getPayment()->getMethodInstance()->getStatusPartlyPaid(true),
|
229 |
+
$message );
|
230 |
+
}
|
231 |
+
|
232 |
+
$path = "payment/".$order->getPayment()->getMethodInstance()->getCode()."/";
|
233 |
+
|
234 |
+
$this->log($path.' Auto invoiced :'.Mage::getStoreConfig($path."invioce", $data['CRITERION_STOREID']).$data['CRITERION_STOREID']);
|
235 |
|
236 |
if ($order->canInvoice() and Mage::getStoreConfig($path."invioce", $data['CRITERION_STOREID']) == 1 and $totalypaid === true ) {
|
237 |
$this->log('Can Invoice ? '.($order->canInvoice()) ? 'YES': 'NO');
|
238 |
$invoice = $order->prepareInvoice();
|
239 |
+
$invoice->register()->capture();
|
240 |
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
|
241 |
$invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID);
|
242 |
+
$invoice->setIsPaid(true);
|
|
|
243 |
$order->setIsInProcess(true);
|
244 |
$order->addStatusHistoryComment(
|
245 |
Mage::helper('hcd')->__('Automatically invoiced by Heidelpay.'),
|
259 |
Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE,
|
260 |
null,
|
261 |
true,
|
262 |
+
$message
|
263 |
);
|
264 |
+
|
265 |
$order->setIsInProcess(true);
|
266 |
}else {
|
267 |
+
if ($order->getStatus() != $order->getPayment()->getMethodInstance()->getStatusSuccess() and $order->getStatus() != $order->getPayment()->getMethodInstance()->getStatusError()) {
|
268 |
+
$message = (isset($data['ACCOUNT_BRAND']) and $data['ACCOUNT_BRAND'] == 'BILLSAFE') ? 'BillSafe Id: '.$data['CRITERION_BILLSAFE_REFERENCE'] : 'Heidelpay ShortID: '.$data['IDENTIFICATION_SHORTID'];
|
269 |
+
$order->getPayment()->setTransactionId($data['IDENTIFICATION_UNIQUEID']);
|
270 |
+
$order->getPayment()->setIsTransactionClosed(0);
|
271 |
+
$order->getPayment()->setTransactionAdditionalInfo(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS, null);
|
272 |
+
$this->log('Set Transaction to Pending : '.$order->getPayment()->getMethodInstance()->getStatusPendig());
|
273 |
+
$order->setState( $order->getPayment()->getMethodInstance()->getStatusPendig(false),
|
274 |
+
$order->getPayment()->getMethodInstance()->getStatusPendig(true),
|
275 |
+
$message );
|
276 |
+
$order->getPayment()->addTransaction(
|
277 |
+
Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH,
|
278 |
+
null,
|
279 |
+
true,
|
280 |
+
$message
|
281 |
+
);
|
282 |
+
}
|
283 |
}
|
284 |
$order->save();
|
285 |
|
314 |
|
315 |
if ($errorCode) {
|
316 |
if (!preg_match('/HPError-[0-9]{3}\.[0-9]{3}\.[0-9]{3}/', $this->_getHelper()->__('HPError-'.$errorCode), $matches)) //JUST return when snipet exists
|
317 |
+
return $this->_getHelper()->__('HPError-'.$errorCode);
|
318 |
}
|
319 |
|
320 |
return $this->_getHelper()->__('An unexpected error occurred. Please contact us to get further information.');
|
app/code/community/HeidelpayCD/Edition/Model/Payment/Abstract.php
CHANGED
@@ -428,16 +428,21 @@ class HeidelpayCD_Edition_Model_Payment_Abstract extends Mage_Payment_Model_Meth
|
|
428 |
$Autorisation = Mage::getModel('hcd/transaction')->getOneTransactionByMethode($order->getRealOrderId() , 'PA');
|
429 |
|
430 |
$config = $this->getMainConfig($this->_code, $Autorisation['CRITERION_STOREID']);
|
431 |
-
$config['PAYMENT.TYPE'] = ($this->_code == 'hcdbs') ? 'FI' : 'CP'; // If billsafe set to fin
|
432 |
|
433 |
-
|
434 |
-
|
|
|
|
|
|
|
|
|
435 |
foreach ($Autorisation AS $k => $v){
|
|
|
436 |
|
437 |
}
|
438 |
|
439 |
}
|
440 |
*/
|
|
|
441 |
$frontend = $this->getFrontend($order->getRealOrderId(), $Autorisation['CRITERION_STOREID']);
|
442 |
$frontend['FRONTEND.MODE'] = 'DEFAULT';
|
443 |
$frontend['FRONTEND.ENABLED'] = 'false';
|
@@ -450,6 +455,8 @@ class HeidelpayCD_Edition_Model_Payment_Abstract extends Mage_Payment_Model_Meth
|
|
450 |
|
451 |
$params = Mage::helper('hcd/payment')->preparePostData( $config, $frontend, $user, $basketData,
|
452 |
$criterion=array());
|
|
|
|
|
453 |
|
454 |
$this->log("doRequest url : ".$config['URL']);
|
455 |
$this->log("doRequest params : ".print_r($params,1));
|
@@ -457,7 +464,8 @@ class HeidelpayCD_Edition_Model_Payment_Abstract extends Mage_Payment_Model_Meth
|
|
457 |
$src = Mage::helper('hcd/payment')->doRequest($config['URL'], $params);
|
458 |
|
459 |
$this->log("doRequest response : ".print_r($src,1));
|
460 |
-
|
|
|
461 |
|
462 |
if($src['PROCESSING_RESULT'] == "NOK") {
|
463 |
Mage::throwException('Heidelpay Error: '.$src['PROCESSING_RETURN']);
|
428 |
$Autorisation = Mage::getModel('hcd/transaction')->getOneTransactionByMethode($order->getRealOrderId() , 'PA');
|
429 |
|
430 |
$config = $this->getMainConfig($this->_code, $Autorisation['CRITERION_STOREID']);
|
|
|
431 |
|
432 |
+
|
433 |
+
// finalize function for invoice and billsafe transactions
|
434 |
+
$config['PAYMENT.TYPE'] = ($this->_code == 'hcdbs' or $this->_code == 'hcdiv') ? 'FI' : 'CP'; // If billsafe or invoice set to fin
|
435 |
+
|
436 |
+
/*
|
437 |
+
if($this->_code == 'hcdbs' or $this->_code == 'hcdiv') {
|
438 |
foreach ($Autorisation AS $k => $v){
|
439 |
+
if (strpos( $k , 'CRITERION')) $basketData[$k] = $v ;
|
440 |
|
441 |
}
|
442 |
|
443 |
}
|
444 |
*/
|
445 |
+
|
446 |
$frontend = $this->getFrontend($order->getRealOrderId(), $Autorisation['CRITERION_STOREID']);
|
447 |
$frontend['FRONTEND.MODE'] = 'DEFAULT';
|
448 |
$frontend['FRONTEND.ENABLED'] = 'false';
|
455 |
|
456 |
$params = Mage::helper('hcd/payment')->preparePostData( $config, $frontend, $user, $basketData,
|
457 |
$criterion=array());
|
458 |
+
|
459 |
+
|
460 |
|
461 |
$this->log("doRequest url : ".$config['URL']);
|
462 |
$this->log("doRequest params : ".print_r($params,1));
|
464 |
$src = Mage::helper('hcd/payment')->doRequest($config['URL'], $params);
|
465 |
|
466 |
$this->log("doRequest response : ".print_r($src,1));
|
467 |
+
//Mage::throwException('Heidelpay Error: '.'<pre>'.print_r($src,1).'</pre>');
|
468 |
+
|
469 |
|
470 |
if($src['PROCESSING_RESULT'] == "NOK") {
|
471 |
Mage::throwException('Heidelpay Error: '.$src['PROCESSING_RETURN']);
|
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdbs.php
CHANGED
@@ -2,15 +2,8 @@
|
|
2 |
class HeidelpayCD_Edition_Model_Payment_Hcdbs extends HeidelpayCD_Edition_Model_Payment_Abstract
|
3 |
{
|
4 |
protected $_code = 'hcdbs';
|
5 |
-
protected $_isGateway = true;
|
6 |
-
protected $_canAuthorize = false;
|
7 |
protected $_canRefund = false;
|
8 |
protected $_canRefundInvoicePartial = false;
|
9 |
-
protected $_canVoid = false;
|
10 |
-
protected $_canUseInternal = false;
|
11 |
-
protected $_canUseCheckout = true;
|
12 |
-
protected $_canUseForMultishipping = false;
|
13 |
-
protected $_isInitializeNeeded = false;
|
14 |
|
15 |
|
16 |
public function isAvailable($quote=null) {
|
2 |
class HeidelpayCD_Edition_Model_Payment_Hcdbs extends HeidelpayCD_Edition_Model_Payment_Abstract
|
3 |
{
|
4 |
protected $_code = 'hcdbs';
|
|
|
|
|
5 |
protected $_canRefund = false;
|
6 |
protected $_canRefundInvoicePartial = false;
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
|
9 |
public function isAvailable($quote=null) {
|
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdeps.php
CHANGED
@@ -7,6 +7,8 @@ class HeidelpayCD_Edition_Model_Payment_Hcdeps extends HeidelpayCD_Edition_Model
|
|
7 |
* @var string [a-z0-9_]
|
8 |
**/
|
9 |
protected $_code = 'hcdeps';
|
|
|
|
|
10 |
|
11 |
protected $_formBlockType = 'hcd/form_eps';
|
12 |
|
7 |
* @var string [a-z0-9_]
|
8 |
**/
|
9 |
protected $_code = 'hcdeps';
|
10 |
+
protected $_canRefund = false;
|
11 |
+
protected $_canRefundInvoicePartial = false;
|
12 |
|
13 |
protected $_formBlockType = 'hcd/form_eps';
|
14 |
|
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdide.php
CHANGED
@@ -7,6 +7,8 @@ class HeidelpayCD_Edition_Model_Payment_Hcdide extends HeidelpayCD_Edition_Model
|
|
7 |
* @var string [a-z0-9_]
|
8 |
**/
|
9 |
protected $_code = 'hcdide';
|
|
|
|
|
10 |
|
11 |
protected $_formBlockType = 'hcd/form_ideal';
|
12 |
|
7 |
* @var string [a-z0-9_]
|
8 |
**/
|
9 |
protected $_code = 'hcdide';
|
10 |
+
protected $_canRefund = false;
|
11 |
+
protected $_canRefundInvoicePartial = false;
|
12 |
|
13 |
protected $_formBlockType = 'hcd/form_ideal';
|
14 |
|
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdiv.php
CHANGED
@@ -2,17 +2,6 @@
|
|
2 |
class HeidelpayCD_Edition_Model_Payment_Hcdiv extends HeidelpayCD_Edition_Model_Payment_Abstract
|
3 |
{
|
4 |
protected $_code = 'hcdiv';
|
5 |
-
protected $_isGateway = true;
|
6 |
-
protected $_canAuthorize = false;
|
7 |
-
protected $_canCapture = false;
|
8 |
-
protected $_canCapturePartial = false;
|
9 |
-
protected $_canRefund = true;
|
10 |
-
protected $_canRefundInvoicePartial = true;
|
11 |
-
protected $_canVoid = false;
|
12 |
-
protected $_canUseInternal = false;
|
13 |
-
protected $_canUseCheckout = true;
|
14 |
-
protected $_canUseForMultishipping = false;
|
15 |
-
protected $_isInitializeNeeded = false;
|
16 |
|
17 |
}
|
18 |
|
2 |
class HeidelpayCD_Edition_Model_Payment_Hcdiv extends HeidelpayCD_Edition_Model_Payment_Abstract
|
3 |
{
|
4 |
protected $_code = 'hcdiv';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
}
|
7 |
|
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdmk.php
CHANGED
@@ -2,17 +2,8 @@
|
|
2 |
class HeidelpayCD_Edition_Model_Payment_Hcdmk extends HeidelpayCD_Edition_Model_Payment_Abstract
|
3 |
{
|
4 |
protected $_code = 'hcdmk';
|
5 |
-
protected $_isGateway = true;
|
6 |
-
protected $_canAuthorize = false;
|
7 |
-
protected $_canCapture = false;
|
8 |
-
protected $_canCapturePartial = false;
|
9 |
protected $_canRefund = false;
|
10 |
protected $_canRefundInvoicePartial = false;
|
11 |
-
protected $_canVoid = false;
|
12 |
-
protected $_canUseInternal = false;
|
13 |
-
protected $_canUseCheckout = true;
|
14 |
-
protected $_canUseForMultishipping = false;
|
15 |
-
protected $_isInitializeNeeded = false;
|
16 |
|
17 |
public function isAvailable($quote=null) {
|
18 |
$currency_code=$this->getQuote()->getQuoteCurrencyCode();
|
2 |
class HeidelpayCD_Edition_Model_Payment_Hcdmk extends HeidelpayCD_Edition_Model_Payment_Abstract
|
3 |
{
|
4 |
protected $_code = 'hcdmk';
|
|
|
|
|
|
|
|
|
5 |
protected $_canRefund = false;
|
6 |
protected $_canRefundInvoicePartial = false;
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
public function isAvailable($quote=null) {
|
9 |
$currency_code=$this->getQuote()->getQuoteCurrencyCode();
|
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdpal.php
CHANGED
@@ -7,17 +7,6 @@ class HeidelpayCD_Edition_Model_Payment_Hcdpal extends HeidelpayCD_Edition_Model
|
|
7 |
* @var string [a-z0-9_]
|
8 |
**/
|
9 |
protected $_code = 'hcdpal';
|
10 |
-
protected $_isGateway = true;
|
11 |
-
protected $_canAuthorize = true;
|
12 |
-
protected $_canCapture = true;
|
13 |
-
protected $_canCapturePartial = true;
|
14 |
-
protected $_canRefund = false;
|
15 |
-
protected $_canRefundInvoicePartial = false;
|
16 |
-
protected $_canVoid = false;
|
17 |
-
protected $_canUseInternal = false;
|
18 |
-
protected $_canUseCheckout = true;
|
19 |
-
protected $_canUseForMultishipping = false;
|
20 |
-
protected $_isInitializeNeeded = false;
|
21 |
|
22 |
|
23 |
/*
|
@@ -28,18 +17,18 @@ class HeidelpayCD_Edition_Model_Payment_Hcdpal extends HeidelpayCD_Edition_Model
|
|
28 |
$user = array();
|
29 |
|
30 |
$user = parent::getUser($order, $isReg);
|
31 |
-
$
|
32 |
-
$email = ($
|
33 |
|
34 |
|
35 |
-
$user['IDENTIFICATION.SHOPPERID'] = $
|
36 |
-
if ($
|
37 |
-
$user['NAME.GIVEN'] = trim($
|
38 |
-
$user['NAME.FAMILY'] = trim($
|
39 |
-
$user['ADDRESS.STREET'] = $
|
40 |
-
$user['ADDRESS.ZIP'] = $
|
41 |
-
$user['ADDRESS.CITY'] = $
|
42 |
-
$user['ADDRESS.COUNTRY'] = $
|
43 |
$user['CONTACT.EMAIL'] = $email;
|
44 |
|
45 |
return $user;
|
7 |
* @var string [a-z0-9_]
|
8 |
**/
|
9 |
protected $_code = 'hcdpal';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
|
12 |
/*
|
17 |
$user = array();
|
18 |
|
19 |
$user = parent::getUser($order, $isReg);
|
20 |
+
$adress = (empty($order->getShippingAddress())) ? $order->getBillingAddress() : $order->getShippingAddress() ;
|
21 |
+
$email = ($adress->getEmail()) ? $adress->getEmail() : $order->getCustomerEmail();
|
22 |
|
23 |
|
24 |
+
$user['IDENTIFICATION.SHOPPERID'] = $adress->getCustomerId();
|
25 |
+
if ($adress->getCompany() == true) $user['NAME.COMPANY'] = trim($adress->getCompany());
|
26 |
+
$user['NAME.GIVEN'] = trim($adress->getFirstname());
|
27 |
+
$user['NAME.FAMILY'] = trim($adress->getLastname());
|
28 |
+
$user['ADDRESS.STREET'] = $adress->getStreet1()." ".$adress->getStreet2();
|
29 |
+
$user['ADDRESS.ZIP'] = $adress->getPostcode();
|
30 |
+
$user['ADDRESS.CITY'] = $adress->getCity();
|
31 |
+
$user['ADDRESS.COUNTRY'] = $adress->getCountry();
|
32 |
$user['CONTACT.EMAIL'] = $email;
|
33 |
|
34 |
return $user;
|
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdpf.php
CHANGED
@@ -2,17 +2,8 @@
|
|
2 |
class HeidelpayCD_Edition_Model_Payment_Hcdpf extends HeidelpayCD_Edition_Model_Payment_Abstract
|
3 |
{
|
4 |
protected $_code = 'hcdpf';
|
5 |
-
protected $_isGateway = true;
|
6 |
-
protected $_canAuthorize = false;
|
7 |
-
protected $_canCapture = false;
|
8 |
-
protected $_canCapturePartial = false;
|
9 |
protected $_canRefund = false;
|
10 |
protected $_canRefundInvoicePartial = false;
|
11 |
-
protected $_canVoid = false;
|
12 |
-
protected $_canUseInternal = false;
|
13 |
-
protected $_canUseCheckout = true;
|
14 |
-
protected $_canUseForMultishipping = false;
|
15 |
-
protected $_isInitializeNeeded = false;
|
16 |
protected $_formBlockType = 'hcd/form_postfinance';
|
17 |
|
18 |
public function getFormBlockType(){
|
2 |
class HeidelpayCD_Edition_Model_Payment_Hcdpf extends HeidelpayCD_Edition_Model_Payment_Abstract
|
3 |
{
|
4 |
protected $_code = 'hcdpf';
|
|
|
|
|
|
|
|
|
5 |
protected $_canRefund = false;
|
6 |
protected $_canRefundInvoicePartial = false;
|
|
|
|
|
|
|
|
|
|
|
7 |
protected $_formBlockType = 'hcd/form_postfinance';
|
8 |
|
9 |
public function getFormBlockType(){
|
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdpp.php
CHANGED
@@ -2,18 +2,6 @@
|
|
2 |
class HeidelpayCD_Edition_Model_Payment_Hcdpp extends HeidelpayCD_Edition_Model_Payment_Abstract
|
3 |
{
|
4 |
protected $_code = 'hcdpp';
|
5 |
-
protected $_isGateway = true;
|
6 |
-
protected $_canAuthorize = false;
|
7 |
-
protected $_canCapture = false;
|
8 |
-
protected $_canCapturePartial = false;
|
9 |
-
protected $_canRefund = true;
|
10 |
-
protected $_canRefundInvoicePartial = true;
|
11 |
-
protected $_canVoid = false;
|
12 |
-
protected $_canUseInternal = true;
|
13 |
-
protected $_canUseCheckout = true;
|
14 |
-
protected $_canUseForMultishipping = false;
|
15 |
-
protected $_isInitializeNeeded = true;
|
16 |
-
protected $_debug = true;
|
17 |
|
18 |
|
19 |
public function showPaymentInfo($payment_data) {
|
2 |
class HeidelpayCD_Edition_Model_Payment_Hcdpp extends HeidelpayCD_Edition_Model_Payment_Abstract
|
3 |
{
|
4 |
protected $_code = 'hcdpp';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
|
7 |
public function showPaymentInfo($payment_data) {
|
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdsu.php
CHANGED
@@ -7,6 +7,8 @@ class HeidelpayCD_Edition_Model_Payment_Hcdsu extends HeidelpayCD_Edition_Model_
|
|
7 |
* @var string [a-z0-9_]
|
8 |
**/
|
9 |
protected $_code = 'hcdsu';
|
|
|
|
|
10 |
|
11 |
}
|
12 |
|
7 |
* @var string [a-z0-9_]
|
8 |
**/
|
9 |
protected $_code = 'hcdsu';
|
10 |
+
protected $_canRefund = false;
|
11 |
+
protected $_canRefundInvoicePartial = false;
|
12 |
|
13 |
}
|
14 |
|
app/code/community/HeidelpayCD/Edition/controllers/IndexController.php
CHANGED
@@ -115,6 +115,10 @@ class HeidelpayCD_Edition_IndexController extends Mage_Core_Controller_Front_Act
|
|
115 |
return $this;
|
116 |
}
|
117 |
|
|
|
|
|
|
|
|
|
118 |
$this->getCheckout()->getQuote()->setIsActive(false)->save();
|
119 |
$this->getCheckout()->clear();
|
120 |
|
@@ -138,14 +142,16 @@ class HeidelpayCD_Edition_IndexController extends Mage_Core_Controller_Front_Act
|
|
138 |
$this->getCheckout()->setLastSuccessQuoteId($quoteID);
|
139 |
$this->log('LastQuteID :'. $quoteID );
|
140 |
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
|
|
|
|
145 |
|
146 |
-
if($order->getId()) {
|
147 |
$order->sendNewOrderEmail();
|
148 |
-
|
149 |
}
|
150 |
$order->save();
|
151 |
$this->_redirect('checkout/onepage/success', array('_secure' => true));
|
@@ -238,6 +244,21 @@ class HeidelpayCD_Edition_IndexController extends Mage_Core_Controller_Front_Act
|
|
238 |
return $this;
|
239 |
}
|
240 |
$payment = $order->getPayment()->getMethodInstance();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
$data = $payment->getHeidelpayUrl();
|
242 |
|
243 |
if($data['POST_VALIDATION'] == 'ACK' and $data['PROCESSING_RESULT'] == 'ACK' )
|
@@ -498,16 +519,7 @@ class HeidelpayCD_Edition_IndexController extends Mage_Core_Controller_Front_Act
|
|
498 |
foreach($data AS $k) echo "<pre>".print_r($k,1)."</pre>";
|
499 |
}
|
500 |
|
501 |
-
|
502 |
-
$Request = Mage::app()->getRequest();
|
503 |
-
$Request->setParamSources(array('_POST'));
|
504 |
-
$data = array();
|
505 |
-
$data= $Request->getParams();
|
506 |
-
|
507 |
-
$this->log('Postdata :'.print_r($data,1));
|
508 |
-
|
509 |
-
}
|
510 |
-
*/
|
511 |
|
512 |
|
513 |
}
|
115 |
return $this;
|
116 |
}
|
117 |
|
118 |
+
//$this->log('No Mail '.Mage::app()->getRequest()->getParam('no_mail'));
|
119 |
+
$no_mail = (Mage::app()->getRequest()->getParam('no_mail') == 1) ? true : false;
|
120 |
+
|
121 |
+
|
122 |
$this->getCheckout()->getQuote()->setIsActive(false)->save();
|
123 |
$this->getCheckout()->clear();
|
124 |
|
142 |
$this->getCheckout()->setLastSuccessQuoteId($quoteID);
|
143 |
$this->log('LastQuteID :'. $quoteID );
|
144 |
|
145 |
+
if ($no_mail === false) {
|
146 |
+
Mage::helper('hcd/payment')->mapStatus (
|
147 |
+
$data,
|
148 |
+
$order
|
149 |
+
);
|
150 |
+
}
|
151 |
|
152 |
+
if($order->getId() and $no_mail === false) {
|
153 |
$order->sendNewOrderEmail();
|
154 |
+
//$this->log('sendOrderMail');
|
155 |
}
|
156 |
$order->save();
|
157 |
$this->_redirect('checkout/onepage/success', array('_secure' => true));
|
244 |
return $this;
|
245 |
}
|
246 |
$payment = $order->getPayment()->getMethodInstance();
|
247 |
+
|
248 |
+
// if order status is cancel redirect to cancel page
|
249 |
+
if ($order->getStatus() == $payment->getStatusError()) {
|
250 |
+
$this->_redirect('hcd/index/error', array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true));
|
251 |
+
return;
|
252 |
+
};
|
253 |
+
|
254 |
+
// if order status is success redirect to success page
|
255 |
+
if ($order->getStatus() == $payment->getStatusSuccess() or $order->getStatus() == $payment->getStatusPendig()) {
|
256 |
+
$this->_redirect('hcd/index/success', array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true,'no_mail' => true));
|
257 |
+
return;
|
258 |
+
}
|
259 |
+
|
260 |
+
|
261 |
+
|
262 |
$data = $payment->getHeidelpayUrl();
|
263 |
|
264 |
if($data['POST_VALIDATION'] == 'ACK' and $data['PROCESSING_RESULT'] == 'ACK' )
|
519 |
foreach($data AS $k) echo "<pre>".print_r($k,1)."</pre>";
|
520 |
}
|
521 |
|
522 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
|
524 |
|
525 |
}
|
app/code/community/HeidelpayCD/Edition/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<HeidelpayCD_Edition>
|
5 |
-
<version>15.
|
6 |
</HeidelpayCD_Edition>
|
7 |
</modules>
|
8 |
<global>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<HeidelpayCD_Edition>
|
5 |
+
<version>15.4.30</version>
|
6 |
</HeidelpayCD_Edition>
|
7 |
</modules>
|
8 |
<global>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>HeidelpayCDEdition</name>
|
4 |
-
<version>15.
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
@@ -39,11 +39,14 @@ Telefon: +49 (0) 6221 / 65 170-20<br />
|
|
39 |
E-Mail: sales@heidelpay.de<br />
|
40 |
Internet: www.heidelpay.de<br />
|
41 |
</description>
|
42 |
-
<notes>- fix
|
|
|
|
|
|
|
43 |
<authors><author><name>Heidelberger Payment GmbH</name><user>Heidelpay</user><email>magento@heidelpay.de</email></author></authors>
|
44 |
-
<date>2015-
|
45 |
-
<time>08:50:
|
46 |
-
<contents><target name="magecommunity"><dir name="HeidelpayCD"><dir name="Edition"><dir name="Block"><file name="Abstract.php" hash="e589f421bf86a643921b11d75fcbb8fb"/><dir name="Form"><file name="Creditcard.php" hash="eca2833e42df4e57485afb8aeb0d6a0f"/><file name="Debit.php" hash="fb2ecd8695d813e34e4ab6b6501d359e"/><file name="Desconly.php" hash="912dd8ab02ccc24b7121d6f05255c15d"/><file name="Eps.php" hash="8698a923d04580654cacecfff64268c8"/><file name="Giropay.php" hash="aba0b69429706944ae1ac4466ab9ce3b"/><file name="Ideal.php" hash="a31bd92c30af0718e6f4347f14eba963"/><file name="Postfinance.php" hash="b3a91389b3fb235eb113a919161d2476"/></dir><file name="Index.php" hash="e13d55a3c5aa1ed0ab680ae378131eee"/><dir name="Info"><file name="Debit.php" hash="888f8a1c1aaaf6974131970969caa5f2"/></dir><file name="Success.php" hash="97b586c0d2c5b16c53608b3e41f35b79"/></dir><dir name="Helper"><file name="Data.php" hash="5e5781fd10c60a1aaaf434e632959249"/><file name="Payment.php" hash="
|
47 |
<compatible/>
|
48 |
-
<dependencies><required><php><min>5.0.0</min><max>5.
|
49 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>HeidelpayCDEdition</name>
|
4 |
+
<version>15.4.30</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
39 |
E-Mail: sales@heidelpay.de<br />
|
40 |
Internet: www.heidelpay.de<br />
|
41 |
</description>
|
42 |
+
<notes>- fix PayPal proccessing status set on redirect to PayPal
|
43 |
+
- prevent double booking by redirecting user if he uses the browser back button
|
44 |
+
- submit billingadress instead of shipping to PayPal if the product is a digital good
|
45 |
+
- fix a bug with amount paid on automaticaly generated invoices</notes>
|
46 |
<authors><author><name>Heidelberger Payment GmbH</name><user>Heidelpay</user><email>magento@heidelpay.de</email></author></authors>
|
47 |
+
<date>2015-05-05</date>
|
48 |
+
<time>08:50:17</time>
|
49 |
+
<contents><target name="magecommunity"><dir name="HeidelpayCD"><dir name="Edition"><dir name="Block"><file name="Abstract.php" hash="e589f421bf86a643921b11d75fcbb8fb"/><dir name="Form"><file name="Creditcard.php" hash="eca2833e42df4e57485afb8aeb0d6a0f"/><file name="Debit.php" hash="fb2ecd8695d813e34e4ab6b6501d359e"/><file name="Desconly.php" hash="912dd8ab02ccc24b7121d6f05255c15d"/><file name="Eps.php" hash="8698a923d04580654cacecfff64268c8"/><file name="Giropay.php" hash="aba0b69429706944ae1ac4466ab9ce3b"/><file name="Ideal.php" hash="a31bd92c30af0718e6f4347f14eba963"/><file name="Postfinance.php" hash="b3a91389b3fb235eb113a919161d2476"/></dir><file name="Index.php" hash="e13d55a3c5aa1ed0ab680ae378131eee"/><dir name="Info"><file name="Debit.php" hash="888f8a1c1aaaf6974131970969caa5f2"/></dir><file name="Success.php" hash="97b586c0d2c5b16c53608b3e41f35b79"/></dir><dir name="Helper"><file name="Data.php" hash="5e5781fd10c60a1aaaf434e632959249"/><file name="Payment.php" hash="0b320a1260abf49626399e0c85f0941e"/></dir><dir name="Model"><file name="Customer.php" hash="4e65287a3d6a171444614ed580635147"/><dir name="Mysql4"><dir name="Customer"><file name="Collection.php" hash="9fa63b33278570af246ca8cb1cfc706e"/></dir><file name="Customer.php" hash="952d0c21f063e34b0c767968c85184d7"/><dir name="Transaction"><file name="Collection.php" hash="aade54e4bced143dc773a256f27418cd"/></dir><file name="Transaction.php" hash="d3c544e838b9b8f39efaad4caa5d83c2"/></dir><dir name="Order"><dir name="Pdf"><file name="Invoice.php" hash="f8222c1be3bfa9d20d52c33cfccf9a67"/></dir></dir><dir name="Payment"><file name="Abstract.php" hash="c6dde76e69cf4158296bccfa5469e1ca"/><file name="Hcdbs.php" hash="86c75495b59b74ef2e28aeec9f2c34fd"/><file name="Hcdcc.php" hash="3bcb26cf280966d2d5925834bf4f1034"/><file name="Hcddc.php" hash="ec9dffb5d0d70316b22dd26000abea55"/><file name="Hcddd.php" hash="1ba1f5818596dce9fbf80626008d83a8"/><file name="Hcdeps.php" hash="6caef61817c39c62176d0213ae309e56"/><file name="Hcdgp.php" hash="3fb1d66a07d70d744de2539758ab5197"/><file name="Hcdide.php" hash="260bbb90e918f884045a459ad346af30"/><file name="Hcdiv.php" hash="772d8ea2ee2f9b7cdf52a6de8c6393ef"/><file name="Hcdmk.php" hash="c5c618e46541ba6f23f338a2b6fbe6c5"/><file name="Hcdpal.php" hash="8d200fa178cad082ea84b1743036c484"/><file name="Hcdpf.php" hash="c06b78f4e07001b8e838b88037ee0e63"/><file name="Hcdpp.php" hash="0e769db526ca92c12f7e70837305a749"/><file name="Hcdsu.php" hash="41b884aff43ada409a9d16e7a0f29b97"/></dir><dir name="Resource"><file name="Encryption.php" hash="edbc116ce3c9dc815a658beb4ac7705a"/><file name="Setup.php" hash="74d6669d6d2273dd241a5064c85c1e78"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Bookingmode.php" hash="a83d2adbb54a69c0afd7ef87857672ee"/><file name="Recognition.php" hash="bec39a1786cca41140c590b86b864850"/><file name="Returnurl.php" hash="626518f91f8b0632211ac85fb658fdd7"/></dir></dir></dir><file name="Transaction.php" hash="7d3b2af934c03de7f7a9d9d1348e1c7e"/></dir><dir name="controllers"><file name="IndexController.php" hash="a6a8030a19ff0dbd490cb242ea74c3bf"/></dir><dir name="etc"><file name="config.xml" hash="bf1907585566c9706871f0666b8e713c"/><file name="system.xml" hash="7f543c7ca7d5a72b31d339ba5e0ffa30"/></dir><dir name="sql"><dir name="hcd_setup"><file name="install-15.1.30.php" hash="f7f87111e5401feb60b2aa3090c40740"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="hcd.xml" hash="4af5b464a17cba9b9eaa000262abeffa"/></dir><dir name="template"><dir name="hcd"><dir name="form"><file name="creditcard.phtml" hash="73fb91d12a559eebb68ee5c85f285778"/><file name="debit.phtml" hash="e89162ee1e5a8958f4537cffa4873714"/><file name="desconly.phtml" hash="0df2f305be1337de2db69ecb93ce48b7"/><file name="eps.phtml" hash="23895dad6e135ca58473a181bf2f7388"/><file name="giropay.phtml" hash="ebcb9379429b3d47263ee97243688f3c"/><file name="ideal.phtml" hash="23895dad6e135ca58473a181bf2f7388"/><file name="postfinance.phtml" hash="0db7c2d0404efa2feb98748204bf72d4"/></dir><file name="index.phtml" hash="03a0dccd4448c6a3d9745a2cea7fa327"/><file name="success.phtml" hash="9cac258cb96b057b3de00ab971bf7855"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="HeidelpayCD_Edition.xml" hash="277ef825780ed2df1f5de2cf949f842b"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="HeidelpayCD_Edition.csv" hash="3695c12acf56ae8756bfbd08b7ea19b5"/></dir><dir name="en_US"><file name="HeidelpayCD_Edition.csv" hash="452d18db5863362715563c6d782c0ae3"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="hcd"><file name="loading.gif" hash="29868a3a7094b078733caba6b192b080"/></dir></dir><dir name="css"><file name="heidelpaycd.css" hash="fb5022c109928b0f28fd660012dcce76"/></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="hcd"><file name="heidelpaycd.js" hash="1d37a437235520a71cd20847d569411c"/></dir></dir></target></contents>
|
50 |
<compatible/>
|
51 |
+
<dependencies><required><php><min>5.0.0</min><max>5.6.99</max></php></required></dependencies>
|
52 |
</package>
|