Wexpay_Wexpay - Version 1.1.0

Version Notes

Check on multiple Ips from wexpay server.

Download this release

Release Info

Developer Wexpay
Extension Wexpay_Wexpay
Version 1.1.0
Comparing to
See all releases


Version 1.1.0

Files changed (24) hide show
  1. app/code/community/Wexpay/Wexpay/Block/Standard/Form.php +27 -0
  2. app/code/community/Wexpay/Wexpay/Block/Standard/Info.php +49 -0
  3. app/code/community/Wexpay/Wexpay/Block/Standard/Redirect.php +63 -0
  4. app/code/community/Wexpay/Wexpay/Helper/Data.php +26 -0
  5. app/code/community/Wexpay/Wexpay/Model/Api/Debug.php +26 -0
  6. app/code/community/Wexpay/Wexpay/Model/Method/Standard.php +390 -0
  7. app/code/community/Wexpay/Wexpay/Model/Mysql4/Api/Debug.php +26 -0
  8. app/code/community/Wexpay/Wexpay/Model/Mysql4/Api/Debug/Collection.php +25 -0
  9. app/code/community/Wexpay/Wexpay/Model/Mysql4/Setup.php +21 -0
  10. app/code/community/Wexpay/Wexpay/Model/Source/Status.php +39 -0
  11. app/code/community/Wexpay/Wexpay/controllers/StandardController.php +335 -0
  12. app/code/community/Wexpay/Wexpay/etc/config.xml +153 -0
  13. app/code/community/Wexpay/Wexpay/etc/system.xml +146 -0
  14. app/code/community/Wexpay/Wexpay/sql/wexpay_setup/mysql4-install-0.1.0.php +39 -0
  15. app/code/community/Wexpay/Wexpay/sql/wexpay_setup/mysql4-uninstall-0.1.0.php +32 -0
  16. app/code/community/Wexpay/Wexpay/sql/wexpay_setup/mysql4-upgrade-1.0.0-1.1.0.php +50 -0
  17. app/design/adminhtml/default/default/template/wexpay/standard/form.phtml +32 -0
  18. app/design/adminhtml/default/default/template/wexpay/standard/info.phtml +32 -0
  19. app/design/adminhtml/default/default/template/wexpay/standard/pdf/info.phtml +31 -0
  20. app/design/frontend/default/default/template/wexpay/standard/form.phtml +30 -0
  21. app/design/frontend/default/default/template/wexpay/standard/info.phtml +35 -0
  22. app/etc/modules/Wexpay_Wexpay.xml +30 -0
  23. app/locale/fr_FR/Wexpay_Wexpay.csv +36 -0
  24. package.xml +20 -0
