Smilla_Fashioncheque - Version 1.0.0

Version Notes

Initialrelease

Download this release

Release Info

Developer smilla AG
Extension Smilla_Fashioncheque
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/Smilla/Fashioncheque/Block/Form/Standard.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Smilla_Fashioncheque_Block_Form_Standard extends Mage_Payment_Block_Form {
3
+
4
+ protected function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->setTemplate('fashioncheque/form/standard.phtml');
8
+ }
9
+ }
10
+ ?>
app/code/community/Smilla/Fashioncheque/Block/Info.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Smilla_Fashioncheque_Block_Info extends Mage_Payment_Block_Info {
3
+
4
+ protected function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->setTemplate('fashioncheque/paymentinfo.phtml');
8
+ }
9
+
10
+
11
+ public function toPdf()
12
+ {
13
+ $this->setTemplate('fashioncheque/paymentinfo_pdf.phtml');
14
+ return $this->toHtml();
15
+ }
16
+ }
17
+ ?>
app/code/community/Smilla/Fashioncheque/Helper/Api.php ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Smilla_Fashioncheque_Helper_Api extends Mage_Core_Helper_Abstract
3
+ {
4
+ private $testApiUrl = 'https://wssec-uat.fashioncheque.nl/v3/giftcard.asmx?wsdl';
5
+ private $prodApiUrl = 'https://wssec.fashioncheque.nl/v3/giftcard.asmx?wsdl';
6
+
7
+
8
+ /**
9
+ * Validate Card / Verification Code
10
+ */
11
+ public function cardInfo($cardNo){
12
+ Mage::log('Validate Card-#: '.$cardNo, 7);
13
+ $parameter = array(
14
+ 'CardInfo' => array(
15
+ 'RequestID' => $this->getRequestId(),
16
+ 'Cardnumber' => $cardNo,
17
+ )
18
+ );
19
+
20
+ $result = $this->apiCall('CardInfo', $parameter);
21
+
22
+ if($result->Result == 'Success' && $result->Card->CardStatus == "Active"){
23
+ return $result;
24
+ } else {
25
+ if($result->Result == 'Success'){
26
+ // Exception depends on CardStatus
27
+ switch($result->Card->CardStatus){
28
+ case 'Deactivated':
29
+ $message = 'Card is empty and inactive.';
30
+ break;
31
+ case 'Suspended':
32
+ $message = 'Card is suspended.';
33
+ break;
34
+ case 'Registered':
35
+ $message = 'Card is not active yet.';
36
+ break;
37
+ default:
38
+ $message = 'Card is '.$result->Card->CardStatus;
39
+
40
+ }
41
+ throw new Exception('0000: '.$message);
42
+ } else {
43
+ // Return Remark
44
+ throw new Exception($result->Remark);
45
+ }
46
+
47
+ }
48
+
49
+ }
50
+
51
+
52
+ public function check($cardNo, $verificationcode, $amount){
53
+ Mage::log('CHECK Card-#: '.$cardNo, 7);
54
+ Mage::log('Amount: '.$amount, 7);
55
+
56
+
57
+
58
+ $parameter = array(
59
+ 'Check' => array(
60
+ 'RequestID' => $this->getRequestId(),
61
+ 'Cardnumber' => $cardNo,
62
+ 'VerificationCode' => $verificationcode,
63
+ 'Value' => array(
64
+ 'Currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
65
+ 'Amount' => $amount * 100
66
+ ),
67
+ )
68
+ );
69
+
70
+ $result = $this->apiCall('Check', $parameter);
71
+
72
+ if(($result->Result == 'Success' || $result->Result == 'StatusError') && $result->Card->CardStatus == "Active"){
73
+ return $result;
74
+ } else {
75
+ throw new Exception($result->Remark);
76
+ }
77
+
78
+ }
79
+
80
+
81
+ public function withdraw($cardNo, $verificationcode, $amount, $receiptnumber){
82
+ Mage::log('CHECK Card-#: '.$cardNo, 7);
83
+ Mage::log('Amount: '.$amount, 7);
84
+
85
+
86
+ $requestId = $this->getRequestId();
87
+
88
+ $parameter = array(
89
+ 'Withdraw' => array(
90
+ 'RequestID' => $requestId,
91
+ 'Cardnumber' => $cardNo,
92
+ 'VerificationCode' => $verificationcode,
93
+ 'Value' => array(
94
+ 'Currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
95
+ 'Amount' => $amount * 100
96
+ ),
97
+ 'Receiptnumber' => $receiptnumber
98
+ )
99
+ );
100
+
101
+ $result = $this->apiCall('Withdraw', $parameter);
102
+
103
+ if($result->Result == 'Success'){
104
+ return $requestId;
105
+ } else {
106
+ throw new Exception($result->Remark);
107
+ }
108
+
109
+ }
110
+
111
+
112
+ public function refund($cardNo, $verificationcode, $amount, $receiptnumber, $originalTransactionID){
113
+ Mage::log('REFUND Card-#: '.$cardNo, 7);
114
+ Mage::log('Amount: '.$amount, 7);
115
+
116
+
117
+ $requestId = $this->getRequestId();
118
+
119
+ $parameter = array(
120
+ 'Withdraw' => array(
121
+ 'RequestID' => $requestId,
122
+ 'Cardnumber' => $cardNo,
123
+ 'VerificationCode' => $verificationcode,
124
+ 'OriginalRequestID' => $originalTransactionID,
125
+ 'Value' => array(
126
+ 'Currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
127
+ 'Amount' => $amount * 100
128
+ ),
129
+ 'Receiptnumber' => $receiptnumber
130
+ )
131
+ );
132
+
133
+ $result = $this->apiCall('Refund', $parameter);
134
+
135
+ if($result->Result != 'Success'){
136
+ throw new Exception($result->Remark);
137
+ }
138
+
139
+ return $this;
140
+
141
+ }
142
+
143
+ private function getRequestId(){
144
+
145
+ return strtoupper(uniqid());
146
+ }
147
+
148
+
149
+ private function apiCall($method, $parameter){
150
+ try{
151
+
152
+ if(Mage::getStoreConfig('payment/fashioncheque/test_mode') == 0){
153
+ // Production API
154
+ $apiUrl = $this->prodApiUrl;
155
+ } else {
156
+ // Test API
157
+ $apiUrl = $this->testApiUrl;
158
+ }
159
+ Mage::log($apiUrl, 7);
160
+
161
+
162
+ $api = new SoapClient($apiUrl, array(
163
+ 'trace' => true,
164
+ ));
165
+
166
+
167
+ // Set Authentication Header
168
+ $headerbody = array(
169
+ 'PointOfSale' => array(
170
+ 'MerchantID'=> Mage::getStoreConfig('payment/fashioncheque/merchant_id')
171
+ )
172
+ );
173
+
174
+ $soapHeader = new SoapHeader('http://pos.fashioncheque.nl/wsdl/v3/giftcard', "Authentication", $headerbody);
175
+ $api->__setSoapHeaders($soapHeader);
176
+
177
+ // Call API
178
+ $result = $api->__soapCall($method, $parameter);
179
+
180
+ Mage::log('Request Body: '.(string) $api->__getLastRequest(), 7);
181
+ Mage::log('Result: '.json_encode($result), 7);
182
+
183
+ return $result;
184
+
185
+ } catch(SoapFault $e){
186
+ throw new Exception('0000: '.$e->getMessage());
187
+ }
188
+
189
+ }
190
+ }
app/code/community/Smilla/Fashioncheque/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Smilla_Fashioncheque_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ }
app/code/community/Smilla/Fashioncheque/Model/Standard.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Smilla_Fashioncheque_Model_Standard extends Mage_Payment_Model_Method_Abstract {
3
+ protected $_code = 'fashioncheque';
4
+ protected $_formBlockType = 'fashioncheque/form_standard';
5
+ protected $_infoBlockType = 'fashioncheque/info';
6
+ protected $_canAuthorize = false;
7
+ protected $_canCapture = true;
8
+ protected $_canFetchTransactionInfo = true;
9
+ protected $_canRefund = true;
10
+ protected $_canCancel = true;
11
+ protected $_canUseInternal = true;
12
+
13
+ public function capture(Varien_Object $payment, $amount)
14
+ {
15
+ Mage::log('Start Capturing: '. $amount, 7);
16
+
17
+ $api = Mage::helper('fashioncheque/api');
18
+
19
+ // Capture API Call
20
+ try{
21
+ $transactionId = $api->withdraw($payment->getCardNo(), $payment->getVerificationcode(), $amount, $payment->getOrder()->getIncrementId());
22
+ $payment->setTransactionId($transactionId);
23
+ $payment->setIsTransactionClosed(0);
24
+ //$payment->setTransactionAdditionalInfo(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS,array('key1'=>'value1','key2'=>'value2'));
25
+ }catch(Exception $e){
26
+ // Capture failed
27
+ $errorCode = substr($e->getMessage(), 0, 4);
28
+ switch($errorCode){
29
+ // Card Number not Found
30
+ case '0150':
31
+ $message = 'Verification Code invalid.';
32
+ break;
33
+ default:
34
+ $message = substr($e->getMessage(), 6);
35
+ }
36
+ Mage::throwException($this->_getHelper()->__($message));
37
+ }
38
+
39
+ return $this;
40
+ }
41
+
42
+ public function assignData($data)
43
+ {
44
+ if (!($data instanceof Varien_Object)) {
45
+ $data = new Varien_Object($data);
46
+ }
47
+ $info = $this->getInfoInstance();
48
+ $info->setCardNo($data->getCardNo())
49
+ ->setVerificationcode($data->getVerificationcode());
50
+ return $this;
51
+ }
52
+
53
+ /**
54
+ * Check entered Card Number / Verfication Code
55
+ */
56
+ public function validate()
57
+ {
58
+ parent::validate();
59
+
60
+ $paymentInfo = $this->getInfoInstance();
61
+ $api = Mage::helper('fashioncheque/api');
62
+
63
+ if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
64
+ $grandTotal = $paymentInfo->getOrder()->getGrandTotal();
65
+ } else {
66
+ $grandTotal = $paymentInfo->getQuote()->getGrandTotal();
67
+ }
68
+
69
+ try{
70
+ //$checkResult = $api->check($paymentInfo->getCardNo(), $paymentInfo->getVerificationcode(), $grandTotal);
71
+ $cardInfo = $api->cardInfo($paymentInfo->getCardNo());
72
+ } catch(Exception $e){
73
+ // Output API Error (Excluding Code)
74
+ Mage::throwException($this->_getHelper()->__(substr($e->getMessage(), 6)));
75
+ }
76
+
77
+ // Check Credit
78
+ if($cardInfo->Card->Credit < ($grandTotal * 100.00)){
79
+ Mage::throwException($this->_getHelper()->__('The fashioncheque card has not enough Credit (Current Balance: %s %s)', $cardInfo->Card->Credit / 100, $cardInfo->Card->Currency));
80
+ }
81
+
82
+ return $this;
83
+ }
84
+
85
+ public function cancel(Varien_Object $payment) {
86
+ Mage::Log('Order cancel', 7);
87
+
88
+ return $this;
89
+ }
90
+
91
+ // Refund Order
92
+ public function refund(Varien_Object $payment, $amount) {
93
+ Mage::Log('Ordeer refund', 7);
94
+ Mage::Log('Amount:'.$amount, 7);
95
+ Mage::Log('Refund Transaction:'.$payment->getRefundTransactionId(), 7);
96
+
97
+ $api = Mage::helper('fashioncheque/api');
98
+
99
+ // Refund API Call
100
+ try{
101
+ $api->refund($payment->getCardNo(), $payment->getVerificationcode(), $amount, $payment->getOrder()->getIncrementId(), $payment->getRefundTransactionId());
102
+ }catch(Exception $e){
103
+ // Refund failed
104
+ Mage::throwException($this->_getHelper()->__($e->getMessage()));
105
+ }
106
+ return $this;
107
+ }
108
+
109
+
110
+
111
+ }
112
+ ?>
app/code/community/Smilla/Fashioncheque/controllers/PaymentController.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Fashioncheque Payment Controller
4
+ */
5
+
6
+ class Smilla_Fashioncheque_PaymentController extends Mage_Core_Controller_Front_Action {
7
+ // The redirect action is triggered when someone places an order
8
+ public function redirectAction() {
9
+ $this->loadLayout();
10
+ $block = $this->getLayout()->createBlock('Mage_Core_Block_Template','fashioncheque',array('template' => 'fashioncheque/redirect.phtml'));
11
+ $this->getLayout()->getBlock('content')->append($block);
12
+ $this->renderLayout();
13
+ }
14
+
15
+ // The response action is triggered when your gateway sends back a response after processing the customer's payment
16
+ public function responseAction() {
17
+ if($this->getRequest()->isPost()) {
18
+
19
+ /*
20
+ /* Your gateway's code to make sure the reponse you
21
+ /* just got is from the gatway and not from some weirdo.
22
+ /* This generally has some checksum or other checks,
23
+ /* and is provided by the gateway.
24
+ /* For now, we assume that the gateway's response is valid
25
+ */
26
+
27
+ $validated = true;
28
+ $orderId = '123'; // Generally sent by gateway
29
+
30
+ if($validated) {
31
+ // Payment was successful, so update the order's state, send order email and move to the success page
32
+ $order = Mage::getModel('sales/order');
33
+ $order->loadByIncrementId($orderId);
34
+ $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment.');
35
+
36
+ $order->sendNewOrderEmail();
37
+ $order->setEmailSent(true);
38
+
39
+ $order->save();
40
+
41
+ Mage::getSingleton('checkout/session')->unsQuoteId();
42
+
43
+ Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure'=>true));
44
+ }
45
+ else {
46
+ // There is a problem in the response we got
47
+ $this->cancelAction();
48
+ Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/failure', array('_secure'=>true));
49
+ }
50
+ }
51
+ else
52
+ Mage_Core_Controller_Varien_Action::_redirect('');
53
+ }
54
+
55
+ // The cancel action is triggered when an order is to be cancelled
56
+ public function cancelAction() {
57
+ if (Mage::getSingleton('checkout/session')->getLastRealOrderId()) {
58
+ $order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
59
+ if($order->getId()) {
60
+ // Flag the order as 'cancelled' and save it
61
+ $order->cancel()->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, 'Gateway has declined the payment.')->save();
62
+ }
63
+ }
64
+ }
65
+ }
app/code/community/Smilla/Fashioncheque/etc/config.xml ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Smilla_Fashioncheque>
5
+ <version>1.0.0</version>
6
+ </Smilla_Fashioncheque>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <fashioncheque>
11
+ <class>Smilla_Fashioncheque_Model</class>
12
+ </fashioncheque>
13
+ </models>
14
+ <helpers>
15
+ <fashioncheque>
16
+ <class>Smilla_Fashioncheque_Helper</class>
17
+ </fashioncheque>
18
+ </helpers>
19
+ <blocks>
20
+ <fashioncheque>
21
+ <class>Smilla_Fashioncheque_Block</class>
22
+ </fashioncheque>
23
+ </blocks>
24
+ <resources>
25
+ <fashioncheque_setup>
26
+ <setup>
27
+ <module>Smilla_Fashioncheque</module>
28
+ </setup>
29
+ <connection>
30
+ <use>core_setup</use>
31
+ </connection>
32
+ </fashioncheque_setup>
33
+ <fashioncheque_write>
34
+ <connection>
35
+ <use>core_write</use>
36
+ </connection>
37
+ </fashioncheque_write>
38
+ <fashioncheque_read>
39
+ <connection>
40
+ <use>core_read</use>
41
+ </connection>
42
+ </fashioncheque_read>
43
+ </resources>
44
+ <fieldsets>
45
+ <sales_convert_quote_payment>
46
+ <card_no>
47
+ <to_order_payment>*</to_order_payment>
48
+ </card_no>
49
+ <verificationcode>
50
+ <to_order_payment>*</to_order_payment>
51
+ </verificationcode>
52
+ </sales_convert_quote_payment>
53
+ </fieldsets>
54
+
55
+ </global>
56
+
57
+ <default>
58
+ <payment>
59
+ <fashioncheque>
60
+ <model>fashioncheque/standard</model>
61
+ <active>0</active>
62
+ <test_mode>1</test_mode>
63
+ <payment_action>authorize_capture</payment_action>
64
+ <order_status>pending</order_status>
65
+ <title>fashioncheque</title>
66
+ <allowspecific>0</allowspecific>
67
+ <sort_order>10</sort_order>
68
+ </fashioncheque>
69
+ </payment>
70
+ </default>
71
+ <frontend>
72
+ <translate>
73
+ <modules>
74
+ <Smilla_Fashioncheque>
75
+ <files>
76
+ <default>Smilla_Fashioncheque.csv</default>
77
+ </files>
78
+ </Smilla_Fashioncheque>
79
+ </modules>
80
+ </translate>
81
+ <routers>
82
+ <fashioncheque>
83
+ <use>standard</use>
84
+ <args>
85
+ <module>Smilla_Fashioncheque</module>
86
+ <frontName>fashioncheque</frontName>
87
+ </args>
88
+ </fashioncheque>
89
+ </routers>
90
+ </frontend>
91
+ <adminhtml>
92
+ <translate>
93
+ <modules>
94
+ <Smilla_Fashioncheque>
95
+ <files>
96
+ <default>Smilla_Fashioncheque.csv</default>
97
+ </files>
98
+ </Smilla_Fashioncheque>
99
+ </modules>
100
+ </translate>
101
+ </adminhtml>
102
+ </config>
app/code/community/Smilla/Fashioncheque/etc/system.xml ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <payment>
5
+ <groups>
6
+ <fashioncheque translate="label comment" module="paygate">
7
+ <label>fashioncheque</label>
8
+ <frontend_type>text</frontend_type>
9
+ <sort_order>100</sort_order>
10
+ <show_in_default>1</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>1</show_in_store>
13
+ <fields>
14
+ <active translate="label">
15
+ <label>Enabled</label>
16
+ <frontend_type>select</frontend_type>
17
+ <source_model>adminhtml/system_config_source_yesno</source_model>
18
+ <sort_order>10</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>0</show_in_store>
22
+ </active>
23
+ <title translate="label">
24
+ <label>Title</label>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>20</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ </title>
31
+ <test_mode translate="label">
32
+ <label>Test Mode</label>
33
+ <frontend_type>select</frontend_type>
34
+ <source_model>adminhtml/system_config_source_yesno</source_model>
35
+ <sort_order>35</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>0</show_in_store>
39
+ </test_mode>
40
+ <merchant_id translate="label">
41
+ <label>Merchant-ID</label>
42
+ <frontend_type>text</frontend_type>
43
+ <sort_order>40</sort_order>
44
+ <show_in_default>1</show_in_default>
45
+ <show_in_website>1</show_in_website>
46
+ <show_in_store>1</show_in_store>
47
+ </merchant_id>
48
+ <order_status translate="label">
49
+ <label>New Order Status</label>
50
+ <frontend_type>select</frontend_type>
51
+ <source_model>adminhtml/system_config_source_order_status</source_model>
52
+ <sort_order>50</sort_order>
53
+ <show_in_default>1</show_in_default>
54
+ <show_in_website>1</show_in_website>
55
+ <show_in_store>0</show_in_store>
56
+ </order_status>
57
+ <allowspecific translate="label">
58
+ <label>Payment Applicable From</label>
59
+ <frontend_type>select</frontend_type>
60
+ <sort_order>60</sort_order>
61
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
62
+ <show_in_default>1</show_in_default>
63
+ <show_in_website>1</show_in_website>
64
+ <show_in_store>0</show_in_store>
65
+ </allowspecific>
66
+ <specificcountry translate="label">
67
+ <label>Countries Payment Applicable From</label>
68
+ <frontend_type>multiselect</frontend_type>
69
+ <sort_order>70</sort_order>
70
+ <source_model>adminhtml/system_config_source_country</source_model>
71
+ <show_in_default>1</show_in_default>
72
+ <show_in_website>1</show_in_website>
73
+ <show_in_store>0</show_in_store>
74
+ <depends>
75
+ <allowspecific>1</allowspecific>
76
+ </depends>
77
+ </specificcountry>
78
+ <sort_order translate="label">
79
+ <label>Sort Order</label>
80
+ <frontend_type>text</frontend_type>
81
+ <sort_order>100</sort_order>
82
+ <show_in_default>1</show_in_default>
83
+ <show_in_website>1</show_in_website>
84
+ <show_in_store>0</show_in_store>
85
+ </sort_order>
86
+ </fields>
87
+ </fashioncheque>
88
+ </groups>
89
+ </payment>
90
+ </sections>
91
+ </config>
app/code/community/Smilla/Fashioncheque/sql/fashioncheque_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("
5
+
6
+ ALTER TABLE `{$installer->getTable('sales/quote_payment')}` ADD `card_no` VARCHAR( 255 ) NOT NULL ;
7
+ ALTER TABLE `{$installer->getTable('sales/quote_payment')}` ADD `verificationcode` VARCHAR( 255 ) NOT NULL ;
8
+
9
+ ALTER TABLE `{$installer->getTable('sales/order_payment')}` ADD `card_no` VARCHAR( 255 ) NOT NULL ;
10
+ ALTER TABLE `{$installer->getTable('sales/order_payment')}` ADD `verificationcode` VARCHAR( 255 ) NOT NULL ;
11
+
12
+ ");
13
+ $installer->endSetup();
14
+
app/design/adminhtml/default/template/fashioncheque/paymentinfo.phtml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p><strong><?php echo $this->__('fashion') ?></strong><?php echo $this->__('cheque') ?></p>
2
+
3
+ <table class="info-table">
4
+ <tbody>
5
+ <tr>
6
+ <th><?php echo $this->__('Cardnumber:') ?></th>
7
+ <td><?php echo $this->getInfo()->getCardNo() ?></td>
8
+ </tr>
9
+ <tr>
10
+ <th><?php echo $this->__('Transaction-ID:') ?></th>
11
+ <td><?php echo $this->getInfo()->getLastTransId() ?></td>
12
+ </tr>
13
+ </tbody>
14
+ </table>
app/design/adminhtml/default/template/fashioncheque/paymentinfo_pdf.phtml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <p><?php echo $this->__('fashion') ?><?php echo $this->__('cheque') ?></p>
2
+ <p>
3
+ <?php echo $this->__('Cardnumber:') ?><br />
4
+ <?php echo $this->getInfo()->getCardNo() ?><br />
5
+ <br />
6
+ <?php echo $this->__('Transaction-ID:') ?><br />
7
+ <?php echo $this->getInfo()->getLastTransId() ?>
8
+ </p>
app/design/frontend/base/default/template/fashioncheque/form/standard.phtml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $_code=$this->getMethodCode() ?>
2
+ <fieldset class="form-list">
3
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none;">
4
+ <li>
5
+ <label for="<?php echo $_code ?>_check_no" class="required"><em>*</em><?php echo $this->__('fashioncheque Cardnumber') ?></label>
6
+ <div class="input-box">
7
+ <input type="text" title="<?php echo $this->__('Verification Code') ?>" class="input-text required-entry validate-digits validate-length maximum-length-19 minimum-length-19" id="<?php echo $_code ?>_card_no" name="payment[card_no]" value="<?php echo $this->htmlEscape($this->getInfoData('card_no')) ?>" maxlength="19" />
8
+ </div>
9
+ </li>
10
+ <li>
11
+ <label for="<?php echo $_code ?>_verificationcode" class="required"><em>*</em><?php echo $this->__('Verification Code') ?></label>
12
+ <div class="input-box">
13
+ <input type="text" title="<?php echo $this->__('Verification Code') ?>" class="input-text required-entry validate-digits maximum-length-6 minimum-length-6" id="<?php echo $_code ?>verificationcode" name="payment[verificationcode]" value="<?php echo $this->htmlEscape($this->getInfoData('verificationcode')) ?>" maxlength="6" />
14
+ </div>
15
+ </li>
16
+ </ul>
17
+ </fieldset>
18
+ <div>
19
+ <?php echo $this->getMethod()->getConfigData('message');?>
20
+ </div>
app/design/frontend/base/default/template/fashioncheque/paymentinfo.phtml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <p><strong><?php echo $this->__('fashion') ?></strong><?php echo $this->__('cheque') ?></p>
2
+ <p>
3
+ <?php echo $this->__('Cardnumber:') ?><br><?php echo $this->getInfo()->getCardNo() ?>
4
+ </p>
app/etc/modules/Smilla_Fashioncheque.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Smilla_Fashioncheque>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Smilla_Fashioncheque>
8
+ </modules>
9
+ </config>
app/locale/de_CH/Smilla_Fashioncheque.csv ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Cardnumber not found","fashioncheque Karte konnte nicht gefunden werden oder ist ungültig."
2
+ "Card is empty and inactive.","fashioncheque Karte ist leer und inaktiv."
3
+ "Card is suspended.","fashioncheque Karte wurde gesperrt."
4
+ "Cardstatus expired","fashioncheque Karte ist abgelaufen."
5
+ "Card is not active yet.","fashioncheque Karte ist noch nicht aktiviert."
6
+ "The fashioncheque card has not enough Credit (Current Balance: %s %s)","fashioncheque Karte hat kein ausreichendes Guthaben. (Aktuelles Guthaben: %s %s)"
7
+ "fashioncheque Cardnumber","fashioncheque Kartennummer"
8
+ "Verification Code","Bestätigungscode"
9
+ "Verification Code invalid.","Bestätigungscode ungültig."
10
+ "URL POS","POS Adresse"
11
+ "Merchant-ID","Merchant-ID"
12
+ "Cardnumber:","Kartennummer:"
13
+ "Transaction-ID:","Transaktions-ID:"
14
+ "Test Mode","Test Modus"
app/locale/de_DE/Smilla_Fashioncheque.csv ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Cardnumber not found","fashioncheque Karte konnte nicht gefunden werden oder ist ungültig."
2
+ "Card is empty and inactive.","fashioncheque Karte ist leer und inaktiv."
3
+ "Card is suspended.","fashioncheque Karte wurde gesperrt."
4
+ "Cardstatus expired","fashioncheque Karte ist abgelaufen."
5
+ "Card is not active yet.","fashioncheque Karte ist noch nicht aktiviert."
6
+ "The fashioncheque card has not enough Credit (Current Balance: %s %s)","fashioncheque Karte hat kein ausreichendes Guthaben. (Aktuelles Guthaben: %s %s)"
7
+ "fashioncheque Cardnumber","fashioncheque Kartennummer"
8
+ "Verification Code","Bestätigungscode"
9
+ "Verification Code invalid.","Bestätigungscode ungültig."
10
+ "URL POS","POS Adresse"
11
+ "Merchant-ID","Merchant-ID"
12
+ "Cardnumber:","Kartennummer:"
13
+ "Transaction-ID:","Transaktions-ID:"
14
+ "Test Mode","Test Modus"
app/locale/fr_CH/Smilla_Fashioncheque.csv ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Cardnumber not found","fashioncheque Card ne peut être trouvé ou est invalide."
2
+ "Card is empty and inactive.","fashioncheque Card est vide et inactif."
3
+ "Card is suspended.","fashioncheque Card a été bloqué."
4
+ "Cardstatus expired","fashioncheque Card est pas encore activé."
5
+ "Card is not active yet.","fashioncheque Karte ist noch nicht aktiviert."
6
+ "The fashioncheque card has not enough Credit (Current Balance: %s %s)","fashioncheque Carte dispose de fonds insuffisants. (Crédit actuel: %s %s)"
7
+ "fashioncheque Cardnumber","fashioncheque Card Number"
8
+ "Verification Code","Code de confirmation"
9
+ "Verification Code invalid.","Code de confirmation est invalide."
10
+ "URL POS","POS Adresse"
11
+ "Merchant-ID","Merchant-ID"
12
+ "Cardnumber:","Cardnumber:"
13
+ "Transaction-ID:","Transaction-ID:"
14
+ "Test Mode","Test Mode"
app/locale/fr_FR/Smilla_Fashioncheque.csv ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Cardnumber not found","fashioncheque Card ne peut être trouvé ou est invalide."
2
+ "Card is empty and inactive.","fashioncheque Card est vide et inactif."
3
+ "Card is suspended.","fashioncheque Card a été bloqué."
4
+ "Cardstatus expired","fashioncheque Card est pas encore activé."
5
+ "Card is not active yet.","fashioncheque Karte ist noch nicht aktiviert."
6
+ "The fashioncheque card has not enough Credit (Current Balance: %s %s)","fashioncheque Carte dispose de fonds insuffisants. (Crédit actuel: %s %s)"
7
+ "fashioncheque Cardnumber","fashioncheque Card Number"
8
+ "Verification Code","Code de confirmation"
9
+ "Verification Code invalid.","Code de confirmation est invalide."
10
+ "URL POS","POS Adresse"
11
+ "Merchant-ID","Merchant-ID"
12
+ "Cardnumber:","Cardnumber:"
13
+ "Transaction-ID:","Transaction-ID:"
14
+ "Test Mode","Test Mode"
package.xml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Smilla_Fashioncheque</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>GPL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Gift cards get more and more popular. The gift card fashioncheque broadens the advantages for giver and the receiver of the gift card. The giver does not need to know what the receiver likes and what the store offers because the fashioncheque covers thousands of stores in the area of fashion and lifestyle in a growing number of countries. The receiver is not stuck with the wrong present or a gift card which can only be used in a dedicated shop or chain. </summary>
10
+ <description>Whoever buys a fashioncheque gift card doesn&#x2019;t have to browse the store trying to get the right thing. Whoever receives a fashioncheque gift card is not stuck to the wrong shops, chains, even countries. &#xD;
11
+ &#xD;
12
+ And whoever sells a fashioncheque generates dedicated fashion-money which can forward customers to the own stores spending the fashioncheque-money and more. &#xD;
13
+ </description>
14
+ <notes>Initialrelease</notes>
15
+ <authors><author><name>Smilla AG</name><user>smilla</user><email>hendrik.unkenholz@smilla.com</email></author></authors>
16
+ <date>2015-10-23</date>
17
+ <time>08:50:19</time>
18
+ <contents><target name="magecommunity"><dir name="Smilla"><dir name="Fashioncheque"><dir name="Block"><dir name="Form"><file name="Standard.php" hash="bb84ec8a33b1e661690176e3e59fd3a6"/></dir><file name="Info.php" hash="18594f4e7c00c88a8192a98c1cbe35e4"/></dir><dir name="Helper"><file name="Api.php" hash="1dc3a6695fcb7e9b16f4693f21e835fe"/><file name="Data.php" hash="1c696f5529999e3e07f4cd796bd2b5ac"/></dir><dir name="Model"><file name="Standard.php" hash="320965d160c84411a97f235b6ba8cc5d"/></dir><dir name="controllers"><file name="PaymentController.php" hash="4f90560237af5f98f864534ecd91c2da"/></dir><dir name="etc"><file name="config.xml" hash="56fe9cbf722a81348ca23e4b9967c8ca"/><file name="system.xml" hash="cd5e162d6ca1fafa0699716c140900b3"/></dir><dir name="sql"><dir name="fashioncheque_setup"><file name="mysql4-install-1.0.0.php" hash="b4b661a9acfd58d9129c008a87adf2fe"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="fashioncheque"><dir name="form"><file name="standard.phtml" hash="d960a5e73e43e5ad7a97564f0d4dcce3"/></dir><file name="paymentinfo.phtml" hash="2e05b7178650015cbcc3f03c47b7bbd1"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="template"><dir name="fashioncheque"><file name="paymentinfo.phtml" hash="d595b3e4a9c55a14f8d69dd4b03fd52f"/><file name="paymentinfo_pdf.phtml" hash="765ef013db6cad1c566b5ffd7915f422"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Smilla_Fashioncheque.xml" hash="fbc5b995dfe05117e1a3fdfd798cbda8"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Smilla_Fashioncheque.csv" hash="85deb930602dde606356ddd5bb700716"/></dir><dir name="de_CH"><file name="Smilla_Fashioncheque.csv" hash="85deb930602dde606356ddd5bb700716"/></dir><dir name="fr_FR"><file name="Smilla_Fashioncheque.csv" hash="7c77e21ca6cb5fd2efdb528b4e71213b"/></dir><dir name="fr_CH"><file name="Smilla_Fashioncheque.csv" hash="7c77e21ca6cb5fd2efdb528b4e71213b"/></dir></target></contents>
19
+ <compatible/>
20
+ <dependencies><required><php><min>5.3.0</min><max>6.9.0</max></php></required></dependencies>
21
+ </package>