Version Notes
Added possibility to disable extension in Magento backend.
Download this release
Release Info
Developer | David Danier |
Extension | PaypalUseractionCommit |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
- app/code/community/Team23/PaypalUseractionCommit/Helper/Data.php +27 -0
- app/code/community/Team23/PaypalUseractionCommit/Model/Config.php +13 -6
- app/code/community/Team23/PaypalUseractionCommit/controllers/ExpressController.php +57 -50
- app/code/community/Team23/PaypalUseractionCommit/etc/adminhtml.xml +35 -0
- app/code/community/Team23/PaypalUseractionCommit/etc/config.xml +15 -2
- app/code/community/Team23/PaypalUseractionCommit/etc/system.xml +42 -0
- app/etc/modules/Team23_PaypalUseractionCommit.xml +1 -1
- package.xml +18 -10
app/code/community/Team23/PaypalUseractionCommit/Helper/Data.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Team23_PaypalUseractionCommit
|
5 |
+
*
|
6 |
+
* @category Team23
|
7 |
+
* @package Team23_PaypalUseractionCommit
|
8 |
+
* @version 1.0.1
|
9 |
+
* @copyright 2014 Team23 GmbH & Co. KG (http://www.team23.de)
|
10 |
+
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
|
11 |
+
*/
|
12 |
+
|
13 |
+
|
14 |
+
class Team23_PaypalUseractionCommit_Helper_Data extends Mage_Core_Helper_Abstract
|
15 |
+
{
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Check if module is active
|
19 |
+
*
|
20 |
+
* @return bool
|
21 |
+
*/
|
22 |
+
public function isActive()
|
23 |
+
{
|
24 |
+
return $this->isModuleEnabled();
|
25 |
+
}
|
26 |
+
|
27 |
+
}
|
app/code/community/Team23/PaypalUseractionCommit/Model/Config.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
*
|
6 |
* @category Team23
|
7 |
* @package Team23_PaypalUseractionCommit
|
8 |
-
* @version 1.0.
|
9 |
* @copyright 2014 Team23 GmbH & Co. KG (http://www.team23.de)
|
10 |
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
|
11 |
*/
|
@@ -22,11 +22,18 @@ class Team23_PaypalUseractionCommit_Model_Config extends Mage_Paypal_Model_Confi
|
|
22 |
*/
|
23 |
public function getExpressCheckoutStartUrl($token)
|
24 |
{
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
|
32 |
}
|
5 |
*
|
6 |
* @category Team23
|
7 |
* @package Team23_PaypalUseractionCommit
|
8 |
+
* @version 1.0.1
|
9 |
* @copyright 2014 Team23 GmbH & Co. KG (http://www.team23.de)
|
10 |
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
|
11 |
*/
|
22 |
*/
|
23 |
public function getExpressCheckoutStartUrl($token)
|
24 |
{
|
25 |
+
if (Mage::helper('Team23_PaypalUseractionCommit')->isActive())
|
26 |
+
{
|
27 |
+
return $this->getPaypalUrl(array(
|
28 |
+
'cmd' => '_express-checkout',
|
29 |
+
'useraction' => 'commit',
|
30 |
+
'token' => $token,
|
31 |
+
));
|
32 |
+
}
|
33 |
+
else
|
34 |
+
{
|
35 |
+
return parent::getExpressCheckoutStartUrl($token);
|
36 |
+
}
|
37 |
}
|
38 |
|
39 |
}
|
app/code/community/Team23/PaypalUseractionCommit/controllers/ExpressController.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
*
|
6 |
* @category Team23
|
7 |
* @package Team23_PaypalUseractionCommit
|
8 |
-
* @version 1.0.
|
9 |
* @copyright 2014 Team23 GmbH & Co. KG (http://www.team23.de)
|
10 |
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
|
11 |
*/
|
@@ -77,77 +77,84 @@ class Team23_PaypalUseractionCommit_ExpressController extends Mage_Paypal_Expres
|
|
77 |
*/
|
78 |
public function returnAction()
|
79 |
{
|
80 |
-
|
81 |
-
|
|
|
|
|
82 |
|
83 |
-
|
84 |
-
|
85 |
|
86 |
-
|
87 |
-
|
88 |
|
89 |
-
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
|
134 |
return;
|
135 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
|
137 |
-
$this->
|
138 |
-
$this->_redirect('checkout/onepage/success');
|
139 |
-
|
140 |
-
return;
|
141 |
-
}
|
142 |
-
catch (Mage_Core_Exception $e) {
|
143 |
-
Mage::getSingleton('checkout/session')->addError($e->getMessage());
|
144 |
}
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
}
|
149 |
-
|
150 |
-
$this->_redirect('checkout/cart');
|
151 |
}
|
152 |
|
153 |
}
|
5 |
*
|
6 |
* @category Team23
|
7 |
* @package Team23_PaypalUseractionCommit
|
8 |
+
* @version 1.0.1
|
9 |
* @copyright 2014 Team23 GmbH & Co. KG (http://www.team23.de)
|
10 |
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
|
11 |
*/
|
77 |
*/
|
78 |
public function returnAction()
|
79 |
{
|
80 |
+
if (Mage::helper('Team23_PaypalUseractionCommit')->isActive())
|
81 |
+
{
|
82 |
+
try {
|
83 |
+
$this->_initCheckout();
|
84 |
|
85 |
+
// Call GetExpressCheckoutDetails
|
86 |
+
$this->_checkout->returnFromPaypal($this->_initToken());
|
87 |
|
88 |
+
// COPY OF placeOrderAction, without agreement check
|
89 |
+
$this->_checkout->place($this->_initToken());
|
90 |
|
91 |
+
// prepare session to success or cancellation page
|
92 |
+
$session = $this->_getCheckoutSession();
|
93 |
|
94 |
+
$session->clearHelperData();
|
95 |
|
96 |
+
// "last successful quote"
|
97 |
+
$quoteId = $this->_getQuote()->getId();
|
98 |
|
99 |
+
$session->setLastQuoteId($quoteId)->setLastSuccessQuoteId($quoteId);
|
100 |
|
101 |
+
// an order may be created
|
102 |
+
$order = $this->_checkout->getOrder();
|
103 |
|
104 |
+
if ($order)
|
105 |
+
{
|
106 |
+
$session->setLastOrderId($order->getId())
|
107 |
+
->setLastRealOrderId($order->getIncrementId());
|
108 |
|
109 |
+
// as well a billing agreement can be created
|
110 |
+
$agreement = $this->_checkout->getBillingAgreement();
|
111 |
|
112 |
+
if ($agreement)
|
113 |
+
$session->setLastBillingAgreementId($agreement->getId());
|
114 |
+
}
|
115 |
|
116 |
+
// recurring profiles may be created along with the order or without it
|
117 |
+
$profiles = $this->_checkout->getRecurringPaymentProfiles();
|
118 |
|
119 |
+
if ($profiles)
|
120 |
+
{
|
121 |
+
$ids = array();
|
122 |
|
123 |
+
foreach($profiles as $profile)
|
124 |
+
$ids[] = $profile->getId();
|
125 |
|
126 |
+
$session->setLastRecurringProfileIds($ids);
|
127 |
+
}
|
128 |
|
129 |
+
// redirect if PayPal specified some URL (for example, to Giropay bank)
|
130 |
+
$url = $this->_checkout->getRedirectUrl();
|
131 |
|
132 |
+
if ($url)
|
133 |
+
{
|
134 |
+
$this->getResponse()->setRedirect($url);
|
135 |
+
|
136 |
+
return;
|
137 |
+
}
|
138 |
+
|
139 |
+
$this->_initToken(false); // no need in token anymore
|
140 |
+
$this->_redirect('checkout/onepage/success');
|
141 |
|
142 |
return;
|
143 |
}
|
144 |
+
catch (Mage_Core_Exception $e) {
|
145 |
+
Mage::getSingleton('checkout/session')->addError($e->getMessage());
|
146 |
+
}
|
147 |
+
catch (Exception $e) {
|
148 |
+
Mage::getSingleton('checkout/session')->addError($this->__('Unable to process Express Checkout approval.'));
|
149 |
+
Mage::logException($e);
|
150 |
+
}
|
151 |
|
152 |
+
$this->_redirect('checkout/cart');
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
}
|
154 |
+
else
|
155 |
+
{
|
156 |
+
parent::returnAction();
|
157 |
}
|
|
|
|
|
158 |
}
|
159 |
|
160 |
}
|
app/code/community/Team23/PaypalUseractionCommit/etc/adminhtml.xml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
<!--
|
4 |
+
/**
|
5 |
+
* Team23_PaypalUseractionCommit
|
6 |
+
*
|
7 |
+
* @category Team23
|
8 |
+
* @package Team23_PaypalUseractionCommit
|
9 |
+
* @version 1.0.1
|
10 |
+
* @copyright 2014 Team23 GmbH & Co. KG (http://www.team23.de)
|
11 |
+
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
|
12 |
+
*/
|
13 |
+
-->
|
14 |
+
|
15 |
+
<config>
|
16 |
+
<acl>
|
17 |
+
<resources>
|
18 |
+
<admin>
|
19 |
+
<children>
|
20 |
+
<system>
|
21 |
+
<children>
|
22 |
+
<config>
|
23 |
+
<children>
|
24 |
+
<useractioncommit>
|
25 |
+
<title>PayPal Useractioncommit</title>
|
26 |
+
</useractioncommit>
|
27 |
+
</children>
|
28 |
+
</config>
|
29 |
+
</children>
|
30 |
+
</system>
|
31 |
+
</children>
|
32 |
+
</admin>
|
33 |
+
</resources>
|
34 |
+
</acl>
|
35 |
+
</config>
|
app/code/community/Team23/PaypalUseractionCommit/etc/config.xml
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
*
|
7 |
* @category Team23
|
8 |
* @package Team23_PaypalUseractionCommit
|
9 |
-
* @version 1.0.
|
10 |
* @copyright 2014 Team23 GmbH & Co. KG (http://www.team23.de)
|
11 |
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
|
12 |
*/
|
@@ -15,7 +15,7 @@
|
|
15 |
<config>
|
16 |
<modules>
|
17 |
<Team23_PaypalUseractionCommit>
|
18 |
-
<version>1.0.
|
19 |
</Team23_PaypalUseractionCommit>
|
20 |
</modules>
|
21 |
<global>
|
@@ -26,6 +26,12 @@
|
|
26 |
</rewrite>
|
27 |
</paypal>
|
28 |
</models>
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
</global>
|
30 |
<frontend>
|
31 |
<routers>
|
@@ -38,4 +44,11 @@
|
|
38 |
</paypal>
|
39 |
</routers>
|
40 |
</frontend>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
</config>
|
6 |
*
|
7 |
* @category Team23
|
8 |
* @package Team23_PaypalUseractionCommit
|
9 |
+
* @version 1.0.1
|
10 |
* @copyright 2014 Team23 GmbH & Co. KG (http://www.team23.de)
|
11 |
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
|
12 |
*/
|
15 |
<config>
|
16 |
<modules>
|
17 |
<Team23_PaypalUseractionCommit>
|
18 |
+
<version>1.0.1</version>
|
19 |
</Team23_PaypalUseractionCommit>
|
20 |
</modules>
|
21 |
<global>
|
26 |
</rewrite>
|
27 |
</paypal>
|
28 |
</models>
|
29 |
+
|
30 |
+
<helpers>
|
31 |
+
<Team23_PaypalUseractionCommit>
|
32 |
+
<class>Team23_PaypalUseractionCommit_Helper</class>
|
33 |
+
</Team23_PaypalUseractionCommit>
|
34 |
+
</helpers>
|
35 |
</global>
|
36 |
<frontend>
|
37 |
<routers>
|
44 |
</paypal>
|
45 |
</routers>
|
46 |
</frontend>
|
47 |
+
<default>
|
48 |
+
<payment>
|
49 |
+
<useractioncommit>
|
50 |
+
<active>1</active>
|
51 |
+
</useractioncommit>
|
52 |
+
</payment>
|
53 |
+
</default>
|
54 |
</config>
|
app/code/community/Team23/PaypalUseractionCommit/etc/system.xml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
<!--
|
4 |
+
/**
|
5 |
+
* Team23_PaypalUseractionCommit
|
6 |
+
*
|
7 |
+
* @category Team23
|
8 |
+
* @package Team23_PaypalUseractionCommit
|
9 |
+
* @version 1.0.1
|
10 |
+
* @copyright 2014 Team23 GmbH & Co. KG (http://www.team23.de)
|
11 |
+
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
|
12 |
+
*/
|
13 |
+
-->
|
14 |
+
|
15 |
+
<config>
|
16 |
+
<sections>
|
17 |
+
<payment>
|
18 |
+
<groups>
|
19 |
+
<useractioncommit translate="label" module="Team23_PaypalUseractionCommit">
|
20 |
+
<label>PayPal Useractioncommit</label>
|
21 |
+
<frontend_type>text</frontend_type>
|
22 |
+
<sort_order>20</sort_order>
|
23 |
+
<show_in_default>1</show_in_default>
|
24 |
+
<show_in_website>1</show_in_website>
|
25 |
+
<show_in_store>1</show_in_store>
|
26 |
+
<fields>
|
27 |
+
<active translate="label">
|
28 |
+
<label>Disable PayPal Express order review page</label>
|
29 |
+
<comment>Disables also agreements! If these are required for your shop, you have to integrate them before the customer gets redirected to PayPal!</comment>
|
30 |
+
<frontend_type>select</frontend_type>
|
31 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
32 |
+
<sort_order>10</sort_order>
|
33 |
+
<show_in_default>1</show_in_default>
|
34 |
+
<show_in_website>1</show_in_website>
|
35 |
+
<show_in_store>1</show_in_store>
|
36 |
+
</active>
|
37 |
+
</fields>
|
38 |
+
</useractioncommit>
|
39 |
+
</groups>
|
40 |
+
</payment>
|
41 |
+
</sections>
|
42 |
+
</config>
|
app/etc/modules/Team23_PaypalUseractionCommit.xml
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
*
|
7 |
* @category Team23
|
8 |
* @package Team23_PaypalUseractionCommit
|
9 |
-
* @version 1.0.
|
10 |
* @copyright 2014 Team23 GmbH & Co. KG (http://www.team23.de)
|
11 |
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
|
12 |
*/
|
6 |
*
|
7 |
* @category Team23
|
8 |
* @package Team23_PaypalUseractionCommit
|
9 |
+
* @version 1.0.1
|
10 |
* @copyright 2014 Team23 GmbH & Co. KG (http://www.team23.de)
|
11 |
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
|
12 |
*/
|
package.xml
CHANGED
@@ -1,18 +1,26 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>PaypalUseractionCommit</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
-
<license uri="http://opensource.org/licenses/MIT">
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description>
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><php><min>5.
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>PaypalUseractionCommit</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/MIT">MITL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>This extension removes the order review page from PayPal Express and redirects directly to order success page.</summary>
|
10 |
+
<description>When ordering using PayPal Express in Magento, it takes the customer to PayPal, PayPal already displays a confirmation, the customer confirms, and get redirected to another confirmation page (/paypal/express/review). This is an extra step that is unnecessary for user experience.
|
11 |
+

|
12 |
+
This extension removes the PayPal Express review page (/paypal/express/review) by adding "useraction => commit" to PayPal URL. Your customer will directly redirected to your success page after paying on PayPal. On PayPal side, the button now displays "Pay" instead of "Continue".
|
13 |
+

|
14 |
+
This extension extends the PayPal module from Magento.
|
15 |
+

|
16 |
+
Caution: The extension disables the agreements. If these are required for your shop, you have to integrate them before the customer gets redirected to PayPal!
|
17 |
+

|
18 |
+
This module is licensed under the MIT license.</description>
|
19 |
+
<notes>Added possibility to disable extension in Magento backend.</notes>
|
20 |
+
<authors><author><name>David Danier</name><user>team23</user><email>info@team23.de</email></author><author><name>Marc Rochow</name><user>team23</user><email>info@team23.de</email></author></authors>
|
21 |
+
<date>2014-04-08</date>
|
22 |
+
<time>09:42:11</time>
|
23 |
+
<contents><target name="magecommunity"><dir name="Team23"><dir name="PaypalUseractionCommit"><dir name="Helper"><file name="Data.php" hash="d1ae11ffc3a8bc20f97024c4b8768ad4"/></dir><dir name="Model"><file name="Config.php" hash="24eee20224e2f4a31d4d09c7078edf3d"/></dir><dir name="controllers"><file name="ExpressController.php" hash="98fcb267177c56a1dbe292cb8b4e75c8"/></dir><dir name="etc"><file name="adminhtml.xml" hash="7cdf7e7ec0a4b59279c372913b43a658"/><file name="config.xml" hash="34b73b415bda7b0a7e86505c27192f16"/><file name="system.xml" hash="c178dba0acbaf65dd3cbf0d52fe203ba"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Team23_PaypalUseractionCommit.xml" hash="b85d9fc3d3821d583670ee14aa59eb8c"/></dir></target></contents>
|
24 |
<compatible/>
|
25 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.8.1.0</max></package></required></dependencies>
|
26 |
</package>
|