app/code/community/Wexpay/Wexpay/Block/Standard/Form.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Wexpay extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Wexpay_Wexpay
14
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
15
+ * @author ALTIC - http://www.altic.org
16
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
17
+ */
18
+
19
+ class Wexpay_Wexpay_Block_Standard_Form extends Mage_Payment_Block_Form
20
+ {
21
+ protected function _construct()
22
+ {
23
+ parent::_construct();
24
+ $this->setTemplate('wexpay/standard/form.phtml');
25
+ }
26
+ }
27
+ ?>
app/code/community/Wexpay/Wexpay/Block/Standard/Info.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Wexpay extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Wexpay_Wexpay
14
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
15
+ * @author ALTIC - http://www.altic.org
16
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
17
+ */
18
+
19
+ class Wexpay_Wexpay_Block_Standard_Info extends Mage_Payment_Block_Info
20
+ {
21
+ protected function _construct()
22
+ {
23
+ parent::_construct();
24
+ $this->setTemplate('wexpay/standard/info.phtml');
25
+ }
26
+
27
+ public function getPaymentRefernce(){
28
+
29
+ $order = Mage::registry('current_order');
30
+ if(!empty($order)){
31
+ $pm = $order->getPayment();
32
+ $pmId = $pm->getWexpay_ref();
33
+ if(!empty($pmId)){
34
+
35
+ $html = '<br/>';
36
+ $html .= $this->__('Wexpay Reference:').'<strong>'.$pmId.'</strong>';
37
+ $html .= '<br/>';
38
+ return $html;
39
+
40
+ }
41
+ }
42
+ return false;
43
+ }
44
+
45
+ private function getCurrentUrl(){
46
+ return $currentUrl = $_SERVER['REQUEST_URI'];
47
+ }
48
+ }
49
+ ?>
app/code/community/Wexpay/Wexpay/Block/Standard/Redirect.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Wexpay extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Wexpay_Wexpay
14
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
15
+ * @author ALTIC - http://www.altic.org
16
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
17
+ */
18
+
19
+ class Wexpay_Wexpay_Block_Standard_Redirect extends Mage_Core_Block_Template
20
+ {
21
+ protected function _construct()
22
+ {
23
+ parent::_construct();
24
+ }
25
+
26
+ protected function _toHtml()
27
+ {
28
+
29
+ $wexpayStd = Mage::getModel('wexpay/method_standard');
30
+
31
+ $form = new Varien_Data_Form();
32
+ $form->setAction($wexpayStd->getWexpayUrl())
33
+ ->setId('Wexpay_payment_checkout')
34
+ ->setName('Wexpay_payment_checkout')
35
+ ->setMethod('POST')
36
+ ->setUseContainer(true);
37
+
38
+ foreach ($wexpayStd->getStandardCheckoutFormFields() as $field=>$value) {
39
+ $form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value));
40
+ }
41
+
42
+ $html = '<html><body><div id="wexpaypanel">';
43
+ $html.= $this->__('You will be redirected to Wexpay in a few seconds.');
44
+ $html.= '<img src="'.$this->getSkinUrl('images/media/wexpay/ajax-loader.gif').'" alt="go to Wexpay" />';
45
+ $html.= $form->toHtml();
46
+ $html.= '<script type="text/javascript">document.getElementById("Wexpay_payment_checkout").submit();</script>';
47
+ $html.= '</div></body></html>';
48
+
49
+ /**
50
+ * Before send the html for the redirect
51
+ * empty the session
52
+ * set the quote as inactive after redirect to weXpay
53
+ */
54
+ $session = Mage::getSingleton('checkout/session');
55
+ $session->getQuote()->setIsActive(false)->save();
56
+ $session->setWexpayQuoteId($session->getQuoteId());
57
+ $session->setWexpayLastSuccessQuoteId($session->getLastSuccessQuoteId());
58
+ $session->clear();
59
+
60
+ return $html;
61
+ }
62
+ }
63
+ ?>
app/code/community/Wexpay/Wexpay/Helper/Data.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Wexpay extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Wexpay_Wexpay
14
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
15
+ * @author ALTIC - http://www.altic.org
16
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
17
+ */
18
+
19
+ class Wexpay_Wexpay_Helper_Data extends Mage_Core_Helper_Abstract
20
+ {
21
+
22
+
23
+
24
+ }
25
+
26
+ ?>
app/code/community/Wexpay/Wexpay/Model/Api/Debug.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Ogone Payment extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Ogone
14
+ * @copyright Copyright (c) 2008 ALTIC Charly Clairmont (CCH)
15
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
+ *
17
+ * @file Mage/Ogone/Model/Api/Debug.php
18
+ */
19
+
20
+ class Mage_Ogone_Model_Api_Debug extends Mage_Core_Model_Abstract
21
+ {
22
+ protected function _construct()
23
+ {
24
+ $this->_init('ogone/api_debug');
25
+ }
26
+ }
app/code/community/Wexpay/Wexpay/Model/Method/Standard.php ADDED
@@ -0,0 +1,390 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Wexpay extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Wexpay_Wexpay
14
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
15
+ * @author ALTIC - http://www.altic.org
16
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
17
+ */
18
+
19
+ /**
20
+ *
21
+ * Wexpay Standard Checkout Module
22
+ */
23
+ class Wexpay_Wexpay_Model_Method_Standard extends Mage_Payment_Model_Method_Abstract
24
+ {
25
+
26
+
27
+ protected $_code = 'wexpay_standard';
28
+ protected $_formBlockType = 'wexpay/standard_form';
29
+ protected $_infoBlockType = 'wexpay/standard_info';
30
+
31
+ protected $moduleTitle;
32
+ protected $moduleDebugMode;
33
+
34
+ protected $_checkout;
35
+ protected $_quote;
36
+ protected $_order;
37
+ protected $_allowCurrencyCodes;
38
+ protected $_allowedParamToSend;
39
+
40
+
41
+
42
+ //changing the payment to different from cc payment type and paypal payment type
43
+ const PAYMENT_TYPE_AUTH = 'AUTHORIZATION';
44
+ const PAYMENT_TYPE_SALE = 'SALE';
45
+
46
+ const DATA_CHARSET = 'utf-8';
47
+
48
+ // if Status is validated
49
+ const WEXPAY_PAYMENT_VALIDATED = 0;
50
+ // if Status is unvalidated
51
+ const WEXPAY_PAYMENT_UNVALIDATED = 0;
52
+
53
+
54
+ protected $_allowCurrencyCode = array('EUR');
55
+
56
+ /**
57
+ * Check method for processing with base currency
58
+ *
59
+ * @param string $currencyCode
60
+ * @return boolean
61
+ */
62
+ public function canUseForCurrency($currencyCode)
63
+ {
64
+ if (!in_array($currencyCode, $this->_allowCurrencyCode)) {
65
+ return false;
66
+ }
67
+ return true;
68
+ }
69
+
70
+
71
+ /**
72
+ * Get wexpay session namespace
73
+ *
74
+ * @return Mage_Paypal_Model_Session
75
+ */
76
+ public function getSession()
77
+ {
78
+ return Mage::getSingleton('wexpay/session');
79
+ }
80
+
81
+ /**
82
+ * Get checkout session namespace
83
+ *
84
+ * @return Mage_Checkout_Model_Session
85
+ */
86
+ public function getCheckout()
87
+ {
88
+ return Mage::getSingleton('checkout/session');
89
+ }
90
+
91
+ /**
92
+ * Get current quote
93
+ *
94
+ * @return Mage_Sales_Model_Quote
95
+ */
96
+ public function getQuote()
97
+ {
98
+ return $this->getCheckout()->getQuote();
99
+ }
100
+
101
+ /**
102
+ * Using internal pages for input payment data
103
+ *
104
+ * @return bool
105
+ */
106
+ public function canUseInternal()
107
+ {
108
+ return false;
109
+ }
110
+
111
+ /**
112
+ * Using for multiple shipping address
113
+ *
114
+ * @return bool
115
+ */
116
+ public function canUseForMultishipping()
117
+ {
118
+ return false;
119
+ }
120
+
121
+ public function canCapture()
122
+ {
123
+ return false;
124
+ }
125
+
126
+ /**
127
+ * Get Order
128
+ * @return Mage_Sales_Model_Order
129
+ */
130
+ public function getOrder()
131
+ {
132
+
133
+ if (empty($this->_order)) {
134
+ $order = Mage::getModel('sales/order');
135
+ $order->loadByIncrementId($this->getCheckout()->getLastRealOrderId());
136
+ $this->_order = $order;
137
+ }
138
+ return $this->_order;
139
+ }
140
+
141
+ /**
142
+ * Html code of the build block
143
+ * @param $name name of the block
144
+ * @return String
145
+ */
146
+ public function createFormBlock($name)
147
+ {
148
+ $block = $this->getLayout()->createBlock('wexpay/standard_form', $name)
149
+ ->setMethod('wexpay_standard')
150
+ ->setPayment($this->getPayment())
151
+ ->setTemplate('wexpay/standard/form.phtml');
152
+
153
+ return $block;
154
+ }
155
+
156
+ /**
157
+ * validate the currency code is avaialable to use for wexpay or not
158
+ * @return Wexpay_Wexpay_Model_Method_Standard
159
+ */
160
+ public function validate()
161
+ {
162
+ parent::validate();
163
+ $currency_code = $this->getQuote()->getBaseCurrencyCode();
164
+ if (!in_array($currency_code,$this->_allowCurrencyCode)) {
165
+ Mage::throwException(Mage::helper('wexpay')->__('Selected currency code ('.$currency_code.') is not compatible with Wexpay'));
166
+ }
167
+ return $this;
168
+ }
169
+
170
+
171
+ public function onOrderValidate(Mage_Sales_Model_Order_Payment $payment)
172
+ {
173
+ return $this;
174
+ }
175
+
176
+ public function onInvoiceCreate(Mage_Sales_Model_Invoice_Payment $payment)
177
+ {
178
+
179
+ }
180
+
181
+ public function getOrderPlaceRedirectUrl()
182
+ {
183
+ return Mage::getUrl('wexpay/standard/redirect', array('_secure' => true));
184
+ }
185
+
186
+
187
+ // getters
188
+
189
+ // title
190
+ public function getTitle(){
191
+ if($this->moduleTitle == null)
192
+ $this->moduleTitle = Mage::getStoreConfig('payment/wexpay_standard/title');
193
+
194
+ return $this->moduleTitle;
195
+ }
196
+
197
+
198
+ // merchant_id
199
+ public function getMerchantId(){
200
+ return Mage::getStoreConfig('payment/wexpay_standard/merchant_id');
201
+ }
202
+
203
+ // ulReturn
204
+ public function getUrlReturn(){
205
+ $url = Mage::getStoreConfig('payment/wexpay_standard/urlReturn');
206
+ if(empty($url))
207
+ $url = Mage::getUrl('wexpay/standard/success', array('_secure' => true));
208
+
209
+ return $url;
210
+ }
211
+
212
+ // urlError
213
+ public function getUrlError(){
214
+
215
+ $url = Mage::getStoreConfig('payment/wexpay_standard/urlError');
216
+ if(empty($url))
217
+ $url = Mage::getUrl('wexpay/standard/error', array('_secure' => true));
218
+
219
+ return $url;
220
+ }
221
+
222
+ // urlNotification
223
+ public function getUrlNotification(){
224
+
225
+ $url = $this->moduleTitle = Mage::getStoreConfig('payment/wexpay_standard/urlNotification');
226
+ if(empty($url))
227
+ $url = Mage::getUrl('wexpay/standard/notify', array('_secure' => true));
228
+
229
+ return $url;
230
+ }
231
+
232
+ // urlLogo
233
+ public function getUrlLogo(){
234
+ return Mage::getStoreConfig('payment/wexpay_standard/urlLogo');
235
+ }
236
+
237
+ // order_status
238
+ public function getOrderStatus(){
239
+ return Mage::getStoreConfig('payment/wexpay_standard/order_status');
240
+ }
241
+
242
+ // wexpayIp
243
+ public function getWexpayIp(){
244
+ return Mage::getStoreConfig('payment/wexpay_standard/wexpayIp');
245
+ }
246
+
247
+ // wexpayRedirect
248
+ public function getWexpayRedirect(){
249
+ return Mage::getStoreConfig('payment/wexpay_standard/wexpayRedirect');
250
+ }
251
+
252
+ public function getDebugMode(){
253
+ if($this->moduleDebugMode == null)
254
+ $this->moduleDebugMode = Mage::getStoreConfig('payment/wexpay_standard/test');
255
+
256
+ return $this->moduleDebugMode;
257
+ }
258
+
259
+ public function getUrlValidTrasaction(){
260
+ return Mage::getStoreConfig('payment/wexpay_standard/urlValidTrasaction');
261
+ }
262
+
263
+ public function getUurlValidTrasaction(){
264
+ return Mage::getStoreConfig('payment/wexpay_standard/uUrlValidTrasaction');
265
+ }
266
+
267
+ public function getPurlValidTrasaction(){
268
+ return Mage::getStoreConfig('payment/wexpay_standard/pUrlValidTrasaction');
269
+ }
270
+
271
+ // end getters
272
+
273
+
274
+ public function getWexpayUrl()
275
+ {
276
+ return $this->getWexpayRedirect();
277
+ }
278
+
279
+ // validate transaction
280
+ public function validateTransaction($response)
281
+ {
282
+
283
+ if(empty($response['ref_order']))
284
+ return false;
285
+
286
+ if(empty($response['amount']))
287
+ return false;
288
+
289
+ $order = Mage::getModel('sales/order');
290
+ $order->loadByIncrementId($response['ref_order']);
291
+
292
+ if(empty($order))
293
+ return false;
294
+
295
+ $amt = round($order->getGrandTotal(), 2)*100;
296
+
297
+ if($amt != $response['amount'])
298
+ return false;
299
+
300
+ // connect to the http weXpay server and validate transaction
301
+ $configSsl = array(
302
+ 'adapter' => 'Zend_Http_Client_Adapter_Socket',
303
+ 'ssltransport' => 'tls',
304
+ 'maxredirects' => 0,
305
+ 'timeout' => 30,
306
+ );
307
+ $httpClient = new Zend_Http_Client($this->getUrlValidTrasaction(), $configSsl);
308
+
309
+ // send the basic authentification
310
+ $httpClient->setAuth($this->getUurlValidTrasaction(), $this->getPurlValidTrasaction(), Zend_Http_Client::AUTH_BASIC);
311
+
312
+ $httpResponse = $httpClient->request();
313
+ $httpResponseBody = $httpResponse->getBody();
314
+
315
+ if(empty($httpResponseBody))
316
+ return false;
317
+
318
+ $transactions = simplexml_load_string($httpResponseBody);
319
+ $nbTransactions = 0;
320
+ $nbTransactions = count($transactions->children());
321
+
322
+ if(!$nbTransactions)
323
+ return false;
324
+
325
+ $elemRefWexpay = 'S-RefTransaction';
326
+ $elemAmtWexpay = 'F-Montant';
327
+ $i = 0;
328
+
329
+ while($i < $nbTransactions)
330
+ {
331
+
332
+ $curTransaction = $transactions->transaction[$i]->$elemRefWexpay;
333
+ $curAmount = $transactions->transaction[$i]->$elemAmtWexpay;
334
+ $curAmount = round($curAmount, 2)*100;
335
+
336
+ //echo "curTransaction: $curTransaction | response['ref_wexpay'] : ". $response['ref_wexpay'] . " | curAmount : $curAmount | amt: $amt";
337
+ //echo "<hr/>";
338
+ if($curTransaction == $response['ref_wexpay'])
339
+ return ($curAmount == $amt);
340
+
341
+ $i++;
342
+
343
+ }
344
+
345
+ return false;
346
+
347
+ }
348
+
349
+ /**
350
+ * build an array with all parameters needed by the wexpay method payment
351
+ * @return Array
352
+ */
353
+ public function getStandardCheckoutFormFields()
354
+ {
355
+ return array(
356
+ 'merchant_id' => $this->getMerchantId(),
357
+ 'ref_order' => $this->getCheckout()->getLastRealOrderId(),
358
+ 'amount' => round($this->getOrder()->getGrandTotal(), 2)*100,
359
+ 'urlReturn' => $this->getUrlReturn(),
360
+ 'urlError' => $this->getUrlError(),
361
+ 'urlNotification' => $this->getUrlNotification(),
362
+ 'urlNotification' => $this->getUrlNotification(),
363
+
364
+ );
365
+ }
366
+
367
+ /**
368
+ * check if the ip of the server which contact our store server
369
+ * is one of weXpay
370
+ * @param $ip
371
+ * @return boolean
372
+ */
373
+ public function validateIp($ip)
374
+ {
375
+ $validatorIp = new Zend_Validate_Ip();
376
+
377
+ $ipsWexpay = explode(",",$this->getWexpayIp());
378
+
379
+ foreach($ipsWexpay as $ipWexpay)
380
+ {
381
+ if($validatorIp->isValid(trim($ipWexpay)) && $ip == $ipWexpay)
382
+ {
383
+ return true;
384
+ }
385
+ }
386
+
387
+
388
+ return false;
389
+ }
390
+ }
app/code/community/Wexpay/Wexpay/Model/Mysql4/Api/Debug.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ /**
4
+ * Magento Wexpay extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category Mage
14
+ * @package Wexpay_Wexpay
15
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
16
+ * @author ALTIC - http://www.altic.org
17
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
18
+ */
19
+
20
+ class Wexpay_Wexpay_Model_Mysql4_Api_Debug extends Mage_Core_Model_Mysql4_Abstract
21
+ {
22
+ protected function _construct()
23
+ {
24
+ $this->_init('wexpay/api_debug', 'debug_id');
25
+ }
26
+ }
app/code/community/Wexpay/Wexpay/Model/Mysql4/Api/Debug/Collection.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Wexpay extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Wexpay_Wexpay
14
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
15
+ * @author ALTIC - http://www.altic.org
16
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
17
+ */
18
+
19
+ class Wexpay_Wexpay_Model_Mysql4_Api_Debug_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
20
+ {
21
+ protected function _construct()
22
+ {
23
+ $this->_init('wexpay/api_debug');
24
+ }
25
+ }
app/code/community/Wexpay/Wexpay/Model/Mysql4/Setup.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Wexpay extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Wexpay_Wexpay
14
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
15
+ * @author ALTIC - http://www.altic.org
16
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
17
+ */
18
+
19
+ class Wexpay_Wexpay_Model_Mysql4_Setup extends Mage_Sales_Model_Mysql4_Setup
20
+ {
21
+ }
app/code/community/Wexpay/Wexpay/Model/Source/Status.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Wexpay extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Wexpay_Wexpay
14
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
15
+ * @author ALTIC - http://www.altic.org
16
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
17
+ */
18
+
19
+ /**
20
+ * PaymentMethod model
21
+ *
22
+ * @author altic teams
23
+ */
24
+
25
+ class Wexpay_Wexpay_Model_Source_Status
26
+ {
27
+
28
+ public function toOptionArray()
29
+ {
30
+
31
+ return array(
32
+
33
+ array('value' => 'processed_wexpay', 'label' => Mage::helper('wexpay')->__('Processed weXpay'))
34
+ );
35
+
36
+ }
37
+ }
38
+
39
+ ?>
app/code/community/Wexpay/Wexpay/controllers/StandardController.php ADDED
@@ -0,0 +1,335 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Wexpay extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Wexpay_Wexpay
14
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
15
+ * @author ALTIC - http://www.altic.org
16
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
17
+ */
18
+
19
+
20
+ /**
21
+ * Wexpay Standard Checkout Controller
22
+ *
23
+ * @category Mage
24
+ * @package Wexpay_Wexpay
25
+ * @author ALTIC - http://www.altic.org
26
+ */
27
+ class Wexpay_Wexpay_StandardController extends Mage_Core_Controller_Front_Action
28
+ {
29
+
30
+ /**
31
+ * Order instance
32
+ */
33
+ protected $_order;
34
+
35
+ /**
36
+ * Get order
37
+ *
38
+ * @return Mage_Sales_Model_Order
39
+ */
40
+ public function getOrder()
41
+ {
42
+ if ($this->_order == null) {
43
+ }
44
+ return $this->_order;
45
+ }
46
+
47
+ protected function _expireAjax()
48
+ {
49
+ if (!Mage::getSingleton('checkout/session')->getQuote()->hasItems()) {
50
+ $this->getResponse()->setHeader('HTTP/1.1','403 Session Expired');
51
+ exit;
52
+ }
53
+ }
54
+
55
+ /**
56
+ * Get singleton with wexpay strandard order transaction information
57
+ *
58
+ * @return Wexpay_Wexpay_Model_Method_Standard
59
+ */
60
+ public function getStandard()
61
+ {
62
+ return Mage::getSingleton('wexpay/method_standard');
63
+ }
64
+
65
+ /**
66
+ * Transform a order with a cancel status
67
+ * And apply a message in its history
68
+ * @param $msg
69
+ */
70
+ public function cancelOrder($msg)
71
+ {
72
+ $response = null;
73
+
74
+ if ($this->getRequest()->isPost()) {
75
+ $response = $this->getRequest()->getPost();
76
+ }
77
+
78
+ if ($response['ref_order']) {
79
+ $order = Mage::getModel('sales/order')->loadByIncrementId($response['ref_order']);
80
+ if ($order->getId()) {
81
+ $order->cancel();
82
+ $order->addStatusToHistory($order->getStatus(), $this->__($msg));
83
+ $order->save();
84
+ }
85
+ }
86
+
87
+ try{
88
+ $session = Mage::getSingleton('checkout/session');
89
+ $session->setQuoteId($session->getWexpayQuoteId(true));
90
+ }catch (Exception $e){
91
+
92
+ }
93
+ }
94
+
95
+ /**
96
+ * Transform a order with a valid status
97
+ * defined in the configuration panel of the module
98
+ * And apply a message in its history
99
+ * @param $msg
100
+ */
101
+ public function validateOrder($msg)
102
+ {
103
+ $response = null;
104
+
105
+ if ($this->getRequest()->isPost()) {
106
+ $response = $this->getRequest()->getPost();
107
+ }
108
+
109
+ if ($response['ref_order']) {
110
+ $order = Mage::getModel('sales/order')->loadByIncrementId($response['ref_order']);
111
+ if ($order->getId()) {
112
+ $order->addStatusToHistory($order->getStatus(), $this->__($msg));
113
+ $order->save();
114
+ }
115
+ }
116
+ }
117
+
118
+ /**
119
+ * Redirect a customer when chooses Wexpay
120
+ * on Checkout/Payment page
121
+ *
122
+ */
123
+ public function redirectAction()
124
+ {
125
+ $session = Mage::getSingleton('checkout/session');
126
+
127
+ if ($session->getQuote()->getHasError())
128
+ {
129
+ $this->_redirect('checkout/cart');
130
+ } else {
131
+
132
+ if ($session->getQuoteId())
133
+ {
134
+ $session->setWexpayQuoteId($session->getQuoteId());
135
+ }
136
+
137
+ // flag the order as a pending payment
138
+ $lastIncrementId = $session->getLastRealOrderId();
139
+ if ($lastIncrementId) {
140
+ $order = Mage::getModel('sales/order');
141
+ $order->loadByIncrementId($lastIncrementId);
142
+ if ($order->getId()) {
143
+ $order->addStatusToHistory("pending_wexpay", $this->__("Start weXpay Payment"));
144
+ $order->save();
145
+ }
146
+ }
147
+
148
+ $this->getResponse()->setBody($this->getLayout()->createBlock('wexpay/standard_redirect')->toHtml());
149
+
150
+ }
151
+
152
+ }
153
+
154
+ /**
155
+ * When a error or exception payment occurs from Wexpay.
156
+ */
157
+ public function errorAction()
158
+ {
159
+
160
+
161
+ $session = Mage::getSingleton('checkout/session');
162
+
163
+ // cancel order
164
+ $this->cancelOrder('An error occurs from Wexpay');
165
+
166
+ $session->getQuote()->setIsActive(true)->save();
167
+ $session->setQuoteId($session->getWexpayQuoteId());
168
+ $session->setLastQuoteId($session->getWexpayLastQuoteId());
169
+
170
+
171
+ //and then redirect to checkout one page
172
+ $this->_redirect('checkout/cart');
173
+
174
+ //TODO empty cart ??
175
+ //$this->loadLayout();
176
+ //$this->renderLayout();
177
+ //Mage::getSingleton('checkout/session')->unsLastRealOrderId();
178
+ //
179
+
180
+ }
181
+
182
+ /**
183
+ * when wexpay returns
184
+ */
185
+ public function successAction()
186
+ {
187
+
188
+ $session = Mage::getSingleton('checkout/session');
189
+ $session->setQuoteId($session->getWexpayQuoteId());
190
+
191
+ /**
192
+ * set the quote as inactive after back from wexpay
193
+ */
194
+ $session->getQuote()->setIsActive(false)->save();
195
+ $session->setQuoteId($session->getWexpayQuoteId());
196
+ $session->setLastSuccessQuoteId($session->getWexpayLastSuccessQuoteId());
197
+
198
+ $this->validateOrder('User return from Wexpay successfuly');
199
+
200
+ $session->unsQuoteId();
201
+
202
+ $this->_redirect('checkout/onepage/success', array('_secure'=>true));
203
+ }
204
+
205
+ /**
206
+ * when wexpay returns Ref in background
207
+ */
208
+ public function notifyAction()
209
+ {
210
+
211
+ if (!$this->getRequest()->isPost()) {
212
+ $this->_redirect('');
213
+ return;
214
+ }
215
+
216
+ $response = $this->getRequest()->getPost();
217
+
218
+ //validate Ip
219
+ $wxpStd = $this->getStandard();
220
+ if(!$wxpStd->validateIp($_SERVER["REMOTE_ADDR"]))
221
+ {
222
+ // cancel order
223
+ $this->cancelOrder('Remote server not recognized. Access denied.');
224
+ Mage::throwException($this->__('Remote server not recognized. Access denied.'));
225
+ }
226
+
227
+ //validate merchant Id
228
+ if($wxpStd->getMerchantId() != $response["merchant_id"])
229
+ {
230
+ // cancel order
231
+ $this->cancelOrder('Remote server not recognized. Access denied. Merchant Id is not valid.');
232
+ Mage::throwException($this->__('Remote server not recognized. Access denied. Merchant Id is not valid.'));
233
+ }
234
+
235
+ if($wxpStd->getDebugMode()){
236
+ $debug = Mage::getModel('wexpay/api_debug')
237
+ ->setOrderid($response['ref_order'])
238
+ ->setAmount($response['amount'])
239
+ ->setRef_wexpay($response['ref_wexpay'])
240
+ ->setOrderresponse($response['CODEREPONSE'])
241
+ ->save();
242
+ }
243
+
244
+ if(!$wxpStd->validateTransaction($response))
245
+ {
246
+ // cancel order
247
+ $this->cancelOrder('Invalid Wexpay transaction.');
248
+
249
+ $this->getResponse()
250
+ ->setHeader('Content-type', 'text/xml')
251
+ ->setBody("Invalid Wexpay transaction");
252
+
253
+ return;
254
+ }
255
+
256
+ $order = Mage::getModel('sales/order');
257
+ $order->loadByIncrementId($response['ref_order']);
258
+
259
+ $order->addStatusToHistory(
260
+ $wxpStd->getOrderStatus(),
261
+ $this->__('Notification from Wexpay of the success of the transaction')
262
+ . "\n<br>Wexpay Reference:" .$response['ref_wexpay']
263
+ );
264
+
265
+ $order->getPayment()
266
+ ->getMethodInstance()
267
+ ->setTransactionId($response['ref_wexpay']);
268
+
269
+ $order->getPayment()->setWexpay_ref($response['ref_wexpay']);
270
+ //$order->sendNewOrderEmail();
271
+ $order->save();
272
+
273
+ if (!$order->getInvoiceCollection()->getSize()) {
274
+ $invoice = $order->prepareInvoice();
275
+ $invoice->register();
276
+ $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID);
277
+ $invoice->getOrder()->setIsInProcess(true);
278
+
279
+ $transactionSave = Mage::getModel('core/resource_transaction')
280
+ ->addObject($invoice)
281
+ ->addObject($invoice->getOrder())
282
+ ->save();
283
+ $order->sendNewOrderEmail();
284
+ }
285
+
286
+
287
+ $this->getResponse()
288
+ ->setHeader('Content-type', 'text/xml')
289
+ ->setBody($this->__('Notification from Wexpay of the success of the transaction'));
290
+
291
+ //$this->norouteAction();
292
+ return;
293
+
294
+ }
295
+
296
+ /**
297
+ * This for the verification process proposed by Wexpay
298
+ * @return
299
+ * @param string $xmlResponse
300
+ */
301
+ public function validorderAction()
302
+ {
303
+ if ($this->getRequest()->isPost()) {
304
+ $response = $this->getRequest()->getPost();
305
+ } else if ($this->getRequest()->isGet()) {
306
+ $response = $this->getRequest()->getParams();
307
+ }
308
+
309
+ //validate Ip
310
+ $wxpStd = $this->getStandard();
311
+ if(!$wxpStd->validateIp($_SERVER["REMOTE_ADDR"]))
312
+ {
313
+ // cancel order
314
+ Mage::throwException($this->__('[Verification] Remote server not recognized. Access denied.'));
315
+ $this->norouteAction();
316
+ return false;
317
+ }
318
+
319
+ if($wxpStd->validateTransaction($response))
320
+ {
321
+ $this->getResponse()
322
+ ->setHeader('Content-type', 'text/xml')
323
+ ->setBody('CODEREPONSE=0');
324
+ return true;
325
+ }else{
326
+ $this->getResponse()
327
+ ->setHeader('Content-type', 'text/xml')
328
+ ->setBody('CODEREPONSE=1');
329
+ return false;
330
+ }
331
+
332
+
333
+ }
334
+
335
+ }
app/code/community/Wexpay/Wexpay/etc/config.xml ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento Wexpay extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category Mage
14
+ * @package Wexpay_Wexpay
15
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
16
+ * @author ALTIC - http://www.altic.org
17
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
18
+ */
19
+ -->
20
+ <config>
21
+ <modules>
22
+ <Wexpay_Wexpay>
23
+ <version>1.1.0</version>
24
+ </Wexpay_Wexpay>
25
+ </modules>
26
+ <global>
27
+ <models>
28
+ <wexpay>
29
+ <class>Wexpay_Wexpay_Model</class>
30
+ <resourceModel>wexpay_mysql4</resourceModel>
31
+ </wexpay>
32
+ <wexpay_mysql4>
33
+ <class>Wexpay_Wexpay_Model_Mysql4</class>
34
+ <entities>
35
+ <api_debug><table>wexpay_api_debug</table></api_debug>
36
+ </entities>
37
+ </wexpay_mysql4>
38
+ </models>
39
+ <blocks>
40
+ <wexpay><class>Wexpay_Wexpay_Block</class></wexpay>
41
+ </blocks>
42
+ <resources>
43
+ <wexpay_setup>
44
+ <setup>
45
+ <module>Wexpay_Wexpay</module>
46
+ <class>Wexpay_Wexpay_Model_Mysql4_Setup</class>
47
+ </setup>
48
+ <connection>
49
+ <use>core_setup</use>
50
+ </connection>
51
+ </wexpay_setup>
52
+ <wexpay_write>
53
+ <connection>
54
+ <use>core_write</use>
55
+ </connection>
56
+ </wexpay_write>
57
+ <wexpay_read>
58
+ <connection>
59
+ <use>core_read</use>
60
+ </connection>
61
+ </wexpay_read>
62
+ </resources>
63
+ <helpers>
64
+ <wexpay>
65
+ <class>Wexpay_Wexpay_Helper</class>
66
+ </wexpay>
67
+ </helpers>
68
+ <sales>
69
+ <order>
70
+ <statuses>
71
+ <pending_wexpay translate="label"><label>Pending weXpay</label></pending_wexpay>
72
+ <processing_wexpay translate="label"><label>Processing weXpay Payment</label></processing_wexpay>
73
+ <processed_wexpay translate="label"><label>Processed weXpay</label></processed_wexpay>
74
+ </statuses>
75
+ <states>
76
+ <pending_payment>
77
+ <statuses>
78
+ <pending_wexpay/>
79
+ </statuses>
80
+ </pending_payment>
81
+ <processing>
82
+ <statuses>
83
+ <processing_wexpay />
84
+ </statuses>
85
+ </processing>
86
+ </states>
87
+ </order>
88
+ </sales>
89
+ </global>
90
+ <frontend>
91
+ <secure_url>
92
+ <wexpay_standard>/wexpay/standard</wexpay_standard>
93
+ </secure_url>
94
+ <routers>
95
+ <wexpay>
96
+ <use>standard</use>
97
+ <args>
98
+ <module>Wexpay_Wexpay</module>
99
+ <frontName>wexpay</frontName>
100
+ </args>
101
+ </wexpay>
102
+ </routers>
103
+ <translate>
104
+ <modules>
105
+ <Wexpay_Wexpay>
106
+ <files>
107
+ <default>Wexpay_Wexpay.csv</default>
108
+ </files>
109
+ </Wexpay_Wexpay>
110
+ </modules>
111
+ </translate>
112
+ <layout>
113
+ <updates>
114
+ <wexpay>
115
+ <file>wexpay.xml</file>
116
+ </wexpay>
117
+ </updates>
118
+ </layout>
119
+ </frontend>
120
+ <adminhtml>
121
+ <translate>
122
+ <modules>
123
+ <Wexpay_Wexpay>
124
+ <files>
125
+ <default>Wexpay_Wexpay.csv</default>
126
+ </files>
127
+ </Wexpay_Wexpay>
128
+ </modules>
129
+ </translate>
130
+ </adminhtml>
131
+ <default>
132
+ <payment>
133
+ <wexpay_standard>
134
+ <model>wexpay/method_standard</model>
135
+ <title>Wexpay</title>
136
+ <merchant_id></merchant_id>
137
+ <urlReturn></urlReturn>
138
+ <urlError></urlError>
139
+ <urlNotification></urlNotification>
140
+ <urlLogo></urlLogo>
141
+ <allowspecific>0</allowspecific>
142
+ <transaction_type>O</transaction_type>
143
+ <order_status>pending_wexpay</order_status>
144
+ <wexpayIp>213.218.137.226,91.188.68.69,91.188.72.66,91.188.72.67</wexpayIp>
145
+ <wexpayRedirect>https://paiements.wexpay.fr</wexpayRedirect>
146
+ <test>0</test>
147
+ <urlValidTrasaction></urlValidTrasaction>
148
+ <uUrlValidTrasaction></uUrlValidTrasaction>
149
+ <pUrlValidTrasaction></pUrlValidTrasaction>
150
+ </wexpay_standard>
151
+ </payment>
152
+ </default>
153
+ </config>
app/code/community/Wexpay/Wexpay/etc/system.xml ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento Wexpay extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category Mage
14
+ * @package Wexpay_Wexpay
15
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
16
+ * @author ALTIC - http://www.altic.org
17
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
18
+ */
19
+ -->
20
+ <config>
21
+ <sections>
22
+ <payment>
23
+ <groups>
24
+ <wexpay_standard translate="label" module="wexpay">
25
+ <label>Wexpay Payement</label>
26
+ <comment><![CDATA[<a href="http://www.wexpay.com/fr/se_faire_payer_avec_wexpay" target="_blank"><p>weXpay est complémentaire des moyens de paiement par carte bancaire. Aujourd'hui, enfin, l’achat sur Internet comme avec des espèces est désormais possible ! Touchez la clientèle qui vous résiste encore ! </p><p>Ouvrez un compte marchand maintenant !</p></a>]]></comment>
27
+ <frontend_type>text</frontend_type>
28
+ <sort_order>102</sort_order>
29
+ <show_in_default>1</show_in_default>
30
+ <show_in_website>1</show_in_website>
31
+ <show_in_store>1</show_in_store>
32
+ <fields>
33
+ <active translate="label">
34
+ <label>Enabled</label>
35
+ <frontend_type>select</frontend_type>
36
+ <source_model>adminhtml/system_config_source_yesno</source_model>
37
+ <sort_order>1</sort_order>
38
+ <show_in_default>1</show_in_default>
39
+ <show_in_website>1</show_in_website>
40
+ <show_in_store>0</show_in_store>
41
+ </active>
42
+ <title translate="label">
43
+ <label>Title</label>
44
+ <frontend_type>text</frontend_type>
45
+ <sort_order>2</sort_order>
46
+ <show_in_default>1</show_in_default>
47
+ <show_in_website>1</show_in_website>
48
+ <show_in_store>0</show_in_store>
49
+ </title>
50
+ <test translate="label">
51
+ <!-- mode de test -->
52
+ <label>Debug Mode</label>
53
+ <frontend_type>select</frontend_type>
54
+ <source_model>adminhtml/system_config_source_yesno</source_model>
55
+ <sort_order>2</sort_order>
56
+ <show_in_default>1</show_in_default>
57
+ <show_in_website>1</show_in_website>
58
+ <show_in_store>0</show_in_store>
59
+ </test>
60
+ <merchant_id translate="label comment">
61
+ <label>Merchant ID</label>
62
+ <comment>* required</comment>
63
+ <frontend_type>text</frontend_type>
64
+ <sort_order>3</sort_order>
65
+ <show_in_default>1</show_in_default>
66
+ <show_in_website>1</show_in_website>
67
+ <show_in_store>0</show_in_store>
68
+ </merchant_id>
69
+ <urlReturn translate="label comment">
70
+ <label>Return url</label>
71
+ <comment>optional</comment>
72
+ <frontend_type>text</frontend_type>
73
+ <sort_order>4</sort_order>
74
+ <show_in_default>1</show_in_default>
75
+ <show_in_website>1</show_in_website>
76
+ <show_in_store>0</show_in_store>
77
+ </urlReturn>
78
+ <urlError translate="label comment">
79
+ <label>Error url</label>
80
+ <comment>optional</comment>
81
+ <frontend_type>text</frontend_type>
82
+ <sort_order>5</sort_order>
83
+ <show_in_default>1</show_in_default>
84
+ <show_in_website>1</show_in_website>
85
+ <show_in_store>0</show_in_store>
86
+ </urlError>
87
+ <urlNotification translate="label comment">
88
+ <label>Notification url</label>
89
+ <comment>optional</comment>
90
+ <frontend_type>text</frontend_type>
91
+ <sort_order>6</sort_order>
92
+ <show_in_default>1</show_in_default>
93
+ <show_in_website>1</show_in_website>
94
+ <show_in_store>0</show_in_store>
95
+ </urlNotification>
96
+ <order_status translate="label">
97
+ <label>New order status</label>
98
+ <frontend_type>select</frontend_type>
99
+ <source_model>wexpay/source_status</source_model>
100
+ <sort_order>7</sort_order>
101
+ <show_in_default>1</show_in_default>
102
+ <show_in_website>1</show_in_website>
103
+ <show_in_store>0</show_in_store>
104
+ </order_status>
105
+ <uUrlValidTrasaction translate="label comment">
106
+ <label>User xml file validation</label>
107
+ <comment>User of the xml file for validation</comment>
108
+ <frontend_type>text</frontend_type>
109
+ <sort_order>8</sort_order>
110
+ <show_in_default>1</show_in_default>
111
+ <show_in_website>1</show_in_website>
112
+ <show_in_store>0</show_in_store>
113
+ </uUrlValidTrasaction>
114
+ <pUrlValidTrasaction translate="label comment">
115
+ <label>Password xml file validation</label>
116
+ <comment>Password of the xml file for validation</comment>
117
+ <frontend_type>text</frontend_type>
118
+ <sort_order>9</sort_order>
119
+ <show_in_default>1</show_in_default>
120
+ <show_in_website>1</show_in_website>
121
+ <show_in_store>0</show_in_store>
122
+ </pUrlValidTrasaction>
123
+ <urlValidTrasaction translate="label comment">
124
+ <label>Url xml file validation</label>
125
+ <comment>Url of the xml file for validation</comment>
126
+ <frontend_type>text</frontend_type>
127
+ <sort_order>10</sort_order>
128
+ <show_in_default>1</show_in_default>
129
+ <show_in_website>1</show_in_website>
130
+ <show_in_store>0</show_in_store>
131
+ </urlValidTrasaction>
132
+ <wexpayIp translate="label comment">
133
+ <label>IPs des serveurs Wexpay</label>
134
+ <comment>Allowed IPs (comma separated)</comment>
135
+ <frontend_type>text</frontend_type>
136
+ <sort_order>20</sort_order>
137
+ <show_in_default>1</show_in_default>
138
+ <show_in_website>1</show_in_website>
139
+ <show_in_store>0</show_in_store>
140
+ </wexpayIp>
141
+ </fields>
142
+ </wexpay_standard>
143
+ </groups>
144
+ </payment>
145
+ </sections>
146
+ </config>
app/code/community/Wexpay/Wexpay/sql/wexpay_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Wexpay extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Wexpay_Wexpay
14
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
15
+ * @author ALTIC - http://www.altic.org
16
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
17
+ */
18
+
19
+ $installer = $this;
20
+
21
+ /* @var $installer Wexpay_Wexpay_Model_Mysql4_Setup */
22
+
23
+ $installer->startSetup();
24
+ // TODO add run method for debug
25
+ $installer->run("
26
+ CREATE TABLE `{$this->getTable('wexpay_api_debug')}` (
27
+ `debug_id` int(10) unsigned NOT NULL auto_increment,
28
+ `debug_at` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
29
+ `orderid` varchar(25),
30
+ `amount` varchar(15),
31
+ `ref_wexpay` varchar(25),
32
+ `orderresponse` int(2),
33
+ PRIMARY KEY (`debug_id`),
34
+ KEY `debug_at` (`debug_at`)
35
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
36
+ ");
37
+ $installer->endSetup();
38
+
39
+ $installer->addAttribute('order_payment', 'wexpay_ref', array('type' => 'varchar', 'visible' => false, 'required' => false));
app/code/community/Wexpay/Wexpay/sql/wexpay_setup/mysql4-uninstall-0.1.0.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Wexpay extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Wexpay_Wexpay
14
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
15
+ * @author ALTIC - http://www.altic.org
16
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
17
+ */
18
+
19
+ $installer = $this;
20
+
21
+ /* @var $installer Wexpay_Wexpay_Model_Entity_Setup */
22
+
23
+ $installer->startSetup();
24
+
25
+ // TODO add run method for debug
26
+ $installer->run("
27
+ DROP TABLE `{$this->getTable('wexpay_api_debug')}` ;
28
+ ");
29
+
30
+ $installer->endSetup();
31
+
32
+ $installer->removeAttribute('order_payment', 'wexpay_ref');
app/code/community/Wexpay/Wexpay/sql/wexpay_setup/mysql4-upgrade-1.0.0-1.1.0.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Wexpay extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Wexpay_Wexpay
14
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
15
+ * @author ALTIC - http://www.altic.org
16
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
17
+ */
18
+
19
+ $installer = $this;
20
+
21
+ /* @var $installer Wexpay_Wexpay_Model_Mysql4_Setup */
22
+ if($installer->tableExists($installer->getTable('sales_order_status')) && $installer->tableExists($installer->getTable('sales_order_status_state')));
23
+ {
24
+
25
+ $installer->startSetup();
26
+
27
+ $statusTable = $installer->getTable('sales/order_status');
28
+ $statusStateTable = $installer->getTable('sales/order_status_state');
29
+
30
+ //Add statues
31
+ $data = array();
32
+ $data[] = array('status'=>'pending_wexpay','label'=>'Pending weXpay');
33
+ $data[] = array('status'=>'processing_wexpay','label'=>'Processing weXpay Payment');
34
+ $data[] = array('status'=>'processed_wexpay','label'=>'Processed weXpay');
35
+
36
+ $installer->getConnection()->insertArray($statusTable, array('status', 'label'), $data);
37
+
38
+ //Assign status to state
39
+ $data = array();
40
+ $data[] = array('status'=>'pending_wexpay','state'=>'pending_payment','is_default'=>0);
41
+ $data[] = array('status'=>'processing_wexpay','state'=>'processing','is_default'=>0);
42
+
43
+ $installer->getConnection()->insertArray(
44
+ $statusStateTable,
45
+ array('status', 'state', 'is_default'),
46
+ $data
47
+ );
48
+
49
+ $installer->endSetup();
50
+ }
app/design/adminhtml/default/default/template/wexpay/standard/form.phtml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ /**
5
+ * Magento Wexpay extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ *
14
+ * @category Mage
15
+ * @package Mage_Wexpay
16
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
17
+ * @author ALTIC - http://www.altic.org
18
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
19
+ */
20
+
21
+ ?>
22
+ <fieldset class="form-list">
23
+ <?php
24
+ //$_method = $this->getMethod();
25
+ ?>
26
+ <span>
27
+ <?php echo $this->__('You choose the Wexpay Method Payment. So You will be redirect to the Wexpay Payment Page in order to feel your card number.') ?>
28
+ </span>
29
+ <span id="ogone-please-wait" style="display:none;" class="opc-please-wait">
30
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" class="v-middle" alt="" /> &nbsp; <?php echo $this->__('Loading next step...') ?> &nbsp;
31
+ </span>
32
+ </fieldset>
app/design/adminhtml/default/default/template/wexpay/standard/info.phtml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Wexpay extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Wexpay
14
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
15
+ * @author ALTIC - http://www.altic.org
16
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
17
+ */
18
+ //TODO Change the Wexpay Ref number capture
19
+ ?>
20
+ <?php if($_info = $this->getInfo()){ ?>
21
+ <p>
22
+ <strong><?php echo $this->__('Wexpay Payement') ;?></strong>
23
+ <?php
24
+ $pr = $this->getPaymentRefernce();
25
+ if($pr ){
26
+ ?>
27
+ <br/>
28
+ <?php
29
+ echo $pr;
30
+ } ?>
31
+ </p>
32
+ <?php } ?>
app/design/adminhtml/default/default/template/wexpay/standard/pdf/info.phtml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Wexpay extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Wexpay
14
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
15
+ * @author ALTIC - http://www.altic.org
16
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
17
+ */
18
+ ?>
19
+ <?php if($_info = $this->getInfo()){ ?>
20
+ <p>
21
+ <strong><?php echo $this->__('Wexpay Payement') ;?></strong>
22
+ <?php
23
+ $pr = $this->getPaymentRefernce();
24
+ if($pr ){
25
+ ?>
26
+ <br/>
27
+ <?php
28
+ echo $pr;
29
+ } ?>
30
+ </p>
31
+ <?php } ?>
app/design/frontend/default/default/template/wexpay/standard/form.phtml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ /**
5
+ * Magento Wexpay extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ *
14
+ * @category Mage
15
+ * @package Mage_Wexpay
16
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
17
+ * @author ALTIC - http://www.altic.org
18
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
19
+ */
20
+
21
+
22
+ $_code=$this->getMethodCode() ;
23
+
24
+ ?>
25
+ <fieldset class="form-list">
26
+ <div id="payment_form_<?php echo $_code ?>" style="display:none"><img style="border-width: 0px; margin: 3px; float: left;" alt="wexpay logo" src="<?php echo $this->getSkinUrl('images/media/wexpay/logo-wexpay.png') ?>" /><?=$this->__('<strong>WEXPAY LA MONNAIE NUMERIQUE</strong><br/>Pour payer comme en espèces. Accessible à tout le monde sans compte, anonyme, simple, sûr, utilisable pour des paiements à partir du centime d\'euro.<br/>Permet aux internautes de changer leurs espèces (montant de leur choix) contre des codes dans un réseau de points de change (déjà plus de 4000).<br/>Plus d\'impayés ou de VAD pour les sites marchands et les commissions les plus faibles du marché.<br/>WEXPAY est agréé par la Banque de France.')?><span><?php echo $this->__('You choose the Wexpay Method Payment. So You will be redirect to the Wexpay Payment Page in order to feel your card number.') ?></span>
27
+ <span id="wexpay-please-wait" style="display:none;" class="opc-please-wait"><img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" class="v-middle" alt="" /> &nbsp; <?php echo $this->__('Loading next step...') ?> &nbsp;</span>
28
+ <br/>
29
+ </div>
30
+ </fieldset>
app/design/frontend/default/default/template/wexpay/standard/info.phtml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Wexpay extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * @category Mage
13
+ * @package Mage_Wexpay
14
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
15
+ * @author ALTIC - http://www.altic.org
16
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
17
+ */
18
+ ?>
19
+ <?php if($_info = $this->getInfo()): ?>
20
+ <p>
21
+ <strong><?php echo $this->__('Wexpay Payement') ;?></strong>
22
+ <?php
23
+ $pm = $this->getPaymentMethod();
24
+ $pmId = $this->getPaymentTransactionId();
25
+ if($pm ){
26
+ ?>
27
+ <br/>
28
+ <?php if($pmId ){ ?>
29
+ <br/>
30
+ <?php echo $this->__('Wexpay Reference :') ?> <strong><?php echo $pmId ?></strong>
31
+ <?php } ?>
32
+ <?php } ?>
33
+ </p>
34
+ <?php else: ?>
35
+ <?php endif; ?>
app/etc/modules/Wexpay_Wexpay.xml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+ /**
4
+ * Magento Wexpay extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * @category Mage
14
+ * @package Mage_Wexpay
15
+ * @copyright Copyright (c) 2010 WEXPAY - http://www.wexpay.com
16
+ * @author ALTIC - http://www.altic.org
17
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
18
+ */
19
+ -->
20
+ <config>
21
+ <modules>
22
+ <Wexpay_Wexpay>
23
+ <active>true</active>
24
+ <codePool>community</codePool>
25
+ <depends>
26
+ <Mage_Payment/>
27
+ </depends>
28
+ </Wexpay_Wexpay>
29
+ </modules>
30
+ </config>
app/locale/fr_FR/Wexpay_Wexpay.csv ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Wexpay Payement", "weXpay"
2
+ "Wexpay Reference", "Référence weXpay"
3
+ "You will be redirected to Wexpay in a few seconds.", "Vous allez être redirigé vers la page de paiement weXpay dans quelques secondes."
4
+ "Selected currency code ('.$currency_code.') is not compatible with Wexpay", "La devise sélectionnée ('.$currency_code.') est imcompatible avec le paiement weXpay"
5
+ "User return from Wexpay successfuly", "Retour client depuis weXpay avec succès"
6
+ "Remote server not recognized. Access denied.", "Le serveur de paiement n'a pas été reconnu. Accès refusé"
7
+ "Remote server not recognized. Access denied. Merchant Id is not valid.", "Le serveur de paiement n'a pas été reconnu. Accès refusé. L'identifiant du marchant n'est pas valide."
8
+ "Notification from Wexpay of the success of the transaction", "Notification de weXpay : transaction réussie et validé"
9
+ "[Verification] Remote server not recognized. Access denied.", "[Vérification] Le serveur de paiement n'a pas été reconnu. Accès refusé."
10
+ "Card type:", "type de carte :"
11
+ "You choose the Wexpay Method Payment. So You will be redirect to the Wexpay Payment Page in order to feel your card number.", "Vous avez choisi la méthode de paiement weXpay. Vous allez être maintenant redirigé vers la page de paiement de weXpay."
12
+ "Loading next step...", "chargement étape suivante..."
13
+ "<strong>WEXPAY LA MONNAIE NUMERIQUE</strong><br/>Pour payer comme en espèces. Accessible à tout le monde sans compte, anonyme, simple, sûr, utilisable pour des paiements à partir du centime d'euro.<br/>Permet aux internautes de changer leurs espèces (montant de leur choix) contre des codes dans un réseau de points de change (déjà plus de 4000).<br/>Plus d'impayés ou de VAD pour les sites marchands et les commissions les plus faibles du marché.<br/>WEXPAY est agréé par la Banque de France.","<strong>WEXPAY LA MONNAIE NUMERIQUE</strong><br/>Pour payer comme en espèces. Accessible à tout le monde sans compte, anonyme, simple, sûr, utilisable pour des paiements à partir du centime d'euro.<br/>Permet aux internautes de changer leurs espèces (montant de leur choix) contre des codes dans un réseau de points de change (déjà plus de 4000).<br/>Plus d'impayés ou de VAD pour les sites marchands et les commissions les plus faibles du marché.<br/>WEXPAY est agréé par la Banque de France."
14
+
15
+ #Module configuration
16
+ "active","Actif"
17
+ "title","Paiement avec weXpay"
18
+ "Debug Mode","Mode Debug"
19
+ "merchant_id","ID Marchand"
20
+ "Return url","Url de Retour avec succès"
21
+ "Error url","Url de Retour pour erreur"
22
+ "Notification url","Url de Notification"
23
+ "New order status","Statut de Commande"
24
+ "User xml file validation","Utilisateur fichier validation xml"
25
+ "User of the xml file for validation","Nom de l'utilisateur du fichier xml de validation"
26
+ "Password xml file validation","Mot de passe fichier validation xml"
27
+ "Password of the xml file for validation","Mot de passe de l'utilisateur du fichier xml de validation"
28
+ "Url xml file validation","Url fichier xml de validation"
29
+ "Url of the xml file for validation","Adresse url du fichier xml de validation"
30
+
31
+ "Pending weXpay","En Attente de weXpay"
32
+ "Processing weXpay Payment","En cours de traitement weXpay"
33
+ "Processed weXpay","Paiement Traité par weXpay"
34
+
35
+ "* required","* requis"
36
+ "optional","optionnel"
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Wexpay_Wexpay</name>
4
+ <version>1.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Pour utiliser weXpay comme moyen de paiement sur votre boutique Magento</summary>
10
+ <description>L'extension est enti&#xE8;rement configurable et s'active en un simple click.&#xD;
11
+ &#xD;
12
+ Contactez nous sur http://www.wexpay.com afin d'accepter les paiements weXpay sur votre site.</description>
13
+ <notes>Check on multiple Ips from wexpay server.</notes>
14
+ <authors><author><name>Wexpay</name><user>Wex_pay</user><email>wexpay@gmail.com</email></author></authors>
15
+ <date>2011-08-17</date>
16
+ <time>20:58:08</time>
17
+ <contents><target name="magecommunity"><dir name="Wexpay"><dir name="Wexpay"><dir><dir name="Block"><dir name="Standard"><file name="Form.php" hash="fae7c9a0d0295f8a7f2b559a7a07f703"/><file name="Info.php" hash="9d996663b03c2e8e9a5f689897169e0d"/><file name="Redirect.php" hash="c4cbfaa600c867d84ff6d725e7a5542e"/></dir></dir><dir name="Helper"><file name="Data.php" hash="fa904d556c7f7f6be4c18963e6652399"/></dir><dir name="Model"><dir name="Api"><file name="Debug.php" hash="d01ade680366f53a05abbff3beed7947"/></dir><dir name="Method"><file name="Standard.php" hash="f5a2492f6a678e80c647dd070756e93e"/></dir><dir name="Mysql4"><dir name="Api"><dir name="Debug"><file name="Collection.php" hash="c1ebc6b1ec7b631af170b28a2b9dc696"/></dir><file name="Debug.php" hash="9784db841c22862ca2726845c102e4b6"/></dir><file name="Setup.php" hash="1da81db7349b2f3d315f006a382c405e"/></dir><dir name="Source"><file name="Status.php" hash="898afc0680d0780f2ec3aed41555375d"/></dir></dir><dir name="controllers"><file name="StandardController.php" hash="dc0a9c7d4ad31dd003115025b032ac7d"/></dir><dir name="etc"><file name="config.xml" hash="ae965be6ff704f015be6b7574c2601b6"/><file name="system.xml" hash="adde053d0e7c947b8b4b0e2ddd2f713d"/></dir><dir name="sql"><dir name="wexpay_setup"><file name="mysql4-install-0.1.0.php" hash="18944757abfcfa2b99a30fa4ce1ab5d3"/><file name="mysql4-uninstall-0.1.0.php" hash="b185234d1df384c9e485ad24ffcb2031"/><file name="mysql4-upgrade-1.0.0-1.1.0.php" hash="5e469676474036a5b5ef6d142e15812c"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="wexpay"><dir name="standard"><file name="form.phtml" hash="d032d661bf608fb4598e4757d7cb8b96"/><file name="info.phtml" hash="c4e5bba1e3b5e92efb02c5fc1e55ddb4"/><dir name="pdf"><file name="info.phtml" hash="526afe53bec7e142a0600d9cdf33899b"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="wexpay"><dir name="standard"><file name="form.phtml" hash="8fe34ad9c71342a55c13e91b8afac55b"/><file name="info.phtml" hash="45c4302f043d4270ccdc4f7892e88126"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="fr_FR"><file name="Wexpay_Wexpay.csv" hash="6fd5159b5e11b7d486fc5c4886f22790"/></dir></target><target name="mageetc"><dir name="modules"><file name="Wexpay_Wexpay.xml" hash="edcfda6c0e49382072b78832bd9e16e4"/></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies><required><php><min>5.2.0</min><max>5.3.0</max></php></required></dependencies>
20
+ </package>