F500_Xibpayments - Version 1.0.1

Version Notes

Stabe release

Download this release

Release Info

Developer Magento Core Team
Extension F500_Xibpayments
Version 1.0.1
Comparing to
See all releases


Version 1.0.1

app/code/local/F500/Xibpayments/Block/Form.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Xib|payments 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 F500
13
+ * @package F500_Xibpayments
14
+ * @author Ramon de la Fuente, <ramon@future500.nl>
15
+ * @copyright Copyright (c) 2009 Future500 BV, the Netherlands
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class F500_Xibpayments_Block_Form extends Mage_Payment_Block_Form
20
+ {
21
+ protected function _construct()
22
+ {
23
+ $this->setTemplate('xibpayments/form.phtml');
24
+ parent::_construct();
25
+ }
26
+ }
app/code/local/F500/Xibpayments/Block/Redirect.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Xib|payments 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 F500
13
+ * @package F500_Xibpayments
14
+ * @author Ramon de la Fuente, <ramon@future500.nl>
15
+ * @copyright Copyright (c) 2009 Future500 BV, the Netherlands
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class F500_Xibpayments_Block_Redirect extends Mage_Core_Block_Abstract
20
+ {
21
+ protected function _toHtml()
22
+ {
23
+ $standard = Mage::getModel('xibpayments/standard');
24
+
25
+ $form = new Varien_Data_Form();
26
+ $form->setAction($standard->getXibpaymentsUrl())
27
+ ->setId('xibpayments_checkout')
28
+ ->setName('xibpayments_checkout')
29
+ ->setMethod('POST')
30
+ ->setUseContainer(true);
31
+ foreach ($standard->getCheckoutFormFields() as $field=>$value) {
32
+ $form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value));
33
+ }
34
+ $html = '<html><body>';
35
+ $html.= $this->__('You will be redirected to Xib|payments, our payment processor.');
36
+ $html.= $form->toHtml();
37
+ $html.= '<script type="text/javascript">document.getElementById("xibpayments_checkout").submit();</script>';
38
+ $html.= '</body></html>';
39
+
40
+ return $html;
41
+ }
42
+ }
app/code/local/F500/Xibpayments/Helper/Data.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Xib|payments 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 F500
13
+ * @package F500_Xibpayments
14
+ * @author Ramon de la Fuente, <ramon@future500.nl>
15
+ * @copyright Copyright (c) 2009 Future500 BV, the Netherlands
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class F500_Xibpayments_Helper_Data extends Mage_Core_Helper_Abstract
20
+ {
21
+
22
+ }
app/code/local/F500/Xibpayments/Model/Mysql4/Setup.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Xib|payments 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 F500
13
+ * @package F500_Xibpayments
14
+ * @author Ramon de la Fuente, <ramon@future500.nl>
15
+ * @copyright Copyright (c) 2009 Future500 BV, the Netherlands
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class F500_Xibpayments_Model_Mysql4_Setup extends Mage_Sales_Model_Mysql4_Setup
20
+ {
21
+ }
app/code/local/F500/Xibpayments/Model/Session.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Xib|payments 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 F500
13
+ * @package F500_Xibpayments
14
+ * @author Ramon de la Fuente, <ramon@future500.nl>
15
+ * @copyright Copyright (c) 2009 Future500 BV, the Netherlands
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class F500_Xibpayments_Model_Session extends Mage_Core_Model_Session_Abstract
20
+ {
21
+ public function __construct()
22
+ {
23
+ $this->init('xibpayments');
24
+ }
25
+ }
app/code/local/F500/Xibpayments/Model/Standard.php ADDED
@@ -0,0 +1,342 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Xib|payments 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 F500
13
+ * @package F500_Xibpayments
14
+ * @author Ramon de la Fuente, <ramon@future500.nl>
15
+ * @copyright Copyright (c) 2009 Future500 BV, the Netherlands
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class F500_Xibpayments_Model_Standard extends Mage_Payment_Model_Method_Abstract
20
+ {
21
+ protected $_code = 'xibpayments';
22
+ protected $_formBlockType = 'xibpayments/form';
23
+ protected $_allowCurrencyCode = array('EUR','USD');
24
+
25
+ /**
26
+ * Local testing or Live URL
27
+ */
28
+ // protected $_url_v1='http://cardgateplus.loc/secure/';
29
+ // protected $_url_v1='https://www.cardgateplus.com/secure/';
30
+ protected $_url_v2='https://gateway.cardgateplus.com/secure/';
31
+
32
+
33
+ /**
34
+ * Availability options
35
+ */
36
+ protected $_isGateway = true;
37
+ protected $_canAuthorize = true;
38
+ protected $_canCapture = true;
39
+ protected $_canCapturePartial = false;
40
+ protected $_canRefund = false;
41
+ protected $_canVoid = false;
42
+ protected $_canUseInternal = false;
43
+ protected $_canUseCheckout = true;
44
+ protected $_canUseForMultishipping = false;
45
+
46
+
47
+ /**
48
+ * Get xibpayments session namespace
49
+ *
50
+ * @return F500_Xibayments_Model_Session
51
+ */
52
+ public function getSession()
53
+ {
54
+ return Mage::getSingleton('xibpayments/session');
55
+ }
56
+
57
+ /**
58
+ * Get checkout session namespace
59
+ *
60
+ * @return Mage_Checkout_Model_Session
61
+ */
62
+ public function getCheckout()
63
+ {
64
+ return Mage::getSingleton('checkout/session');
65
+ }
66
+
67
+ /**
68
+ * Get current quote
69
+ *
70
+ * @return Mage_Sales_Model_Quote
71
+ */
72
+ public function getQuote()
73
+ {
74
+ return $this->getCheckout()->getQuote();
75
+ }
76
+
77
+ /*validate the currency code is avaialable to use for xibpayments or not*/
78
+ public function validate()
79
+ {
80
+ parent::validate();
81
+ $currency_code = $this->getQuote()->getBaseCurrencyCode();
82
+ if (!in_array($currency_code,$this->_allowCurrencyCode)) {
83
+ $this->debugLog('Unacceptable currency code ('.$currency_code.').');
84
+ Mage::throwException(Mage::helper('xibpayments')->__('Selected currency code ') . $currency_code . Mage::helper('xibpayments')->__(' is not compatible with Xib|payments'));
85
+ }
86
+ return $this;
87
+ }
88
+
89
+ public function getOrderPlaceRedirectUrl()
90
+ {
91
+ return Mage::getUrl('xibpayments/secure/redirect', array('_secure' => true));
92
+ }
93
+
94
+ public function isTest()
95
+ {
96
+ if ( $this->getConfigData('transaction_type') == 'T' ) {
97
+ return true;
98
+ }
99
+ return false;
100
+ }
101
+
102
+ public function isDebug()
103
+ {
104
+ if ( $this->getConfigData('transaction_type') == 'D' ) {
105
+ return true;
106
+ }
107
+ return false;
108
+ }
109
+
110
+ public function debugLog($msg) {
111
+ if ( $this->isDebug() ) {
112
+ Mage::log($msg,null,$this->getConfigData('debug_log'));
113
+ }
114
+ }
115
+
116
+ public function getCheckoutFormFields()
117
+ {
118
+
119
+ if ($this->getQuote()->getIsVirtual()) {
120
+ $a = $this->getQuote()->getBillingAddress();
121
+ $b = $this->getQuote()->getShippingAddress();
122
+ } else {
123
+ $a = $this->getQuote()->getShippingAddress();
124
+ $b = $this->getQuote()->getBillingAddress();
125
+ }
126
+
127
+
128
+ //check if site_id and control_url are not empty
129
+ //getQuoteCurrencyCode
130
+ $currency_code = $this->getQuote()->getBaseCurrencyCode();
131
+ $sArr = array(
132
+ 'siteid' => $this->getConfigData('site_id'),
133
+ 'ref' => $this->getCheckout()->getLastRealOrderId(),
134
+ 'first_name' => $a->getFirstname(),
135
+ 'last_name' => $a->getLastname(),
136
+ 'email' => $a->getQuote()->getCustomer()->getEmail(),
137
+ 'address' => $a->getStreet(1).( $a->getStreet(2) ? ', '.$a->getStreet(2) : ''),
138
+ 'city' => $a->getCity(),
139
+ 'country_code' => $a->getCountry(),
140
+ 'postal_code' => $a->getPostcode(),
141
+ 'phone_number' => $a->getTelephone(),
142
+ 'option' => $this->getConfigData('options'),
143
+ 'currency' => $currency_code
144
+ );
145
+
146
+ if ( $this->isTest() || $this->isDebug() ) {
147
+ $sArr = array_merge($sArr, array(
148
+ 'test' => '1'
149
+ ));
150
+
151
+ if ( $this->isDebug() ) {
152
+ $sArr = array_merge($sArr, array(
153
+ 'debug' => '1'
154
+ ));
155
+ }
156
+ }
157
+
158
+ $amount = ($a->getBaseSubtotal()+$b->getBaseSubtotal())-($a->getBaseDiscountAmount()+$b->getBaseDiscountAmount());
159
+ $grandTotalCents = sprintf('%.0f', $a->getGrandTotal()*100);
160
+ $sArr = array_merge($sArr, array(
161
+ 'description' => str_replace('%id%',$this->getCheckout()->getLastRealOrderId(),$this->getConfigData('order_description')),
162
+ 'amount' => $grandTotalCents,
163
+ 'hash' => md5($this->getConfigData('site_id') . $grandTotalCents . $sArr['ref'] . $this->getConfigData('password_key'))
164
+ ));
165
+
166
+
167
+ $rArr = array();
168
+ foreach ($sArr as $k=>$v) {
169
+ /*
170
+ replacing & char with and. otherwise it will break the post
171
+ */
172
+ $value = str_replace("&","and",$v);
173
+ $rArr[$k] = $value;
174
+ }
175
+
176
+ $this->debugLog('Sending customer to Xib|payments with values:');
177
+ $this->debugLog('URL = ' . $this->getXibpaymentsUrl() );
178
+ $this->debugLog($rArr);
179
+
180
+ return $rArr;
181
+ }
182
+
183
+ public function getXibpaymentsUrl()
184
+ {
185
+ /*
186
+ // No version select in Xib|payments
187
+
188
+ if ( $this->getConfigData('gateway_version') == 2 ) {
189
+ $url = $this->_url_v2;
190
+ } else {
191
+ $url = $this->_url_v1;
192
+ }
193
+ */
194
+
195
+ return $this->_url_v2;
196
+ }
197
+
198
+
199
+ public function processCallback()
200
+ {
201
+ $id = $this->getCallbackData('ref');
202
+ $order = Mage::getModel('sales/order');
203
+ $order->loadByIncrementId($id);
204
+
205
+ $this->debugLog($this->getCallbackData());
206
+
207
+ /**
208
+ * 200 Transaction successful
209
+ * 300 Transaction failed
210
+ * 301 Transaction failed by fraud check
211
+ */
212
+
213
+ if (!$order->getId()) {
214
+ /**
215
+ * need to have logic when there is no order with the order id from xibpayments?
216
+ * probably a Mage::Exception?
217
+ */
218
+ $this->debugLog('No OrderID found with ID: ' . $id);
219
+
220
+ } else {
221
+
222
+ $amountInCents = (string) ($order->getBaseGrandTotal() * 100);
223
+ $callbackAmount = (string) ($this->getCallbackData('amount'));
224
+
225
+ if ( $amountInCents != $callbackAmount ) {
226
+
227
+ $this->debugLog('Order amounts do not match. Sent ' . $amountInCents . ', Received: ' . $callbackAmount);
228
+
229
+ $order->addStatusToHistory(
230
+ $order->getStatus(),
231
+ Mage::helper('xibpayments')->__('Order total amount does not match Xib|payments gross total amount')
232
+ );
233
+ $order->save();
234
+
235
+ } else {
236
+ if ($this->getCallbackData('status') == '200') { //success
237
+
238
+ if (!$order->canInvoice()) {
239
+ $this->debugLog('Unable to create invoice');
240
+
241
+ //when order cannot create invoice, need to have some logic to take care
242
+ $order->addStatusToHistory(
243
+ $order->getStatus(), // keep order status/state
244
+ Mage::helper('xibpayments')->__('Error in creating an invoice', true),
245
+ false
246
+ );
247
+ } else {
248
+ if ( Mage::getStoreConfig('payment/xibpayments/order_status_paid_createinvoice') == 1 ) {
249
+ $this->debugLog('Creating invoice');
250
+
251
+ //need to convert from order into invoice
252
+ $invoice = $order->prepareInvoice();
253
+ $invoice->register()->capture();
254
+ $invoice->sendEmail();
255
+
256
+ Mage::getModel('core/resource_transaction')
257
+ ->addObject($invoice)
258
+ ->addObject($invoice->getOrder())
259
+ ->save();
260
+
261
+ $invoice_message = Mage::helper('xibpayments')->__('Invoice #%s created', $invoice->getIncrementId());
262
+ } else {
263
+ $this->debugLog('Skip Creating invoice (setting in backend)');
264
+
265
+ $invoice_message = Mage::helper('xibpayments')->__('Invoice not created');
266
+ }
267
+ }
268
+
269
+ $this->debugLog('Status 200 received, saving order');
270
+
271
+ $comment = Mage::helper('xibpayments')->__('Xibpayments Customer Information:')
272
+ . "\n<br>Order Id: " . $this->getCallbackData('ref')
273
+ . "\n<br>isTest: " . $this->getCallbackData('is_test')
274
+ . "\n<br>Transaction Id: " . $this->getCallbackData('transactionid')
275
+ . "\n<br>Status: " . $this->getCallbackData('status')
276
+ . "\n<br>Transaction Cost: " . $this->getCallbackData('transaction_cost')
277
+ . "\n<br>"
278
+ . "\n<br>Customer Firstname: " .$this->getCallbackData('customer_firstname')
279
+ . "\n<br>Customer Lastname: " . $this->getCallbackData('customer_lastname')
280
+ . "\n<br>Customer Address: " . $this->getCallbackData('customer_address')
281
+ . "\n<br>Customer City: " . $this->getCallbackData('customer_city')
282
+ . "\n<br>Customer Zipcode: " . $this->getCallbackData('customer_zipcode')
283
+ . "\n<br>Customer Country: " . $this->getCallbackData('customer_countrycode')
284
+ . "\n<br>Customer Phone: " . $this->getCallbackData('customer_phonenumber')
285
+ . "\n<br>Customer Email: " . $this->getCallbackData('customer_email')
286
+ . "\n<br>Customer Ip: " . $this->getCallbackData('customer_ip_address');
287
+
288
+ $order->addStatusToHistory(
289
+ $order->getStatus(),
290
+ $comment,
291
+ false
292
+ )->save();
293
+
294
+
295
+ $order->setState(
296
+ Mage::getStoreConfig('payment/xibpayments/order_status_paid'),
297
+ true,
298
+ $invoice_message,
299
+ true
300
+ );
301
+
302
+ $order->save();
303
+ $order->sendNewOrderEmail();
304
+ $this->debugLog('Finished saving order.');
305
+
306
+ } else {
307
+
308
+ // Status other than 200 received; this can happen multuiple times.
309
+ // Do not set the order to cancelled here, but wait for the customer
310
+ // to return to the 'cancel' URL
311
+
312
+ $this->debugLog('Status 300 callback received');
313
+
314
+ $comment = Mage::helper('xibpayments')->__('Xib|payments Error Received:')
315
+ . "\n<br>isTest: " . $this->getCallbackData('is_test')
316
+ . "\n<br>Status: " . $this->getCallbackData('status')
317
+ . "\n<br>Error: " . $this->getCallbackData('errordescription') . '('.$this->getCallbackData('errorcode').')';
318
+
319
+ $order->addStatusToHistory(
320
+ $order->getStatus(),
321
+ $comment,
322
+ false
323
+ )->save();
324
+
325
+ }
326
+ }
327
+ }
328
+ }
329
+
330
+ public function isInitializeNeeded()
331
+ {
332
+ return true;
333
+ }
334
+
335
+ public function initialize($paymentAction, $stateObject)
336
+ {
337
+ $state = Mage_Sales_Model_Order::STATE_NEW;
338
+ $stateObject->setState($state);
339
+ $stateObject->setStatus(Mage::getSingleton('sales/order_config')->getStateDefaultStatus($state));
340
+ $stateObject->setIsNotified(false);
341
+ }
342
+ }
app/code/local/F500/Xibpayments/Model/System/Gatewayversion.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Xib|payments 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 F500
13
+ * @package F500_Xibpayments
14
+ * @author Ramon de la Fuente, <ramon@future500.nl>
15
+ * @copyright Copyright (c) 2009 Future500 BV, the Netherlands
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class F500_Xibpayments_Model_System_Gatewayversion
20
+ {
21
+ public function toOptionArray()
22
+ {
23
+ return array(
24
+ array('value'=>'1', 'label'=>Mage::helper('xibpayments')->__('V1')),
25
+ array('value'=>'2', 'label'=>Mage::helper('xibpayments')->__('V2')),
26
+ );
27
+ }
28
+ }
app/code/local/F500/Xibpayments/Model/System/Paymentoptions.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Xib|payments 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 F500
13
+ * @package F500_Xibpayments
14
+ * @author Ramon de la Fuente, <ramon@future500.nl>
15
+ * @copyright Copyright (c) 2009 Future500 BV, the Netherlands
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class F500_Xibpayments_Model_System_Paymentoptions
20
+ {
21
+ public function toOptionArray()
22
+ {
23
+ return array(
24
+ array('value'=>'', 'label'=>Mage::helper('xibpayments')->__('All')),
25
+ array('value'=>'creditcard', 'label'=>Mage::helper('xibpayments')->__('creditcard')),
26
+ array('value'=>'ideal', 'label'=>Mage::helper('xibpayments')->__('ideal')),
27
+ array('value'=>'paypal', 'label'=>Mage::helper('xibpayments')->__('paypal')),
28
+ );
29
+ }
30
+ }
app/code/local/F500/Xibpayments/Model/System/Transactiontype.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Xib|payments 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 F500
13
+ * @package F500_Xibpayments
14
+ * @author Ramon de la Fuente, <ramon@future500.nl>
15
+ * @copyright Copyright (c) 2009 Future500 BV, the Netherlands
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class F500_Xibpayments_Model_System_Transactiontype
20
+ {
21
+ public function toOptionArray()
22
+ {
23
+ return array(
24
+ array('value'=>'L', 'label'=>Mage::helper('xibpayments')->__('Live')),
25
+ array('value'=>'T', 'label'=>Mage::helper('xibpayments')->__('Test')),
26
+ array('value'=>'D', 'label'=>Mage::helper('xibpayments')->__('Debug'))
27
+ );
28
+ }
29
+ }
app/code/local/F500/Xibpayments/controllers/SecureController.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Xib|payments 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 F500
13
+ * @package F500_Xibpayments
14
+ * @author Ramon de la Fuente, <ramon@future500.nl>
15
+ * @copyright Copyright (c) 2009 Future500 BV, the Netherlands
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ class F500_Xibpayments_SecureController extends Mage_Core_Controller_Front_Action
20
+ {
21
+ /**
22
+ * Valid callback IP's
23
+ */
24
+ protected $valid_ips = array(
25
+ '213.207.89.161',
26
+ '213.207.89.162',
27
+ '213.207.89.163',
28
+ '213.207.89.164',
29
+ '213.207.89.165',
30
+ '213.207.89.166',
31
+ '127.0.0.1'
32
+ );
33
+
34
+ /**
35
+ * Order instance
36
+ */
37
+ protected $_order;
38
+
39
+ /**
40
+ * Get order
41
+ *
42
+ * @param none
43
+ * @return Mage_Sales_Model_Order
44
+ */
45
+ public function getOrder()
46
+ {
47
+ if ($this->_order == null) {
48
+ }
49
+ return $this->_order;
50
+ }
51
+
52
+ protected function _expireAjax()
53
+ {
54
+ if (!Mage::getSingleton('checkout/session')->getQuote()->hasItems()) {
55
+ $this->getResponse()->setHeader('HTTP/1.1','403 Session Expired');
56
+ exit;
57
+ }
58
+ }
59
+
60
+ /**
61
+ * Get singleton with Xibpayments standard order transaction information
62
+ *
63
+ * @return Mage_Xibpayments_Model_Standard
64
+ */
65
+ public function getStandard()
66
+ {
67
+ return Mage::getSingleton('xibpayments/standard');
68
+ }
69
+
70
+ /**
71
+ * When a customer chooses Xibpayments on Checkout/Payment page
72
+ *
73
+ */
74
+ public function redirectAction()
75
+ {
76
+ $session = Mage::getSingleton('checkout/session');
77
+ $session->setXibpaymentsStandardQuoteId($session->getQuoteId());
78
+ $this->getResponse()->setBody($this->getLayout()->createBlock('xibpayments/redirect')->toHtml());
79
+ $session->unsQuoteId();
80
+ }
81
+
82
+ /**
83
+ * When a customer cancel payment from Xibpayments.
84
+ */
85
+ public function cancelAction()
86
+ {
87
+ $session = Mage::getSingleton('xibpayments/session');
88
+ $session->setQuoteId($session->getXibpaymentsStandardQuoteId(true));
89
+
90
+ // cancel order
91
+ if ($session->getLastRealOrderId()) {
92
+ $order = Mage::getModel('sales/order')->loadByIncrementId($session->getLastRealOrderId());
93
+ if ($order->getId()) {
94
+ $order->cancel()->save();
95
+ }
96
+ }
97
+
98
+ //redirect to checkout one page
99
+ $this->_redirect('checkout/cart');
100
+ }
101
+
102
+ /**
103
+ * Customer returns from Xibpayments
104
+ * The order information at this point is in POST variables.
105
+ */
106
+ public function successAction()
107
+ {
108
+ $session = Mage::getSingleton('checkout/session');
109
+ $session->setQuoteId($session->getXibpaymentsStandardQuoteId(true));
110
+ /**
111
+ * set the quote as inactive after back from Xibpayments
112
+ */
113
+ Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();
114
+
115
+ $this->_redirect('checkout/onepage/success', array('_secure'=>true));
116
+ }
117
+
118
+ /**
119
+ * Xibpayments Callback: control_url
120
+ * cannot have any output here
121
+ */
122
+ public function controlAction()
123
+ {
124
+ /**
125
+ * Defend agains callbacks from illegal IP's?
126
+ */
127
+
128
+ if ( !$this->_request->isPost() || !in_array($this->_request->getServer('REMOTE_ADDR'),$this->valid_ips) ) {
129
+
130
+ throw new Zend_Exception('Improper use of xibpayments control url');
131
+ exit(0);
132
+ }
133
+
134
+ $this->getStandard()->setCallbackData($this->getRequest()->getPost());
135
+ $this->getStandard()->processCallback();
136
+ }
137
+ }
app/code/local/F500/Xibpayments/etc/config.xml ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento Xib|payments Payment 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 F500
14
+ * @package F500_Xibpayments
15
+ * @author Ramon de la Fuente, <ramon@future500.nl>
16
+ * @copyright Copyright (c) 2009 Future500 BV, the Netherlands
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <config>
21
+ <modules>
22
+ <F500_Xibpayments>
23
+ <version>1.0.1</version>
24
+ </F500_Xibpayments>
25
+ </modules>
26
+ <global>
27
+ <models>
28
+ <xibpayments>
29
+ <class>F500_Xibpayments_Model</class>
30
+ </xibpayments>
31
+ </models>
32
+ <helpers>
33
+ <xibpayments>
34
+ <class>F500_Xibpayments_Helper</class>
35
+ </xibpayments>
36
+ </helpers>
37
+ <resources>
38
+ <xibpayments_setup>
39
+ <setup>
40
+ <module>F500_Xibpayments</module>
41
+ <class>F500_Xibpayments_Model_Mysql4_Setup</class>
42
+ </setup>
43
+ <connection>
44
+ <use>core_setup</use>
45
+ </connection>
46
+ </xibpayments_setup>
47
+ <xibpayments_write>
48
+ <connection>
49
+ <use>core_write</use>
50
+ </connection>
51
+ </xibpayments_write>
52
+ <xibpayments_read>
53
+ <connection>
54
+ <use>core_read</use>
55
+ </connection>
56
+ </xibpayments_read>
57
+ </resources>
58
+ <blocks>
59
+ <xibpayments><class>F500_Xibpayments_Block</class></xibpayments>
60
+ </blocks>
61
+ </global>
62
+
63
+ <frontend>
64
+ <secure_url>
65
+ <xibpayments>/xibpayments</xibpayments>
66
+ </secure_url>
67
+ <routers>
68
+ <xibpayments>
69
+ <use>standard</use>
70
+ <args>
71
+ <module>F500_Xibpayments</module>
72
+ <frontName>xibpayments</frontName>
73
+ </args>
74
+ </xibpayments>
75
+ </routers>
76
+ <translate>
77
+ <modules>
78
+ <F500_Xibpayments>
79
+ <files>
80
+ <default>F500_Xibpayments.csv</default>
81
+ </files>
82
+ </F500_Xibpayments>
83
+ </modules>
84
+ </translate>
85
+ </frontend>
86
+
87
+ <adminhtml>
88
+ <translate>
89
+ <modules>
90
+ <F500_Xibpayments>
91
+ <files>
92
+ <default>F500_Xibpayments.csv</default>
93
+ </files>
94
+ </F500_Xibpayments>
95
+ </modules>
96
+ </translate>
97
+ <acl>
98
+ <resources>
99
+ <admin>
100
+ <children>
101
+ <system>
102
+ <children>
103
+ <config>
104
+ <children>
105
+ <xibpayments>
106
+ <title>Xib|payments Section</title>
107
+ </xibpayments>
108
+ </children>
109
+ </config>
110
+ </children>
111
+ </system>
112
+ </children>
113
+ </admin>
114
+ </resources>
115
+ </acl>
116
+ </adminhtml>
117
+
118
+ <default>
119
+ <payment>
120
+ <xibpayments>
121
+ <model>xibpayments/standard</model>
122
+ <title>Xib|payments System</title>
123
+ <transaction_type>T</transaction_type>
124
+ <order_status>Pending</order_status>
125
+ <order_status_paid>Processing</order_status_paid>
126
+ <order_status_paid_createinvoice>1</order_status_paid_createinvoice>
127
+ <order_status_failed>Cancelled</order_status_failed>
128
+ <order_description>order %id%</order_description>
129
+ <debug_log>xibpayments.log</debug_log>
130
+ </xibpayments>
131
+ </payment>
132
+ </default>
133
+ </config>
app/code/local/F500/Xibpayments/etc/system.xml ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento Xib|payments Payment 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 F500
14
+ * @package F500_Xibpayments
15
+ * @author Ramon de la Fuente, <ramon@future500.nl>
16
+ * @copyright Copyright (c) 2009 Future500 BV, the Netherlands
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ -->
20
+ <config>
21
+ <sections>
22
+ <payment>
23
+ <groups>
24
+ <xibpayments translate="label" module="xibpayments">
25
+ <label>Xib|payments</label>
26
+ <frontend_type>text</frontend_type>
27
+ <sort_order>0</sort_order>
28
+ <show_in_default>1</show_in_default>
29
+ <show_in_website>1</show_in_website>
30
+ <show_in_store>1</show_in_store>
31
+ <fields>
32
+ <active translate="label">
33
+ <label>Enabled</label>
34
+ <frontend_type>select</frontend_type>
35
+ <comment><![CDATA[<a href="https://www.xibpayments.com/" target="_blank">Apply for an account</a>]]></comment>
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>1</show_in_store>
41
+ </active>
42
+ <title translate="label">
43
+ <label>Title</label>
44
+ <frontend_type>text</frontend_type>
45
+ <comment>Text shown in the checkout screen</comment>
46
+ <sort_order>2</sort_order>
47
+ <show_in_default>1</show_in_default>
48
+ <show_in_website>1</show_in_website>
49
+ <show_in_store>1</show_in_store>
50
+ </title>
51
+ <!-- <gateway_version translate="label">
52
+ <label>Version</label>
53
+ <frontend_type>select</frontend_type>
54
+ <comment>Gateway version</comment>
55
+ <source_model>xibpayments/system_gatewayversion</source_model>
56
+ <sort_order>9</sort_order>
57
+ <show_in_default>1</show_in_default>
58
+ <show_in_website>1</show_in_website>
59
+ <show_in_store>1</show_in_store>
60
+ </gateway_version> -->
61
+ <transaction_type translate="label">
62
+ <label>Modus</label>
63
+ <frontend_type>select</frontend_type>
64
+ <comment>Live, Test or Debug mode (debug writes a log, see 'Debug Log' setting below)</comment>
65
+ <source_model>xibpayments/system_transactiontype</source_model>
66
+ <sort_order>10</sort_order>
67
+ <show_in_default>1</show_in_default>
68
+ <show_in_website>0</show_in_website>
69
+ <show_in_store>0</show_in_store>
70
+ </transaction_type>
71
+ <site_id translate="label">
72
+ <label>Site Id</label>
73
+ <frontend_type>text</frontend_type>
74
+ <comment><![CDATA[Site ID from your account at <a href="https://merchants.xibpayments.com/" target="_blank">Xib|payments</a>]]></comment>
75
+ <sort_order>11</sort_order>
76
+ <show_in_default>1</show_in_default>
77
+ <show_in_website>1</show_in_website>
78
+ <show_in_store>1</show_in_store>
79
+ </site_id>
80
+ <password_key translate="label">
81
+ <label>Password Key</label>
82
+ <frontend_type>text</frontend_type>
83
+ <comment><![CDATA[Password entered in the backend at <a href="https://merchants.xibpayments.com/" target="_blank">Xib|payments</a>]]></comment>
84
+ <sort_order>12</sort_order>
85
+ <show_in_default>1</show_in_default>
86
+ <show_in_website>1</show_in_website>
87
+ <show_in_store>1</show_in_store>
88
+ </password_key>
89
+ <options translate="label">
90
+ <label>Payment Option</label>
91
+ <frontend_type>select</frontend_type>
92
+ <comment>Link directly to a payment option</comment>
93
+ <source_model>xibpayments/system_paymentoptions</source_model>
94
+ <sort_order>13</sort_order>
95
+ <show_in_default>1</show_in_default>
96
+ <show_in_website>1</show_in_website>
97
+ <show_in_store>1</show_in_store>
98
+ </options>
99
+ <order_description translate="label">
100
+ <label>Order description</label>
101
+ <frontend_type>text</frontend_type>
102
+ <comment><![CDATA[Description to show the customer in the Xibpayments screen. Variables:<br /><b>%id%</b> = Order ID]]></comment>
103
+ <sort_order>30</sort_order>
104
+ <show_in_default>1</show_in_default>
105
+ <show_in_website>1</show_in_website>
106
+ <show_in_store>1</show_in_store>
107
+ </order_description>
108
+ <order_status translate="label">
109
+ <label>New order status</label>
110
+ <frontend_type>select</frontend_type>
111
+ <source_model>adminhtml/system_config_source_order_status</source_model>
112
+ <sort_order>31</sort_order>
113
+ <show_in_default>1</show_in_default>
114
+ <show_in_website>0</show_in_website>
115
+ <show_in_store>0</show_in_store>
116
+ </order_status>
117
+ <order_status_paid translate="label">
118
+ <label>Paid order status</label>
119
+ <frontend_type>select</frontend_type>
120
+ <source_model>adminhtml/system_config_source_order_status</source_model>
121
+ <sort_order>32</sort_order>
122
+ <show_in_default>1</show_in_default>
123
+ <show_in_website>0</show_in_website>
124
+ <show_in_store>0</show_in_store>
125
+ </order_status_paid>
126
+ <order_status_paid_createinvoice translate="label">
127
+ <label>Automatically create invoice</label>
128
+ <frontend_type>select</frontend_type>
129
+ <comment>If set to no, the module does NOT create an invoice automatically when payment is received.</comment>
130
+ <source_model>adminhtml/system_config_source_yesno</source_model>
131
+ <sort_order>33</sort_order>
132
+ <show_in_default>1</show_in_default>
133
+ <show_in_website>0</show_in_website>
134
+ <show_in_store>0</show_in_store>
135
+ </order_status_paid_createinvoice>
136
+ <order_status_failed translate="label">
137
+ <label>Failed order status</label>
138
+ <frontend_type>select</frontend_type>
139
+ <source_model>adminhtml/system_config_source_order_status</source_model>
140
+ <sort_order>34</sort_order>
141
+ <show_in_default>1</show_in_default>
142
+ <show_in_website>0</show_in_website>
143
+ <show_in_store>0</show_in_store>
144
+ </order_status_failed>
145
+ <allowspecific translate="label">
146
+ <label>Payment from applicable countries</label>
147
+ <frontend_type>allowspecific</frontend_type>
148
+ <sort_order>50</sort_order>
149
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
150
+ <show_in_default>1</show_in_default>
151
+ <show_in_website>1</show_in_website>
152
+ <show_in_store>1</show_in_store>
153
+ </allowspecific>
154
+ <specificcountry translate="label">
155
+ <label>Payment from Specific countries</label>
156
+ <frontend_type>multiselect</frontend_type>
157
+ <sort_order>51</sort_order>
158
+ <source_model>adminhtml/system_config_source_country</source_model>
159
+ <show_in_default>1</show_in_default>
160
+ <show_in_website>1</show_in_website>
161
+ <show_in_store>1</show_in_store>
162
+ </specificcountry>
163
+ <sort_order translate="label">
164
+ <label>Sort order</label>
165
+ <frontend_type>text</frontend_type>
166
+ <sort_order>100</sort_order>
167
+ <show_in_default>1</show_in_default>
168
+ <show_in_website>1</show_in_website>
169
+ <show_in_store>1</show_in_store>
170
+ </sort_order>
171
+ <debug_log translate="label">
172
+ <label>Debug Log</label>
173
+ <comment>Log name for debug logging (written in /var/log). Enable System/Developer/Log for this to work.</comment>
174
+ <frontend_type>text</frontend_type>
175
+ <sort_order>101</sort_order>
176
+ <show_in_default>1</show_in_default>
177
+ <show_in_website>0</show_in_website>
178
+ <show_in_store>0</show_in_store>
179
+ </debug_log>
180
+ </fields>
181
+ </xibpayments>
182
+ </groups>
183
+ </payment>
184
+ </sections>
185
+ </config>
app/code/local/F500/Xibpayments/sql/cardgate_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Xib|payments 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 F500
13
+ * @package F500_Xibpayments
14
+ * @author Ramon de la Fuente, <ramon@future500.nl>
15
+ * @copyright Copyright (c) 2009 Future500 BV, the Netherlands
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ $installer = $this;
20
+
21
+ $installer->startSetup();
22
+ $installer->endSetup();
app/code/local/F500/Xibpayments/sql/cardgate_setup/mysql4-uninstall-0.1.0.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Xib|payments 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 F500
13
+ * @package F500_Xibpayments
14
+ * @author Ramon de la Fuente, <ramon@future500.nl>
15
+ * @copyright Copyright (c) 2009 Future500 BV, the Netherlands
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ $installer = $this;
20
+
21
+ $installer->startSetup();
22
+ $installer->endSetup();
app/design/frontend/default/default/template/Xibpayments/form.phtml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Xib|payments 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 F500
13
+ * @package F500_Xibpayments
14
+ * @author Ramon de la Fuente, <ramon@future500.nl>
15
+ * @copyright Copyright (c) 2009 Future500 BV, the Netherlands
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ ?>
20
+ <fieldset class="form-list">
21
+ <?php $_code=$this->getMethodCode() ?>
22
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none">
23
+ <li>
24
+ <?php echo $this->__('You will be redirected to Xib|payments, our payment processor, after you place the order.') ?>
25
+ </li>
26
+ </ul>
27
+ </fieldset>
app/etc/modules/F500_Xibpayments.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <!-- declare Mage_NewModule module -->
5
+ <F500_Xibpayments>
6
+ <!-- this is an active module -->
7
+ <active>true</active>
8
+ <!-- this module will be located in app/code/local code pool -->
9
+ <codePool>local</codePool>
10
+ <!-- specify dependencies for correct module loading order -->
11
+ <depends>
12
+ <Mage_Payment />
13
+ </depends>
14
+ <!-- declare module's version information for database updates -->
15
+ <version>0.1.0</version>
16
+ </F500_Xibpayments>
17
+ </modules>
18
+ </config>
app/locale/en_US/F500_Xibpayments.csv ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;FRONTEND
2
+ "You will be redirected to Xib|payments, our payment processor.","You will be redirected to Xib|payments, our payment processor."
3
+ "You will be redirected to Xib|payments, our payment processor, after you place the order.","You will be redirected to Xib|payments, our payment processor, after you place the order."
4
+
5
+ ;BACKEND
6
+ "Selected currency code ","Selected currency code "
7
+ " is not compatible with Xib|payments"," is not compatible with Xib|payments"
8
+ "Error in creating an invoice","Error in creating an invoice"
9
+ "Xib|payments Customer Information:","Xib|payments Customer Information:"
10
+ "Invoice #%s created","Invoice #%s created"
11
+ "Invoice not created","Invoice not created"
12
+ "Xib|payments Error Received:","Xib|payments Error Received:"
13
+ "Order total amount does not match Xib|payments gross total amount","Order total amount does not match Xib|payments gross total amount"
14
+ "All","All"
15
+ "creditcard","creditcard"
16
+ "ideal","ideal"
17
+ "paypal","paypal"
18
+ "Live","Live"
19
+ "Test","Test"
20
+ "Debug","Debug"
21
+ "Enabled","Enabled"
22
+ "Modus","Modus"
23
+ "Site Id","Site Id"
24
+ "Password Key","Password Key"
25
+ "Payment Option","Payment Option"
26
+ "Order description","Order description"
27
+ "New order status","New order status"
28
+ "Paid order status","Paid order status"
29
+ "Automatically create invoice","Automatically create invoice"
30
+ "Failed order status","Failed order status"
31
+ "Debug Log","Debug Log"
32
+ "<a href=""https://merchants.xibpayments.com/"" target=""_blank"">Apply for an account</a>","<a href=""https://merchants.xibpayments.com/"" target=""_blank"">Apply for an account</a>"
33
+ "Text shown in the checkout screen","Text shown in the checkout screen"
34
+ "Live, Test or Debug mode (debug writes a log, see 'Debug Log' setting below)","Live, Test or Debug mode (debug writes a log, see 'Debug Log' setting below)"
35
+ "Site ID from your account at <a href=""merchants.xibpayments.com/"" target=""_blank"">Xib|payments</a>","Site ID from your account at <a href=""merchants.xibpayments.com/"" target=""_blank"">Xib|payments</a>"
36
+ "Password entered in the backend at <a href=""merchants.xibpayments.com/"" target=""_blank"">Xib|payments</a>","Password entered in the backend at <a href=""merchants.xibpayments.com/"" target=""_blank"">Xib|payments</a>"
37
+ "Link directly to a payment option","Link directly to a payment option"
38
+ "Description to show the customer in the Xib|payments screen. Variables:<br /><b>%id%</b> = Order ID","Description to show the customer in the Xib|payments screen. Variables:<br /><b>%id%</b> = Order ID"
39
+ "Log name for debug logging (written in /var/log). Enable System/Developer/Log for this to work.","Log name for debug logging (written in /var/log). Enable System/Developer/Log for this to work."
40
+ "Gateway version","Gateway version"
41
+ "V1","Version 1"
42
+ "V2","Version 2"
app/locale/nl_NL/F500_Xibpayments.csv ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;FRONTEND
2
+ "You will be redirected to Xib|payments, our payment processor.","U wordt doorverwezen naar Xib|payments, onze internet kassa."
3
+ "You will be redirected to Xib|payments, our payment processor, after you place the order.","Na het plaatsen van de bestelling wordt u doorverwezen naar Xib|payments, onze internet kassa."
4
+
5
+ ;BACKEND
6
+ "Selected currency code ","Kies valuta code "
7
+ " is not compatible with Xib|payments"," is niet compatible met Xib|payments"
8
+ "Error in creating an invoice","Fout opgetreden bij het aanmaken van de factuur"
9
+ "Xib|payments Customer Information:","Xib|payments Klant Informatie:"
10
+ "Invoice #%s created","Factuur #%s aangemaakt"
11
+ "Invoice not created","Factuur niet aangemaakt"
12
+ "Xib|payments Error Received:","Xib|payments Fout Ontvangen:"
13
+ "Order total amount does not match Xib|payments gross total amount","Order bedrag komt niet overeen met het Xib|payments totaal bedrag"
14
+ "All","Alle"
15
+ "creditcard","creditcard"
16
+ "ideal","ideal"
17
+ "paypal","paypal"
18
+ "Live","Live"
19
+ "Test","Test"
20
+ "Debug","Debug"
21
+ "Enabled","Actief"
22
+ "Modus","Modus"
23
+ "Site Id","Site Id"
24
+ "Password Key","Password Sleutel"
25
+ "Payment Option","Betaal mogelijkheid"
26
+ "Order description","Order beschrijving"
27
+ "New order status","Nieuwe order status"
28
+ "Paid order status","Betaalde order status"
29
+ "Automatically create invoice","Automatisch factuur aanmaken"
30
+ "Failed order status","Mislukte order status"
31
+ "Debug Log","Debug Log"
32
+ "<a href=""https://merchants.xibpayments.com/"" target=""_blank"">Apply for an account</a>","<a href=""https://merchants.xibpayments.com/"" target=""_blank"">Aanmelden voor een account</a>"
33
+ "Text shown in the checkout screen","Tekst die in beeld komt op de kassa pagina"
34
+ "Live, Test or Debug mode (debug writes a log, see 'Debug Log' setting below)","Live, Test of Debug mode (debug maakt lokaal een log aan, zie 'Debug Log' instellingen hieronder)"
35
+ "Site ID from your account at <a href=""https://merchants.xibpayments.com/"" target=""_blank"">Xib|payments</a>","Site ID van uw account bij <a href=""https://merchants.xibpayments.com/"" target=""_blank"">Xib|payments</a>"
36
+ "Password entered in the backend at <a href=""https://merchants.xibpayments.com/"" target=""_blank"">Xib|payments</a>","Wachtwoord ingevoerd in de admin bij <a href=""https://merchants.xibpayments.com/"" target=""_blank"">Xib|payments</a>"
37
+ "Link directly to a payment option","Direct naar een specifieke betaal mogelijkheid verwijzen"
38
+ "Description to show the customer in the Xib|payments screen. Variables:<br /><b>%id%</b> = Order ID","Beschrijving van de transactie voor de klant in het Xib|payments scherm. Variabelen:<br /><b>%id%</b> = Order Nummer"
39
+ "Log name for debug logging (written in /var/log). Enable System/Developer/Log for this to work.","Log naam voor het debug log (weggeschrveen in /var/log). Activeer ook Systeem/Ontwikelaar/Log om deze functie te laten werken."
40
+ "Gateway version","Gateway versie"
41
+ "V1","Versie 1"
42
+ "V2","Versie 2"
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>F500_Xibpayments</name>
4
+ <version>1.0.1</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Xib payments</summary>
10
+ <description>Module for connecting to the Xib|payment System.
11
+
12
+ Apply for an account at info@xibpayments.com</description>
13
+ <notes>Stabe release</notes>
14
+ <authors><author><name>Ramon de la Fuente</name><user>auto-converted</user><email>ramon@future500.nl</email></author></authors>
15
+ <date>2009-11-09</date>
16
+ <time>08:53:30</time>
17
+ <contents><target name="magelocale"><dir name="en_US"><file name="F500_Xibpayments.csv" hash="e7c8b45a83ca33ae5fccd5353815f477"/></dir><dir name="nl_NL"><file name="F500_Xibpayments.csv" hash="47d55a06b93d5f29a0e2ac7a969e50dc"/></dir></target><target name="magelocal"><dir name="F500"><dir name="Xibpayments"><dir name="Block"><file name="Form.php" hash="db037dd1ff526720847fc704f6316ab7"/><file name="Redirect.php" hash="16bf7b094fd1b45870281b7dde49174c"/></dir><dir name="controllers"><file name="SecureController.php" hash="59a3429d0572a93502ffabe6563b31aa"/></dir><dir name="etc"><file name="config.xml" hash="279c760a672ebd174ab405f1b75cbe26"/><file name="system.xml" hash="643821d61ea5694e5d533fd3d56889e5"/></dir><dir name="Helper"><file name="Data.php" hash="bfa4eeb6609df83759b2e31d39e6b575"/></dir><dir name="Model"><file name="Session.php" hash="a5d2ef4deda15e02a40b7608188ba899"/><file name="Standard.php" hash="8e85121140d44c04e5686e78ed1a5610"/><dir name="Mysql4"><file name="Setup.php" hash="2dee2d37bd72702b1bd4722a826738c2"/></dir><dir name="System"><file name="Gatewayversion.php" hash="1edc6bce4f86e83f5f3217c8d7dc13b0"/><file name="Paymentoptions.php" hash="4894c0ab5912635e59656d70b7f5c15c"/><file name="Transactiontype.php" hash="2d8784404eb1c3434a562d1b1f1871d3"/></dir></dir><dir name="sql"><dir name="cardgate_setup"><file name="mysql4-install-0.1.0.php" hash="223c70847e08e2f28889d3723871dd2c"/><file name="mysql4-uninstall-0.1.0.php" hash="223c70847e08e2f28889d3723871dd2c"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="Xibpayments"><file name="form.phtml" hash="a8ab07c94b938e19b8a88e7f7f8b0f42"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="F500_Xibpayments.xml" hash="006f07cd8a376ff45ba10340f882185b"/></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies/>
20
+ </package>