Version Notes
Stable Version
Download this release
Release Info
Developer | Magento Core Team |
Extension | Apruve_B2B_Payment_Gateway |
Version | 1.0.4 |
Comparing to | |
See all releases |
Code changes from version 1.0.3 to 1.0.4
- app/code/community/Apruve/ApruvePayment/Block/Review.php +11 -0
- app/code/community/Apruve/ApruvePayment/Model/Api/Abstract.php +2 -2
- app/code/community/Apruve/ApruvePayment/controllers/PaymentController.php +4 -2
- app/code/community/Apruve/ApruvePayment/etc/config.xml +1 -1
- app/design/frontend/default/default/template/apruvepayment/review.phtml +8 -3
- package.xml +4 -4
app/code/community/Apruve/ApruvePayment/Block/Review.php
CHANGED
@@ -56,4 +56,15 @@ class Apruve_ApruvePayment_Block_Review extends Mage_Core_Block_Template
|
|
56 |
return Mage::getSingleton('apruvepayment/session');
|
57 |
}
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
}
|
56 |
return Mage::getSingleton('apruvepayment/session');
|
57 |
}
|
58 |
|
59 |
+
/**
|
60 |
+
* Check if quote contain only virtual products
|
61 |
+
* @return bool
|
62 |
+
*/
|
63 |
+
public function getQuoteIsVirtual()
|
64 |
+
{
|
65 |
+
$quote = Mage::getSingleton('checkout/session')->getQuote();
|
66 |
+
return $quote->getIsVirtual();
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
}
|
app/code/community/Apruve/ApruvePayment/Model/Api/Abstract.php
CHANGED
@@ -68,7 +68,7 @@ abstract class Apruve_ApruvePayment_Model_Api_Abstract
|
|
68 |
*/
|
69 |
protected function _getIsTestMode()
|
70 |
{
|
71 |
-
return
|
72 |
}
|
73 |
|
74 |
|
@@ -83,7 +83,7 @@ abstract class Apruve_ApruvePayment_Model_Api_Abstract
|
|
83 |
if($this->_getIsTestMode()) {
|
84 |
return $http.'test.apruve.com/';
|
85 |
} else {
|
86 |
-
return $http.'apruve.com/';
|
87 |
}
|
88 |
}
|
89 |
|
68 |
*/
|
69 |
protected function _getIsTestMode()
|
70 |
{
|
71 |
+
return Mage::getStoreConfig('payment/apruvepayment/testmode');
|
72 |
}
|
73 |
|
74 |
|
83 |
if($this->_getIsTestMode()) {
|
84 |
return $http.'test.apruve.com/';
|
85 |
} else {
|
86 |
+
return $http.'www.apruve.com/';
|
87 |
}
|
88 |
}
|
89 |
|
app/code/community/Apruve/ApruvePayment/controllers/PaymentController.php
CHANGED
@@ -55,7 +55,8 @@ class Apruve_ApruvePayment_PaymentController extends Mage_Core_Controller_Front_
|
|
55 |
$rest = Mage::getModel('apruvepayment/api_rest');
|
56 |
|
57 |
$session = Mage::getSingleton('apruvepayment/session');
|
58 |
-
|
|
|
59 |
$tax = $quote->getShippingAddress()->getTaxAmount();
|
60 |
$shipping = $quote->getShippingAddress()->getShippingAmount();
|
61 |
if(!$rest->updatePaymentRequest($token, $amount, $shipping, $tax))
|
@@ -67,6 +68,7 @@ class Apruve_ApruvePayment_PaymentController extends Mage_Core_Controller_Front_
|
|
67 |
}
|
68 |
}
|
69 |
|
|
|
70 |
if(!$rest->postPayment($token, $amount)) {
|
71 |
//show errors
|
72 |
$errors['couldnt_rest_payment'] = 'Apruve couldn\'t process order information';
|
@@ -116,7 +118,7 @@ class Apruve_ApruvePayment_PaymentController extends Mage_Core_Controller_Front_
|
|
116 |
if(!empty($result)) {
|
117 |
Mage::getSingleton('apruvepayment/session')->setErrors($result['message']);
|
118 |
} else {
|
119 |
-
|
120 |
}
|
121 |
|
122 |
$this->_redirect('*/*/review');
|
55 |
$rest = Mage::getModel('apruvepayment/api_rest');
|
56 |
|
57 |
$session = Mage::getSingleton('apruvepayment/session');
|
58 |
+
|
59 |
+
if($session->getAddressUpdated() && !$quote->getIsVirtual()) {
|
60 |
$tax = $quote->getShippingAddress()->getTaxAmount();
|
61 |
$shipping = $quote->getShippingAddress()->getShippingAmount();
|
62 |
if(!$rest->updatePaymentRequest($token, $amount, $shipping, $tax))
|
68 |
}
|
69 |
}
|
70 |
|
71 |
+
|
72 |
if(!$rest->postPayment($token, $amount)) {
|
73 |
//show errors
|
74 |
$errors['couldnt_rest_payment'] = 'Apruve couldn\'t process order information';
|
118 |
if(!empty($result)) {
|
119 |
Mage::getSingleton('apruvepayment/session')->setErrors($result['message']);
|
120 |
} else {
|
121 |
+
$this->_setAddressUpdated();
|
122 |
}
|
123 |
|
124 |
$this->_redirect('*/*/review');
|
app/code/community/Apruve/ApruvePayment/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Apruve_ApruvePayment>
|
5 |
-
<version>1.0.
|
6 |
</Apruve_ApruvePayment>
|
7 |
</modules>
|
8 |
<frontend>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Apruve_ApruvePayment>
|
5 |
+
<version>1.0.4</version>
|
6 |
</Apruve_ApruvePayment>
|
7 |
</modules>
|
8 |
<frontend>
|
app/design/frontend/default/default/template/apruvepayment/review.phtml
CHANGED
@@ -19,7 +19,9 @@
|
|
19 |
*/
|
20 |
?>
|
21 |
|
22 |
-
<?php $errors = $this->getErrors()
|
|
|
|
|
23 |
<div class="page-title">
|
24 |
<h1><?php echo $this->__('Review Order') ?></h1>
|
25 |
</div>
|
@@ -42,17 +44,20 @@
|
|
42 |
<h2 class="legend"> Billing Info</h2>
|
43 |
<?php echo $this->getChild('billing')->setFieldNamePrefix('billing')->toHtml(); ?>
|
44 |
</div>
|
|
|
45 |
<div class="col-2 info-set" style="width:45%; display: inline-block; float: right;">
|
46 |
<h2 class="legend"> Shipping Info</h2>
|
47 |
<?php echo $this->getChild('shipping')->setFieldNamePrefix('shipping')->toHtml(); ?>
|
48 |
</div>
|
|
|
49 |
</div>
|
50 |
<div style="clear: both;"></div>
|
51 |
|
52 |
-
<div><?php echo $this->getChildHtml('shipping_method'); ?></div>
|
53 |
|
|
|
|
|
|
|
54 |
|
55 |
-
<?php //echo $this->getChildHtml('shipping_method');?>
|
56 |
<div class="apruve-review-order">
|
57 |
<form method="post" id="order_review_form" action="<?php echo $this->getPlaceOrderUrl() ?>">
|
58 |
<div class="info-set">
|
19 |
*/
|
20 |
?>
|
21 |
|
22 |
+
<?php $errors = $this->getErrors();
|
23 |
+
$this->getQuoteIsVirtual();
|
24 |
+
?>
|
25 |
<div class="page-title">
|
26 |
<h1><?php echo $this->__('Review Order') ?></h1>
|
27 |
</div>
|
44 |
<h2 class="legend"> Billing Info</h2>
|
45 |
<?php echo $this->getChild('billing')->setFieldNamePrefix('billing')->toHtml(); ?>
|
46 |
</div>
|
47 |
+
<?php if(!$this->getQuoteIsVirtual()) :?>
|
48 |
<div class="col-2 info-set" style="width:45%; display: inline-block; float: right;">
|
49 |
<h2 class="legend"> Shipping Info</h2>
|
50 |
<?php echo $this->getChild('shipping')->setFieldNamePrefix('shipping')->toHtml(); ?>
|
51 |
</div>
|
52 |
+
<?php endif;?>
|
53 |
</div>
|
54 |
<div style="clear: both;"></div>
|
55 |
|
|
|
56 |
|
57 |
+
<?php if(!$this->getQuoteIsVirtual()) :?>
|
58 |
+
<div><?php echo $this->getChildHtml('shipping_method'); ?></div>
|
59 |
+
<?php endif;?>
|
60 |
|
|
|
61 |
<div class="apruve-review-order">
|
62 |
<form method="post" id="order_review_form" action="<?php echo $this->getPlaceOrderUrl() ?>">
|
63 |
<div class="info-set">
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Apruve_B2B_Payment_Gateway</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.apache.org/licenses/LICENSE-2.0">Apache License, 2.0</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>Payments designed for business spending. Increase sales and reduce cart abandonment by allowing your shoppers to send purchases directly to their company or client for payment, simply by using an email address instead of a credit card. Learn more and sign up for a free merchant account at http://www.apruve.com.</description>
|
11 |
<notes>Stable Version</notes>
|
12 |
<authors><author><name>Apruve</name><user>auto-converted</user><email>magento@apruve.com</email></author></authors>
|
13 |
-
<date>2014-01-
|
14 |
-
<time>14:
|
15 |
-
<contents><target name="magecommunity"><dir name="Apruve"><dir name="ApruvePayment"><dir name="Block"><dir name="Admin"><file name="Webhook.php" hash="9d4bdae192f68d18b90ba7758d65413a"/></dir><dir name="Payment"><file name="Form.php" hash="0e9788976c4fa4380ad6f76ca8e656d8"/></dir><dir name="Review"><file name="Billing.php" hash="ef25b3b421753e850492230121ba123d"/><file name="Details.php" hash="630be5289ef8190c50932195e78d6f2f"/><file name="Result.php" hash="c04da45eabf6a68111f212ed3f9f1a85"/><file name="Shipping.php" hash="6996af1a1165e1652327b596f7300625"/></dir><file name="Review.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Apruve_B2B_Payment_Gateway</name>
|
4 |
+
<version>1.0.4</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.apache.org/licenses/LICENSE-2.0">Apache License, 2.0</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Payments designed for business spending. Increase sales and reduce cart abandonment by allowing your shoppers to send purchases directly to their company or client for payment, simply by using an email address instead of a credit card. Learn more and sign up for a free merchant account at http://www.apruve.com.</description>
|
11 |
<notes>Stable Version</notes>
|
12 |
<authors><author><name>Apruve</name><user>auto-converted</user><email>magento@apruve.com</email></author></authors>
|
13 |
+
<date>2014-01-11</date>
|
14 |
+
<time>14:54:13</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Apruve"><dir name="ApruvePayment"><dir name="Block"><dir name="Admin"><file name="Webhook.php" hash="9d4bdae192f68d18b90ba7758d65413a"/></dir><dir name="Payment"><file name="Form.php" hash="0e9788976c4fa4380ad6f76ca8e656d8"/></dir><dir name="Review"><file name="Billing.php" hash="ef25b3b421753e850492230121ba123d"/><file name="Details.php" hash="630be5289ef8190c50932195e78d6f2f"/><file name="Result.php" hash="c04da45eabf6a68111f212ed3f9f1a85"/><file name="Shipping.php" hash="6996af1a1165e1652327b596f7300625"/></dir><file name="Review.php" hash="3899d8ba1c67c9bddbcc1aedf20edea2"/></dir><dir name="Helper"><file name="Data.php" hash="4e541255b94d18f3ee058044810cade2"/></dir><dir name="Model"><dir name="Api"><file name="Abstract.php" hash="ff5ba985c0be19fbc494dff8b72fd0d7"/><file name="PaymentRequest.php" hash="20642627cc3ae5c3fd3551ee7d545350"/><file name="Rest.php" hash="24594a585e77d39141e481cd33817b3d"/></dir><dir name="Mysql4"><file name="Setup.php" hash="8b3e5b033dac91b47e59c024e16c04ec"/></dir><file name="PaymentMethod.php" hash="e59fa770e455f1bf19ccd2fc66d21386"/><file name="Session.php" hash="2f7d9205490a8c0a053c1898a8e01cc4"/></dir><dir name="controllers"><file name="PaymentController.php" hash="1235ea5891fb38639c0d21317b9560f4"/><file name="WebhookController.php" hash="f326a073653658b3844ee925fd20a4d8"/></dir><dir name="etc"><file name="config.xml" hash="28d2de03e84806f99fd4e7f90976d630"/><file name="system.xml" hash="0bede58fc1882493df6710fd0d981d2f"/></dir><file name="LICENSE.txt" hash="9b76dd4b62de4f9840b5d462fcb25e39"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Apruve_ApruvePayment.xml" hash="68277872189de89c07b32651805c0cfd"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="apruvepayment.xml" hash="1d52df076454609594100f4f34410335"/></dir><dir name="template"><dir name="apruvepayment"><dir name="payment"><file name="form.phtml" hash="f5bb213aa629bed02b7c83c3e7512bbc"/><file name="mark.phtml" hash="c55da5ae5c0fb45c2433b9ac865bcd0d"/></dir><dir name="review"><dir name="shipping"><file name="method.phtml" hash="5d35b4f1f35d264bcd01864855da8db5"/></dir><file name="address.phtml" hash="6b9847fc1c92a1751de58691d6757313"/><file name="details.phtml" hash="603681f92d1683bf8edce9ac5bce7d2f"/><file name="result.phtml" hash="2b7438c88e2248f7591d600592210519"/><file name="shipping_method.phtml" hash="a8291b340315ca485c6a298eb86b3a0c"/></dir><file name="head.phtml" hash="34585fced2912e86978ab3253791c5a2"/><file name="review.phtml" hash="1c8f884b991d8842fbf9469d857ccb4a"/><file name="shortcut.phtml" hash="cfb4ddcaa286b8b5fd1dc32dcdcde77d"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="Apruve"><file name="ApruvePayment.js" hash="e6f1716e3e0668963dffff0d1ab04fb1"/></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|