Version Notes
- Rewrite 3-D Secure credit card payment method
- Add new bank in BankTransfer payment method: Bank BGŻ BNP PARIBAS (BGŻ) , Bank BGŻ BNP PARIBAS (BNP)
Download this release
Release Info
Developer | ENDORA |
Extension | Endora_PayLane2 |
Version | 0.1.7 |
Comparing to | |
See all releases |
Code changes from version 0.1.6 to 0.1.7
app/code/community/Endora/PayLane/Helper/Data.php
CHANGED
@@ -25,6 +25,7 @@ class Endora_PayLane_Helper_Data extends Mage_Core_Helper_Data {
|
|
25 |
const XML_CONFIG_NOTIFICATIONS_USERNAME = 'payment/paylane_notifications/username';
|
26 |
const XML_CONFIG_NOTIFICATIONS_PASSWORD = 'payment/paylane_notifications/password';
|
27 |
const XML_CONFIG_MODULE_ACTIVE = 'payment/paylane/active';
|
|
|
28 |
|
29 |
const GATEWAY_TYPE_SECURE_FORM = 'secureForm';
|
30 |
const GATEWAY_TYPE_API = 'API';
|
@@ -57,6 +58,11 @@ class Endora_PayLane_Helper_Data extends Mage_Core_Helper_Data {
|
|
57 |
return Mage::getStoreConfig(self::XML_CONFIG_FRAUD_CHECK);
|
58 |
}
|
59 |
|
|
|
|
|
|
|
|
|
|
|
60 |
public function getRedirectVersion()
|
61 |
{
|
62 |
return Mage::getStoreConfig(self::XML_CONFIG_REDIRECT_VERSION);
|
@@ -162,10 +168,6 @@ class Endora_PayLane_Helper_Data extends Mage_Core_Helper_Data {
|
|
162 |
'label' => 'T-Mobile Usługi Bankowe',
|
163 |
'img' => null
|
164 |
),
|
165 |
-
'MU' => array(
|
166 |
-
'label' => 'Multibank',
|
167 |
-
'img' => null
|
168 |
-
),
|
169 |
'MT' => array(
|
170 |
'label' => 'mTransfer',
|
171 |
'img' => null
|
@@ -218,6 +220,14 @@ class Endora_PayLane_Helper_Data extends Mage_Core_Helper_Data {
|
|
218 |
'label' => 'Bank Zachodni WBK',
|
219 |
'img' => null
|
220 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
'OH' => array(
|
222 |
'label' => 'Other',
|
223 |
'img' => null
|
25 |
const XML_CONFIG_NOTIFICATIONS_USERNAME = 'payment/paylane_notifications/username';
|
26 |
const XML_CONFIG_NOTIFICATIONS_PASSWORD = 'payment/paylane_notifications/password';
|
27 |
const XML_CONFIG_MODULE_ACTIVE = 'payment/paylane/active';
|
28 |
+
const XML_CONFIG_3DS_CHECK = 'payment/paylane_creditcard/ds3_check';
|
29 |
|
30 |
const GATEWAY_TYPE_SECURE_FORM = 'secureForm';
|
31 |
const GATEWAY_TYPE_API = 'API';
|
58 |
return Mage::getStoreConfig(self::XML_CONFIG_FRAUD_CHECK);
|
59 |
}
|
60 |
|
61 |
+
public function is3dsActive()
|
62 |
+
{
|
63 |
+
return Mage::getStoreConfig(self::XML_CONFIG_3DS_CHECK);
|
64 |
+
}
|
65 |
+
|
66 |
public function getRedirectVersion()
|
67 |
{
|
68 |
return Mage::getStoreConfig(self::XML_CONFIG_REDIRECT_VERSION);
|
168 |
'label' => 'T-Mobile Usługi Bankowe',
|
169 |
'img' => null
|
170 |
),
|
|
|
|
|
|
|
|
|
171 |
'MT' => array(
|
172 |
'label' => 'mTransfer',
|
173 |
'img' => null
|
220 |
'label' => 'Bank Zachodni WBK',
|
221 |
'img' => null
|
222 |
),
|
223 |
+
'BG' => array(
|
224 |
+
'label' => 'Bank BGŻ BNP PARIBAS (BGŻ)',
|
225 |
+
'img' => null
|
226 |
+
),
|
227 |
+
'PB' => array(
|
228 |
+
'label' => 'Bank BGŻ BNP PARIBAS (BNP)',
|
229 |
+
'img' => null
|
230 |
+
),
|
231 |
'OH' => array(
|
232 |
'label' => 'Other',
|
233 |
'img' => null
|
app/code/community/Endora/PayLane/Model/Api/Payment/CreditCard.php
CHANGED
@@ -5,6 +5,7 @@
|
|
5 |
* @author Michał Zabielski <michal.zabielski@endora.pl> http://www.endora.pl
|
6 |
*/
|
7 |
class Endora_PayLane_Model_Api_Payment_CreditCard extends Endora_PayLane_Model_Api_Payment_Type_Abstract {
|
|
|
8 |
|
9 |
protected $_paymentTypeCode = 'creditCard';
|
10 |
protected $_isRecurringPayment = true;
|
@@ -28,18 +29,45 @@ class Endora_PayLane_Model_Api_Payment_CreditCard extends Endora_PayLane_Model_A
|
|
28 |
$data['customer'] = $this->_prepareCustomerData($order);
|
29 |
$data['card'] = $paymentParams;
|
30 |
|
31 |
-
|
32 |
$helper->log('send data for credit cart payment channel:');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
$helper->log($data);
|
34 |
-
$result = $client->cardSale($data);
|
35 |
$helper->log('Received response from PayLane:');
|
36 |
$helper->log($result);
|
37 |
}
|
38 |
|
39 |
if(!empty($result['success']) && $result['success']) {
|
40 |
-
$
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
} else {
|
44 |
$orderStatus = $helper->getErrorOrderStatus();
|
45 |
$errorCode = '';
|
5 |
* @author Michał Zabielski <michal.zabielski@endora.pl> http://www.endora.pl
|
6 |
*/
|
7 |
class Endora_PayLane_Model_Api_Payment_CreditCard extends Endora_PayLane_Model_Api_Payment_Type_Abstract {
|
8 |
+
const RETURN_URL_PATH = 'paylane/payment/externalUrlResponse';
|
9 |
|
10 |
protected $_paymentTypeCode = 'creditCard';
|
11 |
protected $_isRecurringPayment = true;
|
29 |
$data['customer'] = $this->_prepareCustomerData($order);
|
30 |
$data['card'] = $paymentParams;
|
31 |
|
|
|
32 |
$helper->log('send data for credit cart payment channel:');
|
33 |
+
|
34 |
+
if($helper->is3dsActive()) {
|
35 |
+
$data['back_url'] = Mage::getUrl(self::RETURN_URL_PATH, array('_secure' => true));
|
36 |
+
$result = $client->checkCard3DSecure($data);
|
37 |
+
} else {
|
38 |
+
$result = $client->cardSale($data);
|
39 |
+
}
|
40 |
+
|
41 |
$helper->log($data);
|
|
|
42 |
$helper->log('Received response from PayLane:');
|
43 |
$helper->log($result);
|
44 |
}
|
45 |
|
46 |
if(!empty($result['success']) && $result['success']) {
|
47 |
+
if(!empty($result['is_card_enrolled']) && $result['is_card_enrolled']) {
|
48 |
+
header('Location: ' . $result['redirect_url']);
|
49 |
+
die;
|
50 |
+
} else if(!empty($result['is_card_enrolled']) && $result['is_card_enrolled'] == false) {
|
51 |
+
$ds3Status = $client->saleBy3DSecureAuthorization(array ('id_3dsecure_auth' => $result['id_3dsecure_auth']));
|
52 |
+
if(!empty($ds3Status['success']) && $ds3Status['success']) {
|
53 |
+
$orderStatus = $helper->getPerformedOrderStatus();
|
54 |
+
$comment = $helper->__('Payment handled via PayLane module | Transaction ID: %s', $ds3Status['id_sale']);
|
55 |
+
$order->setPaylaneSaleId($ds3Status['id_sale']);
|
56 |
+
} else {
|
57 |
+
$orderStatus = $helper->getErrorOrderStatus();
|
58 |
+
$errorCode = '';
|
59 |
+
$errorText = '';
|
60 |
+
if(!empty($ds3Status['error'])) {
|
61 |
+
$errorCode = (!empty($ds3Status['error']['error_number'])) ? $ds3Status['error']['error_number'] : '';
|
62 |
+
$errorText = (!empty($ds3Status['error']['error_description'])) ? $ds3Status['error']['error_description'] : '';
|
63 |
+
}
|
64 |
+
$comment = $helper->__('There was an error in payment process via PayLane module (Error code: %s, Error text: %s)', $errorCode, $errorText);
|
65 |
+
}
|
66 |
+
} else { //normal transaction, without 3DS
|
67 |
+
$orderStatus = $helper->getPerformedOrderStatus();
|
68 |
+
$comment = $helper->__('Payment handled via PayLane module | Transaction ID: %s', $result['id_sale']);
|
69 |
+
$order->setPaylaneSaleId($result['id_sale']);
|
70 |
+
}
|
71 |
} else {
|
72 |
$orderStatus = $helper->getErrorOrderStatus();
|
73 |
$errorCode = '';
|
app/code/community/Endora/PayLane/Model/Payment.php
CHANGED
@@ -92,7 +92,9 @@ class Endora_PayLane_Model_Payment extends Mage_Payment_Model_Method_Abstract
|
|
92 |
{
|
93 |
$id = null;
|
94 |
|
95 |
-
if(!empty($params['
|
|
|
|
|
96 |
$id = $params['id_sale'];
|
97 |
} else if (!empty($params['id_authorization'])) {
|
98 |
$id = $params['id_authorization'];
|
92 |
{
|
93 |
$id = null;
|
94 |
|
95 |
+
if(!empty($params['id_3dsecure_auth'])) {
|
96 |
+
$id = $params['id_3dsecure_auth'];
|
97 |
+
} else if(!empty($params['id_sale'])) {
|
98 |
$id = $params['id_sale'];
|
99 |
} else if (!empty($params['id_authorization'])) {
|
100 |
$id = $params['id_authorization'];
|
app/code/community/Endora/PayLane/controllers/PaymentController.php
CHANGED
@@ -127,14 +127,18 @@ class Endora_PayLane_PaymentController extends Mage_Core_Controller_Front_Action
|
|
127 |
$success = false;
|
128 |
$paymentType = $order->getPayment()->getAdditionalInformation('paylane_payment_type');
|
129 |
|
130 |
-
$id = '';
|
131 |
-
if($result['status'] != Endora_PayLane_Model_Payment::PAYMENT_STATUS_ERROR) {
|
132 |
-
$id = $result['id_sale'];
|
133 |
-
}
|
134 |
-
|
135 |
-
// var_dump($result, $paymentType); die;
|
136 |
-
|
137 |
if($payment->verifyResponseHash($result, $paymentType)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
switch($result['status']) {
|
139 |
case Endora_PayLane_Model_Payment::PAYMENT_STATUS_CLEARED :
|
140 |
$orderStatus = $helper->getClearedOrderStatus();
|
127 |
$success = false;
|
128 |
$paymentType = $order->getPayment()->getAdditionalInformation('paylane_payment_type');
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
if($payment->verifyResponseHash($result, $paymentType)) {
|
131 |
+
if(($result['status'] != Endora_PayLane_Model_Payment::PAYMENT_STATUS_ERROR) && $result['id_3dsecure_auth']) { //only for 3DS
|
132 |
+
$cardModel = Mage::getModel('paylane/api_payment_creditCard');
|
133 |
+
$ds3Status = $cardModel->getClient()->saleBy3DSecureAuthorization(array ('id_3dsecure_auth' => $result['id_3dsecure_auth']));
|
134 |
+
if(!empty($ds3Status['success']) && $ds3Status['success']) {
|
135 |
+
$result['status'] = Endora_PayLane_Model_Payment::PAYMENT_STATUS_CLEARED;
|
136 |
+
$result['id_sale'] = $ds3Status['id_sale'];
|
137 |
+
} else {
|
138 |
+
Endora_PayLane_Model_Payment::PAYMENT_STATUS_ERROR;
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
switch($result['status']) {
|
143 |
case Endora_PayLane_Model_Payment::PAYMENT_STATUS_CLEARED :
|
144 |
$orderStatus = $helper->getClearedOrderStatus();
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Endora_PayLane2</name>
|
4 |
-
<version>0.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/MIT">Massachusetts Institute of Technology License (MITL)</license>
|
7 |
<channel>community</channel>
|
@@ -10,13 +10,12 @@
|
|
10 |
<description>The extension adds a new payment method to your shop which gives your customers the possibility to use PayLane system to pay for their orders.
|
11 |
It allows to use recurring payments, credit card authorization, single-click payments and much more.
|
12 |
If you are interested in technical support, e-mail us at it@paylane.com or magento@endora.pl.</description>
|
13 |
-
<notes>-
|
14 |
-
-
|
15 |
-
- Fix for DirectDebit payment form template in checkout</notes>
|
16 |
<authors><author><name>ENDORA</name><user>EndoraPL</user><email>magento@endora.pl</email></author><author><name>PayLane</name><user>PayLane</user><email>it@paylane.com</email></author></authors>
|
17 |
-
<date>2016-03-
|
18 |
-
<time>
|
19 |
-
<contents><target name="magecommunity"><dir name="Endora"><dir name="PayLane"><dir name="Block"><dir name="Adminhtml"><dir name="Notification"><file name="Url.php" hash="b491c97ac7ca8060126955b8bfde3223"/></dir></dir><dir name="Customer"><file name="Account.php" hash="08f9172d3c0a67efa0224ab88e4a8a08"/></dir><file name="Form.php" hash="ad381bbdd276c17ee951f6279f164536"/><file name="Info.php" hash="09e95490e5e3ac986c3310dbe48836ba"/><dir name="Payment"><file name="BankTransfer.php" hash="14a260bf8d26801feafedcf58d100d0d"/><file name="CreditCard.php" hash="cab7f3675d88aaa94c3646b561eddd7d"/><file name="DirectDebit.php" hash="611713ee6e3b881cbe51155c0672c354"/><file name="Ideal.php" hash="b79f7a64a62814f9aa2cf58faa354e0d"/><file name="PayPal.php" hash="ba9d7453188615938cec8fbc721c4729"/><file name="SecureForm.php" hash="2fd7f102fd074b6310d48becd6200161"/><file name="Sofort.php" hash="aaf6ce265b89185d56eb8742834a0771"/></dir><file name="Redirect.php" hash="7704b9996a4ce1526870d43c3b3cb045"/></dir><dir name="Helper"><file name="Data.php" hash="
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>5.0.0</min><max>5.6.8</max></php></required></dependencies>
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Endora_PayLane2</name>
|
4 |
+
<version>0.1.7</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/MIT">Massachusetts Institute of Technology License (MITL)</license>
|
7 |
<channel>community</channel>
|
10 |
<description>The extension adds a new payment method to your shop which gives your customers the possibility to use PayLane system to pay for their orders.
|
11 |
It allows to use recurring payments, credit card authorization, single-click payments and much more.
|
12 |
If you are interested in technical support, e-mail us at it@paylane.com or magento@endora.pl.</description>
|
13 |
+
<notes>- Rewrite 3-D Secure credit card payment method
|
14 |
+
- Add new bank in BankTransfer payment method: Bank BGŻ BNP PARIBAS (BGŻ) , Bank BGŻ BNP PARIBAS (BNP)</notes>
|
|
|
15 |
<authors><author><name>ENDORA</name><user>EndoraPL</user><email>magento@endora.pl</email></author><author><name>PayLane</name><user>PayLane</user><email>it@paylane.com</email></author></authors>
|
16 |
+
<date>2016-03-11</date>
|
17 |
+
<time>12:27:02</time>
|
18 |
+
<contents><target name="magecommunity"><dir name="Endora"><dir name="PayLane"><dir name="Block"><dir name="Adminhtml"><dir name="Notification"><file name="Url.php" hash="b491c97ac7ca8060126955b8bfde3223"/></dir></dir><dir name="Customer"><file name="Account.php" hash="08f9172d3c0a67efa0224ab88e4a8a08"/></dir><file name="Form.php" hash="ad381bbdd276c17ee951f6279f164536"/><file name="Info.php" hash="09e95490e5e3ac986c3310dbe48836ba"/><dir name="Payment"><file name="BankTransfer.php" hash="14a260bf8d26801feafedcf58d100d0d"/><file name="CreditCard.php" hash="cab7f3675d88aaa94c3646b561eddd7d"/><file name="DirectDebit.php" hash="611713ee6e3b881cbe51155c0672c354"/><file name="Ideal.php" hash="b79f7a64a62814f9aa2cf58faa354e0d"/><file name="PayPal.php" hash="ba9d7453188615938cec8fbc721c4729"/><file name="SecureForm.php" hash="2fd7f102fd074b6310d48becd6200161"/><file name="Sofort.php" hash="aaf6ce265b89185d56eb8742834a0771"/></dir><file name="Redirect.php" hash="7704b9996a4ce1526870d43c3b3cb045"/></dir><dir name="Helper"><file name="Data.php" hash="3339d8b514b041b614400da2bee734d4"/><file name="Notification.php" hash="c251b24d81ccce3701f7241a9fe5b4b5"/></dir><dir name="Model"><dir name="Api"><file name="Client.php" hash="4a740e7950563688add55d2238573c64"/><file name="Notification.php" hash="de4044b032810219bc56cb93fc89c4a0"/><dir name="Payment"><file name="BankTransfer.php" hash="976c65476315f7e31e73634c01a64adf"/><file name="CreditCard.php" hash="847f4fce92cfcc585a28cd23dbe08e19"/><file name="DirectDebit.php" hash="763847541e9f08945de90246c37cd976"/><file name="Ideal.php" hash="2bd4b7e796c9432f8e44c40ddc46e81b"/><file name="PayPal.php" hash="5448c2a96625ca1646c220c7f4675060"/><file name="SecureForm.php" hash="d80be5d5fa1240427a1b6a73492a5640"/><file name="Sofort.php" hash="2b80feb8b650b5c289aa9f02116e9b1b"/><dir name="Type"><file name="Abstract.php" hash="da38cad3a485bb714a547f949d313e90"/></dir></dir><file name="Refund.php" hash="c9535f2cf997dabbf3b5a828614530d8"/><file name="Resale.php" hash="59017bfede23168a8d1d0ffbe7f03fd0"/></dir><dir name="Interface"><file name="PaymentTypeExtendedInfo.php" hash="f005bc12af5050eda938a2f5a80236ad"/></dir><file name="Observer.php" hash="bc9ec126f99c13ff628daea0802a4d7b"/><file name="Payment.php" hash="58aa3cf4a898c9d37e8d877549bd9435"/><dir name="Resource"><file name="Setup.php" hash="049179fc44a6d12349ebfbc7118851d4"/></dir><dir name="Source"><dir name="Avs"><dir name="Check"><file name="Level.php" hash="f76217494c46a5818035f88f050031e0"/></dir></dir><dir name="Gateway"><file name="Type.php" hash="ca8618440dfdccd1d80902ab537deb64"/></dir><dir name="Notification"><file name="Mode.php" hash="4a908cfc0dddb86c4fa48c0624e5390e"/></dir><dir name="Order"><file name="Status.php" hash="156ceac3ff5f2bd36aae1d774da6dcbc"/></dir><dir name="Redirect"><file name="Version.php" hash="fc24a211a510b8103c5be2f9d08e7417"/></dir></dir></dir><dir name="controllers"><file name="CustomerController.php" hash="b41789b114e929a5d52a437d61388a00"/><file name="NotificationController.php" hash="efaf9b1f17066bcea2bfa19532d78f70"/><file name="PaymentController.php" hash="1227938dee385cba3f2f34e9b7b63416"/></dir><dir name="etc"><file name="config.xml" hash="ceac7f1b5b696083253534db97067bee"/><file name="system.xml" hash="d319164fbabb549f92b232d026e3b703"/></dir><dir name="sql"><dir name="paylane_setup"><file name="install-0.1.0.php" hash="a23c9f7d3284978bd0669ae444aedc3b"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Endora_PayLane.xml" hash="21f68dbfe96b2045ab9b5e1a6c2e52f7"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="template"><dir name="paylane"><file name="form.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="info.phtml" hash="75e1c24c1080f58b9fc5d0aa9f4db5e1"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="paylane"><dir name="customer"><file name="account.phtml" hash="a2ebf416251f24bdefd43bc20ab9acdc"/></dir><file name="empty.phtml" hash="45d25a0ef85fa6de271e61a9d76db4c5"/><file name="form.phtml" hash="49b335c46bc4f1c6da8b130f98d0eeb5"/><file name="info.phtml" hash="00b405c4f6f8e23e086e1ba2100059b1"/><dir name="payment"><file name="banktransfer.phtml" hash="b88d8071e7ba7746d5f02d34c5e4b6d0"/><dir name="creditcard"><file name="form.phtml" hash="2857b3d8d988b4a24703a292bf966b83"/></dir><file name="creditcard.phtml" hash="31c173a6b2f09fe1292a7ff6bd53b8c9"/><file name="directdebit.phtml" hash="ddf034eb42c6fe578cb1019b67b75763"/><file name="ideal.phtml" hash="d6490f996be59e5b2d433b8068dbc56d"/><file name="paypal.phtml" hash="18aff72598fc73b80b223cccb0a1d713"/><file name="secureform.phtml" hash="8cfd06e9b48f16bdbe9037c364a3e5d8"/><file name="sofort.phtml" hash="a0c661e5d92b01602188dec75927c829"/></dir><file name="redirect.phtml" hash="6401d2675548c81e913a82933f62266a"/></dir></dir><dir name="layout"><file name="paylane.xml" hash="9028dc5831a39ee0d25012591d0c0800"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="paylane"><file name="style.css" hash="586293871591cf1bb458c855b4a3b457"/></dir></dir></dir></dir></target><target name="magelib"><dir name="paylane"><dir name="client"><dir name="paylane"><file name="PayLaneRestClient.php" hash="b63633cb8349c53db85af6d12dc60533"/></dir></dir></dir></target><target name="magelocale"><dir><dir name="pl_PL"><file name="Endora_PayLane.csv" hash="7f5e327957f73cfa8577a77051453724"/></dir></dir></target></contents>
|
19 |
<compatible/>
|
20 |
<dependencies><required><php><min>5.0.0</min><max>5.6.8</max></php></required></dependencies>
|
21 |
</package>
|