Version Notes
* Fixed double token requests on Magento 1.7
Download this release
Release Info
Developer | Paymentwall |
Extension | paymentwall_magento_module |
Version | 1.1.6 |
Comparing to | |
See all releases |
Code changes from version 1.1.5 to 1.1.6
- app/code/community/Paymentwall/Paymentwall/Model/Method/Abstract.php +22 -0
- app/code/community/Paymentwall/Paymentwall/Model/Method/Pwbrick.php +8 -14
- app/code/community/Paymentwall/Paymentwall/Model/Method/Pwlocal.php +0 -22
- app/code/community/Paymentwall/Paymentwall/Model/Pingback.php +76 -26
- package.xml +5 -5
- skin/frontend/base/default/js/paymentwall.js +8 -0
app/code/community/Paymentwall/Paymentwall/Model/Method/Abstract.php
CHANGED
@@ -156,6 +156,28 @@ class Paymentwall_Paymentwall_Model_Method_Abstract extends Mage_Payment_Model_M
|
|
156 |
);
|
157 |
}
|
158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
/**
|
160 |
* Log Function
|
161 |
* @param $message
|
156 |
);
|
157 |
}
|
158 |
|
159 |
+
/**
|
160 |
+
* Make invoice for paid order
|
161 |
+
* @return void
|
162 |
+
*/
|
163 |
+
protected function makeInvoice()
|
164 |
+
{
|
165 |
+
$order = $this->getCurrentOrder();
|
166 |
+
if ($order) {
|
167 |
+
$invoice = $order->prepareInvoice()
|
168 |
+
->setTransactionId($order->getId())
|
169 |
+
->addComment("Invoice created by Paymentwall")
|
170 |
+
->register()
|
171 |
+
->pay();
|
172 |
+
|
173 |
+
$transactionSave = Mage::getModel('core/resource_transaction')
|
174 |
+
->addObject($invoice)
|
175 |
+
->addObject($invoice->getOrder());
|
176 |
+
$transactionSave->save();
|
177 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true)->save();
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
/**
|
182 |
* Log Function
|
183 |
* @param $message
|
app/code/community/Paymentwall/Paymentwall/Model/Method/Pwbrick.php
CHANGED
@@ -6,8 +6,8 @@
|
|
6 |
*
|
7 |
* Class Paymentwall_Paymentwall_Model_Method_Pwbrick
|
8 |
*/
|
9 |
-
class Paymentwall_Paymentwall_Model_Method_Pwbrick extends Paymentwall_Paymentwall_Model_Method_Abstract
|
10 |
-
|
11 |
protected $_isInitializeNeeded = false;
|
12 |
protected $_canUseInternal = false;
|
13 |
protected $_canUseForMultishipping = false;
|
@@ -18,8 +18,7 @@ class Paymentwall_Paymentwall_Model_Method_Pwbrick extends Paymentwall_Paymentwa
|
|
18 |
* Constructor method.
|
19 |
* Set some internal properties
|
20 |
*/
|
21 |
-
public function __construct()
|
22 |
-
{
|
23 |
parent::__construct('pwbrick');
|
24 |
}
|
25 |
|
@@ -28,8 +27,7 @@ class Paymentwall_Paymentwall_Model_Method_Pwbrick extends Paymentwall_Paymentwa
|
|
28 |
* @param $payment
|
29 |
* @return $this
|
30 |
*/
|
31 |
-
public function prepareCardInfo($payment)
|
32 |
-
{
|
33 |
$order = $payment->getOrder();
|
34 |
$info = $this->getInfoInstance();
|
35 |
$this->setCurrentOrder($order);
|
@@ -40,6 +38,7 @@ class Paymentwall_Paymentwall_Model_Method_Pwbrick extends Paymentwall_Paymentwa
|
|
40 |
'token' => $info->getAdditionalInformation('brick_token'),
|
41 |
'fingerprint' => $info->getAdditionalInformation('brick_fingerprint'),
|
42 |
'description' => 'Order #' . $order->getIncrementId(),
|
|
|
43 |
);
|
44 |
}
|
45 |
|
@@ -47,16 +46,13 @@ class Paymentwall_Paymentwall_Model_Method_Pwbrick extends Paymentwall_Paymentwa
|
|
47 |
* @param $data
|
48 |
* @return mixed
|
49 |
*/
|
50 |
-
public function assignData($data)
|
51 |
-
{
|
52 |
if (!($data instanceof Varien_Object)) {
|
53 |
$data = new Varien_Object($data);
|
54 |
}
|
55 |
-
|
56 |
$info = $this->getInfoInstance();
|
57 |
$info->setAdditionalInformation('brick_token', $data->getBrickToken())
|
58 |
->setAdditionalInformation('brick_fingerprint', $data->getBrickFingerprint());
|
59 |
-
|
60 |
return $this;
|
61 |
}
|
62 |
|
@@ -66,8 +62,7 @@ class Paymentwall_Paymentwall_Model_Method_Pwbrick extends Paymentwall_Paymentwa
|
|
66 |
* @return Mage_Payment_Model_Abstract|void
|
67 |
* @throws Mage_Core_Exception
|
68 |
*/
|
69 |
-
public function capture(Varien_Object $payment, $amount)
|
70 |
-
{
|
71 |
$this->initPaymentwallConfig();
|
72 |
$charge = new Paymentwall_Charge();
|
73 |
$charge->create(array_merge(
|
@@ -78,7 +73,6 @@ class Paymentwall_Paymentwall_Model_Method_Pwbrick extends Paymentwall_Paymentwa
|
|
78 |
|
79 |
// Debug
|
80 |
$this->log($response, 'Charge response');
|
81 |
-
|
82 |
if ($charge->isSuccessful()) {
|
83 |
if ($charge->isCaptured()) {
|
84 |
// deliver a product
|
@@ -95,4 +89,4 @@ class Paymentwall_Paymentwall_Model_Method_Pwbrick extends Paymentwall_Paymentwa
|
|
95 |
Mage::throwException($strErrors);
|
96 |
}
|
97 |
}
|
98 |
-
}
|
6 |
*
|
7 |
* Class Paymentwall_Paymentwall_Model_Method_Pwbrick
|
8 |
*/
|
9 |
+
class Paymentwall_Paymentwall_Model_Method_Pwbrick extends Paymentwall_Paymentwall_Model_Method_Abstract {
|
10 |
+
|
11 |
protected $_isInitializeNeeded = false;
|
12 |
protected $_canUseInternal = false;
|
13 |
protected $_canUseForMultishipping = false;
|
18 |
* Constructor method.
|
19 |
* Set some internal properties
|
20 |
*/
|
21 |
+
public function __construct() {
|
|
|
22 |
parent::__construct('pwbrick');
|
23 |
}
|
24 |
|
27 |
* @param $payment
|
28 |
* @return $this
|
29 |
*/
|
30 |
+
public function prepareCardInfo($payment) {
|
|
|
31 |
$order = $payment->getOrder();
|
32 |
$info = $this->getInfoInstance();
|
33 |
$this->setCurrentOrder($order);
|
38 |
'token' => $info->getAdditionalInformation('brick_token'),
|
39 |
'fingerprint' => $info->getAdditionalInformation('brick_fingerprint'),
|
40 |
'description' => 'Order #' . $order->getIncrementId(),
|
41 |
+
'plan' => $order->getIncrementId(),
|
42 |
);
|
43 |
}
|
44 |
|
46 |
* @param $data
|
47 |
* @return mixed
|
48 |
*/
|
49 |
+
public function assignData($data) {
|
|
|
50 |
if (!($data instanceof Varien_Object)) {
|
51 |
$data = new Varien_Object($data);
|
52 |
}
|
|
|
53 |
$info = $this->getInfoInstance();
|
54 |
$info->setAdditionalInformation('brick_token', $data->getBrickToken())
|
55 |
->setAdditionalInformation('brick_fingerprint', $data->getBrickFingerprint());
|
|
|
56 |
return $this;
|
57 |
}
|
58 |
|
62 |
* @return Mage_Payment_Model_Abstract|void
|
63 |
* @throws Mage_Core_Exception
|
64 |
*/
|
65 |
+
public function capture(Varien_Object $payment, $amount) {
|
|
|
66 |
$this->initPaymentwallConfig();
|
67 |
$charge = new Paymentwall_Charge();
|
68 |
$charge->create(array_merge(
|
73 |
|
74 |
// Debug
|
75 |
$this->log($response, 'Charge response');
|
|
|
76 |
if ($charge->isSuccessful()) {
|
77 |
if ($charge->isCaptured()) {
|
78 |
// deliver a product
|
89 |
Mage::throwException($strErrors);
|
90 |
}
|
91 |
}
|
92 |
+
}
|
app/code/community/Paymentwall/Paymentwall/Model/Method/Pwlocal.php
CHANGED
@@ -24,28 +24,6 @@ class Paymentwall_Paymentwall_Model_Method_Pwlocal extends Paymentwall_Paymentwa
|
|
24 |
return Mage::getUrl('paymentwall/payment/pwlocal', array('_secure' => true));
|
25 |
}
|
26 |
|
27 |
-
/**
|
28 |
-
* Make invoice for paid order
|
29 |
-
* @return void
|
30 |
-
*/
|
31 |
-
protected function makeInvoice()
|
32 |
-
{
|
33 |
-
$order = $this->getCurrentOrder();
|
34 |
-
if ($order) {
|
35 |
-
$invoice = $order->prepareInvoice()
|
36 |
-
->setTransactionId($order->getId())
|
37 |
-
->addComment("Invoice created by Paymentwall Brick")
|
38 |
-
->register()
|
39 |
-
->pay();
|
40 |
-
|
41 |
-
$transactionSave = Mage::getModel('core/resource_transaction')
|
42 |
-
->addObject($invoice)
|
43 |
-
->addObject($invoice->getOrder());
|
44 |
-
$transactionSave->save();
|
45 |
-
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true)->save();
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
/**
|
50 |
* Generate Paymentwall Widget
|
51 |
* @param $order
|
24 |
return Mage::getUrl('paymentwall/payment/pwlocal', array('_secure' => true));
|
25 |
}
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
/**
|
28 |
* Generate Paymentwall Widget
|
29 |
* @param $order
|
app/code/community/Paymentwall/Paymentwall/Model/Pingback.php
CHANGED
@@ -7,45 +7,25 @@ if (!class_exists('Paymentwall_Config'))
|
|
7 |
* @author Paymentwall Inc <devsupport@paymentwall.com>
|
8 |
* @package Paymentwall\ThirdpartyIntegration\Magento
|
9 |
*/
|
10 |
-
class Paymentwall_Paymentwall_Model_Pingback extends Mage_Core_Model_Abstract
|
11 |
-
{
|
12 |
const DEFAULT_PINGBACK_RESPONSE = 'OK';
|
13 |
|
14 |
/**
|
15 |
* Handle pingback
|
16 |
* @return string
|
17 |
*/
|
18 |
-
public function handlePingback()
|
19 |
-
{
|
20 |
// Load paymentwall configs
|
21 |
Mage::getModel('paymentwall/method_pwlocal')->initPaymentwallConfig();
|
22 |
|
23 |
$pingback = new Paymentwall_Pingback($_GET, $_SERVER['REMOTE_ADDR']);
|
24 |
|
25 |
if ($pingback->validate()) {
|
26 |
-
|
27 |
-
if ($
|
28 |
-
|
29 |
-
if ($pingback->isDeliverable()) {
|
30 |
-
|
31 |
-
$paymentModel = $order->getPayment()->getMethodInstance();
|
32 |
-
$paymentModel->setCurrentOrder($order)
|
33 |
-
->processPendingPayment($pingback);
|
34 |
-
|
35 |
-
return self::DEFAULT_PINGBACK_RESPONSE;
|
36 |
-
} elseif ($pingback->isCancelable()) {
|
37 |
-
$order->registerCancellation(Mage::helper('sales')->__('Order marked as cancelled by Paymentwall.'))
|
38 |
-
->save();
|
39 |
-
return Mage::helper('sales')->__('Order marked as cancelled by Paymentwall.');
|
40 |
-
}
|
41 |
-
} catch (Exception $e) {
|
42 |
-
Mage::log($e->getMessage());
|
43 |
-
$result = 'Internal server error';
|
44 |
-
$result .= ' ' . $e->getMessage();
|
45 |
-
return $result;
|
46 |
-
}
|
47 |
} else {
|
48 |
-
return
|
49 |
}
|
50 |
} else {
|
51 |
return $pingback->getErrorSummary();
|
@@ -54,5 +34,75 @@ class Paymentwall_Paymentwall_Model_Pingback extends Mage_Core_Model_Abstract
|
|
54 |
return '';
|
55 |
}
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
}
|
7 |
* @author Paymentwall Inc <devsupport@paymentwall.com>
|
8 |
* @package Paymentwall\ThirdpartyIntegration\Magento
|
9 |
*/
|
10 |
+
class Paymentwall_Paymentwall_Model_Pingback extends Mage_Core_Model_Abstract {
|
|
|
11 |
const DEFAULT_PINGBACK_RESPONSE = 'OK';
|
12 |
|
13 |
/**
|
14 |
* Handle pingback
|
15 |
* @return string
|
16 |
*/
|
17 |
+
public function handlePingback() {
|
|
|
18 |
// Load paymentwall configs
|
19 |
Mage::getModel('paymentwall/method_pwlocal')->initPaymentwallConfig();
|
20 |
|
21 |
$pingback = new Paymentwall_Pingback($_GET, $_SERVER['REMOTE_ADDR']);
|
22 |
|
23 |
if ($pingback->validate()) {
|
24 |
+
|
25 |
+
if ($this->isRecurring($pingback)) {
|
26 |
+
return $this->processPingbackRecurringProfile($pingback);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
} else {
|
28 |
+
return $this->processPingbackOrder($pingback);
|
29 |
}
|
30 |
} else {
|
31 |
return $pingback->getErrorSummary();
|
34 |
return '';
|
35 |
}
|
36 |
|
37 |
+
/**
|
38 |
+
* @param Paymentwall_Pingback $pingback
|
39 |
+
* @return string
|
40 |
+
*/
|
41 |
+
protected function processPingbackRecurringProfile(Paymentwall_Pingback $pingback) {
|
42 |
+
$recurringProfile = Mage::getModel('sales/recurring_profile')->loadByInternalReferenceId($pingback->getProductId());
|
43 |
+
|
44 |
+
if ($recurringProfile->getId()) {
|
45 |
+
try {
|
46 |
+
if ($pingback->isDeliverable()) {
|
47 |
+
$recurringProfile->setState(Mage_Sales_Model_Recurring_Profile::STATE_ACTIVE)->save();
|
48 |
+
} elseif ($pingback->isCancelable()) {
|
49 |
+
$recurringProfile->setState(Mage_Sales_Model_Recurring_Profile::STATE_CANCELED)->save();
|
50 |
+
}
|
51 |
+
|
52 |
+
return self::DEFAULT_PINGBACK_RESPONSE;
|
53 |
+
} catch (Exception $e) {
|
54 |
+
Mage::log($e->getMessage());
|
55 |
+
$result = 'Internal server error';
|
56 |
+
$result .= ' ' . $e->getMessage();
|
57 |
+
return $result;
|
58 |
+
}
|
59 |
+
} else {
|
60 |
+
return 'The Recurring Profile is invalid';
|
61 |
+
}
|
62 |
+
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* @param Paymentwall_Pingback $pingback
|
67 |
+
* @return string
|
68 |
+
*/
|
69 |
+
protected function processPingbackOrder(Paymentwall_Pingback $pingback) {
|
70 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($pingback->getProductId());
|
71 |
+
if ($order->getId()) {
|
72 |
+
try {
|
73 |
+
if ($pingback->isDeliverable()) {
|
74 |
+
|
75 |
+
$paymentModel = $order->getPayment()->getMethodInstance();
|
76 |
+
$paymentModel->setCurrentOrder($order)
|
77 |
+
->processPendingPayment($pingback);
|
78 |
+
|
79 |
+
return self::DEFAULT_PINGBACK_RESPONSE;
|
80 |
+
} elseif ($pingback->isCancelable()) {
|
81 |
+
$order->registerCancellation(Mage::helper('sales')->__('Order marked as cancelled by Paymentwall.'))
|
82 |
+
->save();
|
83 |
+
return Mage::helper('sales')->__('Order marked as cancelled by Paymentwall.');
|
84 |
+
} elseif ($pingback->isUnderReview()) {
|
85 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW, true)
|
86 |
+
->save();
|
87 |
+
}
|
88 |
+
|
89 |
+
} catch (Exception $e) {
|
90 |
+
Mage::log($e->getMessage());
|
91 |
+
$result = 'Internal server error';
|
92 |
+
$result .= ' ' . $e->getMessage();
|
93 |
+
return $result;
|
94 |
+
}
|
95 |
+
} else {
|
96 |
+
return 'The Order is invalid';
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* @param Paymentwall_Pingback $pingback
|
102 |
+
* @return bool
|
103 |
+
*/
|
104 |
+
protected function isRecurring(Paymentwall_Pingback $pingback) {
|
105 |
+
return $pingback->getProductPeriodLength() > 0;
|
106 |
+
}
|
107 |
|
108 |
}
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>paymentwall_magento_module</name>
|
4 |
-
<version>1.1.
|
5 |
<stability>stable</stability>
|
6 |
<license>MITL</license>
|
7 |
<channel>community</channel>
|
@@ -9,11 +9,11 @@
|
|
9 |
<summary>Paymentwall payment extension for Magento. 120+ payment methods in more than 200 countries.</summary>
|
10 |
<description>Paymentwall payment extension for Magento. 120+ payment methods in more than 200 countries.
|
11 |
</description>
|
12 |
-
<notes>*
|
13 |
<authors><author><name>Paymentwall</name><user>platforms</user><email>platforms@paymentwall.com</email></author></authors>
|
14 |
-
<date>2015-11-
|
15 |
-
<time>
|
16 |
-
<contents><target name="magecommunity"><dir name="Paymentwall"><dir name="Paymentwall"><dir name="Block"><dir name="Checkout"><dir name="Form"><dir name="Method"><file name="Abstract.php" hash="de9bfa933a6e1757c3bab53768ec4d62"/><file name="Pwbrick.php" hash="c01cabde8670bdff801534fe283b0534"/><file name="Pwlocal.php" hash="2d4a1fb4fdfcaaf5d7cf72eae4231965"/></dir></dir><dir name="Info"><dir name="Method"><file name="Pwbrick.php" hash="4d8bc2a37e04c180896a708dabf9cfa7"/><file name="Pwlocal.php" hash="52d3d7580cbdcc8bf0f98834b9a9e5a0"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="4270b082a8264e63f6a82228b3e2c1d2"/></dir><dir name="Model"><dir name="Method"><file name="Abstract.php" hash="
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>paymentwall_magento_module</name>
|
4 |
+
<version>1.1.6</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>MITL</license>
|
7 |
<channel>community</channel>
|
9 |
<summary>Paymentwall payment extension for Magento. 120+ payment methods in more than 200 countries.</summary>
|
10 |
<description>Paymentwall payment extension for Magento. 120+ payment methods in more than 200 countries.
|
11 |
</description>
|
12 |
+
<notes>* Fixed double token requests on Magento 1.7</notes>
|
13 |
<authors><author><name>Paymentwall</name><user>platforms</user><email>platforms@paymentwall.com</email></author></authors>
|
14 |
+
<date>2015-11-30</date>
|
15 |
+
<time>10:10:57</time>
|
16 |
+
<contents><target name="magecommunity"><dir name="Paymentwall"><dir name="Paymentwall"><dir name="Block"><dir name="Checkout"><dir name="Form"><dir name="Method"><file name="Abstract.php" hash="de9bfa933a6e1757c3bab53768ec4d62"/><file name="Pwbrick.php" hash="c01cabde8670bdff801534fe283b0534"/><file name="Pwlocal.php" hash="2d4a1fb4fdfcaaf5d7cf72eae4231965"/></dir></dir><dir name="Info"><dir name="Method"><file name="Pwbrick.php" hash="4d8bc2a37e04c180896a708dabf9cfa7"/><file name="Pwlocal.php" hash="52d3d7580cbdcc8bf0f98834b9a9e5a0"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="4270b082a8264e63f6a82228b3e2c1d2"/></dir><dir name="Model"><dir name="Method"><file name="Abstract.php" hash="634893d72397dc685742c40129fd0c6f"/><file name="Pwbrick.php" hash="cd6d79296c84437d1bafa47179a92e16"/><file name="Pwlocal.php" hash="5219dc1add304a953bd07edb94e3e8b6"/></dir><file name="Pingback.php" hash="66e5be1753623fc5030da4af2c3c8f31"/></dir><dir name="controllers"><file name="PaymentController.php" hash="6d576fabeef93bc1e36a1dad97a26f9c"/></dir><dir name="etc"><file name="config.xml" hash="a3cecb964e427b27f32167923ac8ff93"/><file name="system.xml" hash="82abac90b5d8edf1b47e72135245b2ea"/></dir></dir></dir></target><target name="magelib"><dir name="paymentwall-php"><file name="LICENSE" hash="001561189374b83bcd6bc7f962daee8a"/><file name="README.md" hash="094753cc8aed5d682e40ae82de375ad1"/><file name="composer.json" hash="4e7035c64f2d74ba0a5f5cf80effe45e"/><dir name="features"><dir name="bootstrap"><file name="ChargeContext.php" hash="f1d0604f2fc16dd5932535f9c24995a3"/><file name="FeatureContext.php" hash="146d6e79c6704cfb24ee6f2a7b7fba5a"/><file name="PingbackContext.php" hash="b6c86d8f3c9caa21435f47ddb2d5add1"/><file name="WidgetContext.php" hash="70c8d608eb407e346467c2a8f7162732"/></dir><file name="charge.feature" hash="04258fc641535794c48c6c55aad7f94f"/><file name="pingback.feature" hash="05869da8a3e36b6bec0293a22c1a9235"/><file name="widget.feature" hash="198999d8bf357de175f3268cc88337f6"/></dir><dir name="lib"><dir name="Paymentwall"><file name="ApiObject.php" hash="dae810eb439b239392a7706f5421f5b8"/><file name="ApiObjectInterface.php" hash="4922ff334356aac33a5b159f8d001b93"/><file name="Base.php" hash="9bdae1c385327dadbd0ca5c9bbbe6107"/><file name="Card.php" hash="d8aa72a3e8ea0cdd132867164c8352c1"/><file name="Charge.php" hash="0ca04683046e9abdf3968f495db625c4"/><file name="Config.php" hash="9253f2afd5523653dd9e5fce2afc15c4"/><file name="GenerericApiObject.php" hash="6016e500c2c6736048c2f27ae8924a1c"/><file name="HttpAction.php" hash="66bc684bf7476bd21ed6f3275c3ed758"/><file name="Instance.php" hash="86422afa5d43aac945021ef694b9bbc1"/><file name="OneTimeToken.php" hash="e3b9c56c34920c9b5ea53609d95acb3b"/><file name="Pingback.php" hash="fefcc3b656ab048d1f136c2b6896562a"/><file name="Product.php" hash="8b382cb28b68f77c9784e5dbc40512cb"/><dir name="Response"><file name="Abstract.php" hash="f59033acb9e14fa7a90cc2f812b6970c"/><file name="Error.php" hash="4554a0b337a2748221fb7dfae2daa8c2"/><file name="Factory.php" hash="7036d21f4682b505d5b1ff04ec79e355"/><file name="Interface.php" hash="e75f22329b3c8cbdf389aee8366ceaf3"/><file name="Success.php" hash="1f3c6c58b4273eadff5ef4b482b65187"/></dir><dir name="Signature"><file name="Abstract.php" hash="dea8f9c03b02db7462d276e3611a3a98"/><file name="Pingback.php" hash="1ab1e00037d395f9bc55bea929397927"/><file name="Widget.php" hash="2e1e2a712a0eca4f54f834838df51a59"/></dir><file name="Subscription.php" hash="7110f0292dbe01e4bc1517b5cc206ed2"/><file name="Widget.php" hash="6a91e8c0f4fe930facde52c2750824da"/></dir><file name="paymentwall.php" hash="6f4ee78ffb0677d2a49d2417dae2c038"/></dir><file name=".git" hash="50da8e1bb8ed3a4d1e1413fe2d6c0d68"/><file name=".gitignore" hash="d22fe2936066c576100994c62f32761e"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="paymentwall.css" hash="408b3eb269441b27d262c3abc6da78f3"/></dir><dir name="js"><file name="paymentwall.js" hash="1e7325840d61fc68daa291751282fa2f"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="paymentwall.xml" hash="15713872f2239c9b3cb615291b36e54b"/></dir><dir name="template"><dir name="paymentwall"><dir name="checkout"><dir name="form"><dir name="method"><file name="pwbrick.phtml" hash="95f073505e84b3c75607ff52538c01c7"/><file name="pwlocal.phtml" hash="b964770e54bb91fca23a49951e3c744c"/></dir></dir><dir name="info"><dir name="method"><file name="pwbrick.phtml" hash="b23472e15332c427456e9d92619eecff"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Paymentwall_Paymentwall.xml" hash="a5ef063119f4c0d274cc2f7a72699538"/></dir></target></contents>
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|
skin/frontend/base/default/js/paymentwall.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
var PW = {
|
|
|
2 |
"initPwBrick": function (publicKey) {
|
3 |
return new Brick({
|
4 |
public_key: publicKey,
|
@@ -56,10 +57,17 @@ var PW = {
|
|
56 |
},
|
57 |
"rewriteSavePayment": function (brick) {
|
58 |
|
|
|
|
|
|
|
|
|
|
|
59 |
Payment.prototype.save = Payment.prototype.save.wrap(function (origin_save) {
|
60 |
if ($('p_method_paymentwall_pwbrick').checked) {
|
|
|
61 |
// Check payment method selected
|
62 |
var validator = new Validation(this.form);
|
|
|
63 |
if (this.validate() && validator.validate()) {
|
64 |
brick.tokenizeCard(
|
65 |
PW.prepareBrickData(),
|
1 |
var PW = {
|
2 |
+
"rewritePayment": false,
|
3 |
"initPwBrick": function (publicKey) {
|
4 |
return new Brick({
|
5 |
public_key: publicKey,
|
57 |
},
|
58 |
"rewriteSavePayment": function (brick) {
|
59 |
|
60 |
+
if (this.rewritePayment) {
|
61 |
+
return false;
|
62 |
+
}
|
63 |
+
|
64 |
+
this.rewritePayment = true;
|
65 |
Payment.prototype.save = Payment.prototype.save.wrap(function (origin_save) {
|
66 |
if ($('p_method_paymentwall_pwbrick').checked) {
|
67 |
+
|
68 |
// Check payment method selected
|
69 |
var validator = new Validation(this.form);
|
70 |
+
|
71 |
if (this.validate() && validator.validate()) {
|
72 |
brick.tokenizeCard(
|
73 |
PW.prepareBrickData(),
|