CDev_XPaymentsConnector - Version 1.2.9

Version Notes

Version number: 1.2.9

Download this release

Release Info

Developer Valerii Demidov
Extension CDev_XPaymentsConnector
Version 1.2.9
Comparing to
See all releases


Code changes from version 1.2.8 to 1.2.9

app/code/community/Cdev/XPaymentsConnector/Block/Adminhtml/Sales/Order/View/Tab/Xporderstate.php CHANGED
@@ -79,24 +79,20 @@ class Cdev_XPaymentsConnector_Block_Adminhtml_Sales_Order_View_Tab_Xporderstate
79
public function getXpaymentsOrderInfo(){
80
$result = array();
81
82
- if (empty($this->txnid)) {
83
$orderBroken = Mage::helper("xpaymentsconnector")->__("This order has been broken. Parameter 'xpayments transaction id' is not available.");
84
$result["success"] = false;
85
$result["error_message"] = $orderBroken;
86
return $result;
87
}
88
89
-
90
- if(!$this->transactionStatus){
91
$xpaymentsConnect = Mage::helper("xpaymentsconnector")->__("Can't get information about the order from X-Payments server. More information is available in log files.");
92
$result["success"] = false;
93
$result["error_message"] = $xpaymentsConnect;
94
- }else{
95
- if(!$this->isHidden()){
96
- $result["success"] = true;
97
- $result["info"] = $this->transactionInfo;
98
- }
99
-
100
}
101
102
return $result;
@@ -105,14 +101,52 @@ class Cdev_XPaymentsConnector_Block_Adminhtml_Sales_Order_View_Tab_Xporderstate
105
106
public function isHidden()
107
{
108
- $currentPaymentCode = $this->getOrder()->getPayment()->getMethodInstance()->getCode();
109
$isXpaymentsMethod = Mage::helper("xpaymentsconnector")->isXpaymentsMethod($currentPaymentCode);
110
if($isXpaymentsMethod){
111
- list($this->transactionStatus, $this->transactionInfo)
112
- = Mage::getModel("xpaymentsconnector/payment_cc")->requestPaymentInfo($this->txnid,false,true);
113
}
114
115
return !$isXpaymentsMethod;
116
117
}
118
}
79
public function getXpaymentsOrderInfo(){
80
$result = array();
81
82
+ if (empty($this->txnid) && empty($this->transactionInfo)) {
83
$orderBroken = Mage::helper("xpaymentsconnector")->__("This order has been broken. Parameter 'xpayments transaction id' is not available.");
84
$result["success"] = false;
85
$result["error_message"] = $orderBroken;
86
return $result;
87
}
88
89
+ if (!$this->transactionStatus && empty($this->transactionInfo)) {
90
$xpaymentsConnect = Mage::helper("xpaymentsconnector")->__("Can't get information about the order from X-Payments server. More information is available in log files.");
91
$result["success"] = false;
92
$result["error_message"] = $xpaymentsConnect;
93
+ } else {
94
+ $result["success"] = true;
95
+ $result["info"] = $this->transactionInfo;
96
}
97
98
return $result;
101
102
public function isHidden()
103
{
104
+
105
+ $currentOrder = $this->getOrder();
106
+ $currentPaymentCode = $currentOrder->getPayment()->getMethodInstance()->getCode();
107
$isXpaymentsMethod = Mage::helper("xpaymentsconnector")->isXpaymentsMethod($currentPaymentCode);
108
if($isXpaymentsMethod){
109
+ if($this->txnid){
110
+ list($this->transactionStatus, $this->transactionInfo[$currentOrder->getIncrementId()])
111
+ = Mage::getModel("xpaymentsconnector/payment_cc")->requestPaymentInfo($this->txnid,false,true);
112
+ $this->transactionInfo[$currentOrder->getIncrementId()]["payment"]["xpc_txnid"] = $this->txnid;
113
+ }
114
+
115
+ while(!is_null($parentOrder = $currentOrder->getRelationParentId())){
116
+ $currentOrder = Mage::getModel('sales/order')->load($parentOrder);
117
+ if ($currentOrder) {
118
+ $txnid = $currentOrder->getData("xpc_txnid");
119
+ if($txnid){
120
+ list($transactionStatus, $transactionInfo)
121
+ = Mage::getModel("xpaymentsconnector/payment_cc")->requestPaymentInfo($txnid, false, true);
122
+ if ($transactionStatus) {
123
+ $this->transactionInfo[$currentOrder->getIncrementId()] = $transactionInfo;
124
+ $this->transactionInfo[$currentOrder->getIncrementId()]["payment"]["xpc_txnid"] = $txnid;
125
+ }
126
+ }
127
+ }
128
+ }
129
}
130
131
return !$isXpaymentsMethod;
132
133
}
134
+
135
+ /**
136
+ * Calculate order action available amount
137
+ * @param array $xpOrderStateData
138
+ * @return float
139
+ */
140
+ public function getCurrentActionAmount($xpOrderStateData){
141
+ $actionAmount = 0.00;
142
+ switch (true) {
143
+ case ($xpOrderStateData["capturedAmountAvailGateway"] > 0 && $xpOrderStateData["refundedAmountAvailGateway"] < 0.01):
144
+ $actionAmount = $xpOrderStateData["capturedAmountAvailGateway"];
145
+ break;
146
+ case ($xpOrderStateData["refundedAmountAvailGateway"] > 0 && $xpOrderStateData["capturedAmountAvailGateway"] < 0.01):
147
+ $actionAmount = $xpOrderStateData["refundedAmountAvailGateway"];
148
+ break;
149
+ }
150
+ return $actionAmount;
151
+ }
152
}
app/code/community/Cdev/XPaymentsConnector/Model/Observer.php CHANGED
@@ -23,7 +23,8 @@
23
* Class Cdev_XPaymentsConnector_Model_Observer
24
*/
25
26
- class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model_Observer {
27
28
public function preDispatchCheckout($observer)
29
{
@@ -50,19 +51,20 @@ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model
50
51
}
52
53
- public function paymentMethodIsActive($observer){
54
$event = $observer->getEvent();
55
$method = $event->getMethodInstance();
56
$result = $event->getResult();
57
$saveCardsPaymentCode = Mage::getModel("xpaymentsconnector/payment_savedcards")->getCode();
58
$prepaidpayments = Mage::getModel("xpaymentsconnector/payment_prepaidpayments")->getCode();
59
60
- if (($method->getCode() == $saveCardsPaymentCode)||($method->getCode() == $prepaidpayments)) {
61
$quote = $event->getQuote();
62
- if($quote){
63
$customerId = $quote->getData("customer_id");
64
$isBalanceCard = Cdev_XPaymentsConnector_Model_Usercards::SIMPLE_CARD;
65
- if($method->getCode() == $prepaidpayments){
66
$isBalanceCard = Cdev_XPaymentsConnector_Model_Usercards::BALANCE_CARD;
67
}
68
if ($customerId) {
@@ -74,8 +76,7 @@ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model
74
if ($cardsCount == 0) {
75
$result->isAvailable = false;
76
}
77
- }
78
- else{
79
$result->isAvailable = false;
80
}
81
}
@@ -137,12 +138,21 @@ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model
137
138
}
139
140
public function orderSuccessAction($observer)
141
{
142
Mage::helper("xpaymentsconnector")->unsetXpaymentPrepareOrder();
143
}
144
145
- public function postdispatchAdminhtmlSalesOrderCreateSave($observer){
146
$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
147
$incrementId = $quote->getData("reserved_order_id");
148
$order = Mage::getModel('sales/order')->load($incrementId, 'increment_id');
@@ -151,23 +161,17 @@ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model
151
$saveCardsPaymentCode = Mage::getModel("xpaymentsconnector/payment_savedcards")->getCode();
152
$prepaidpayments = Mage::getModel("xpaymentsconnector/payment_prepaidpayments")->getCode();
153
154
- if($paymentMethod == $saveCardsPaymentCode){
155
- $xpCreditCards = $admSession->getData("xp_payment_card");
156
$grandTotal = $quote->getData("grand_total");
157
- $response = Mage::getModel("xpaymentsconnector/payment_cc")->sendAgainTransactionRequest($order->getId(),$xpCreditCards,$grandTotal);
158
- if($response["success"]){
159
- Mage::getModel("xpaymentsconnector/payment_cc")->updateOrderByXpaymentResponse($order->getId(),$response["response"]['transaction_id']);
160
- }else{
161
- Mage::getSingleton("adminhtml/session")->addError($response["error_message"]);
162
- }
163
-
164
- }elseif($paymentMethod == $prepaidpayments){
165
$xpPrepaidPaymentsCard = $admSession->getData("xp_prepaid_payments");
166
$currentUserCard = Mage::getModel("xpaymentsconnector/usercards")->load($xpPrepaidPaymentsCard);
167
- $order->setData("xpc_txnid",$currentUserCard->getData("txnId"));
168
$order->getPayment()->setTransactionId($currentUserCard->getData("txnId"));
169
$order->getPayment()->setLastTransId($currentUserCard->getData("txnId"));
170
- $order->setData("xp_card_data",serialize($currentUserCard->getData()));
171
$order->setState(
172
Mage_Sales_Model_Order::STATE_PROCESSING,
173
(bool)Mage_Sales_Model_Order::STATE_PROCESSING,
@@ -180,17 +184,68 @@ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model
180
181
}
182
183
- public function predispatchAdminhtmlSalesOrderCreateSave($observer){
184
$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
185
$paymentMethod = $quote->getPayment()->getMethodInstance()->getCode();
186
$prepaidpayments = Mage::getModel("xpaymentsconnector/payment_prepaidpayments")->getCode();
187
- if($paymentMethod == $prepaidpayments){
188
$admSession = Mage::getSingleton('adminhtml/session');
189
$xpPrepaidPaymentsCard = $admSession->getData("xp_prepaid_payments");
190
$currentUserCard = Mage::getModel("xpaymentsconnector/usercards")->load($xpPrepaidPaymentsCard);
191
$grandTotal = $quote->getData("grand_total");
192
$cardAmount = $currentUserCard->getAmount();
193
- if($cardAmount < $grandTotal){
194
$errorMessage = Mage::helper("xpaymentsconnector")
195
->__("You can't make an order using card (**%s) worth over %s",
196
$currentUserCard->getData("last_4_cc_num"),
@@ -200,11 +255,11 @@ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model
200
Mage::app()->getResponse()->setRedirect($_SERVER['HTTP_REFERER']);
201
Mage::app()->getResponse()->sendResponse();
202
exit;
203
- }else{
204
$cardBalance = $cardAmount - $grandTotal;
205
- if($cardBalance == 0){
206
$currentUserCard->delete();
207
- }else{
208
$currentUserCard->setAmount($cardBalance)->save();
209
}
210
@@ -212,85 +267,89 @@ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model
212
}
213
}
214
215
- public function adminhtmlSavePaymentCard(){
216
$payment = Mage::app()->getRequest()->getPost("payment");
217
$saveCardsPaymentCode = Mage::getModel("xpaymentsconnector/payment_savedcards")->getCode();
218
$prepaidpayments = Mage::getModel("xpaymentsconnector/payment_prepaidpayments")->getCode();
219
220
- if($payment){
221
- if($payment["method"] == $saveCardsPaymentCode){
222
- if($payment["xp_payment_card"]){
223
$admSession = Mage::getSingleton('adminhtml/session');
224
- $admSession->setData("xp_payment_card",$payment["xp_payment_card"]);
225
}
226
- }elseif($payment["method"] == $prepaidpayments){
227
- if($payment["xp_prepaid_payments"]){
228
$admSession = Mage::getSingleton('adminhtml/session');
229
- $admSession->setData("xp_prepaid_payments",$payment["xp_prepaid_payments"]);
230
}
231
}
232
}
233
}
234
235
- public function unsetXpaymentSelectedCard(){
236
$admSession = Mage::getSingleton('adminhtml/session');
237
$admSession->unsetData("xp_payment_card");
238
$admSession->unsetData("xp_prepaid_payments");
239
}
240
241
- public function orderInvoiceSaveBefore($observer){
242
$invoice = $observer->getEvent()->getInvoice();
243
$order = $invoice->getOrder();
244
- $paymentCode = $order->getPayment()->getMethodInstance()->getCode();
245
- if(Mage::helper("xpaymentsconnector")->isXpaymentsMethod($paymentCode)){
246
- $txnid = $order->getData("xpc_txnid");
247
- $invoice->setTransactionId($txnid);
248
- }
249
}
250
251
- public function invoiceVoid($observer){
252
-
253
$invoice = $observer->getInvoice();
254
$order = $invoice->getOrder();
255
- $paymentCode = $order->getPayment()->getMethodInstance()->getCode();
256
- if(Mage::helper("xpaymentsconnector")->isXpaymentsMethod($paymentCode)){
257
$data = array(
258
- 'txnId' => $order->getData("xpc_txnid"),
259
- 'amount' => number_format($invoice->getGrandTotal(), 2, '.',''),
260
);
261
Mage::getModel("xpaymentsconnector/payment_cc")->authorizedTransactionRequest('void', $data);
262
}
263
}
264
265
- public function createOrdersByCustomerSubscriptions($observer){
266
- $xpaymentsHelper = Mage::helper("xpaymentsconnector");
267
$recurringProfileList = Mage::getModel('sales/recurring_profile')
268
- ->getCollection()
269
- ->addFieldToFilter("state",Mage_Sales_Model_Recurring_Profile::STATE_ACTIVE);
270
- if($recurringProfileList->getSize() > 0){
271
- foreach($recurringProfileList as $profile){
272
- $startDateTime = strtotime($profile->getStartDatetime());
273
$lastSuccessTransactionDate = strtotime($profile->getXpSuccessTransactionDate());
274
$lastActionDate = ($startDateTime > $lastSuccessTransactionDate) ? $startDateTime : $lastSuccessTransactionDate;
275
276
$profilePeriodValue = $xpaymentsHelper->getCurrentBillingPeriodTimeStamp($profile);
277
- $newTransactionDate = $lastActionDate+$profilePeriodValue;
278
279
$currentDateObj = new Zend_Date(time());
280
$currentDateStamp = $currentDateObj->getTimestamp();
281
282
//var_dump("current = ".date("Y-m-d H:m:s",$currentDateStamp),"start = ".date("Y-m-d H:m:s",$startDateTime),"last = ".date("Y-m-d H:m:s",$lastActionDate),"new = ".date("Y-m-d H:m:s",$newTransactionDate),"profile_id = ".$profile->getProfileId());die;
283
284
- $timePassed = $currentDateStamp - $lastActionDate;
285
286
- if ($timePassed >= $profilePeriodValue) {
287
// check by count of success transaction
288
$currentSuccessCycles = $profile->getXpCountSuccessTransaction();
289
$periodMaxCycles = $profile->getPeriodMaxCycles();
290
291
- if($periodMaxCycles >= $currentSuccessCycles){
292
$orderItemInfo = $profile->getData("order_item_info");
293
- if(!is_array($orderItemInfo)){
294
$orderItemInfo = unserialize($orderItemInfo);
295
}
296
$grandTotal = $orderItemInfo["nominal_row_total"];
@@ -303,21 +362,21 @@ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model
303
$orderId = $xpaymentsHelper->createOrder($profile);
304
$cardData = $xpaymentsHelper->getProfileOrderCardData($profile);
305
306
- $response = Mage::getModel("xpaymentsconnector/payment_cc")->sendAgainTransactionRequest($orderId, NULL,$grandTotal - $initialFeeAmount + $discountAmount , $cardData);
307
308
if ($response["success"]) {
309
$result = Mage::getModel("xpaymentsconnector/payment_cc")->updateOrderByXpaymentResponse($orderId, $response["response"]['transaction_id']);
310
- $xpaymentsHelper->updateCurrentBillingPeriodTimeStamp($profile, $result["success"],$newTransactionDate);
311
if (!$result["success"]) {
312
- Mage::log($result["error_message"], null, $xpaymentsHelper::XPAYMENTS_LOG_FILE,true);
313
}
314
315
} else {
316
- $xpaymentsHelper->updateCurrentBillingPeriodTimeStamp($profile, $response["success"],$newTransactionDate);
317
- Mage::log($response["error_message"], null, $xpaymentsHelper::XPAYMENTS_LOG_FILE,true);
318
}
319
320
- }else{
321
// Subscription is completed
322
$profile->cancel();
323
@@ -335,14 +394,15 @@ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model
335
* Add redirect for buying recurring product by xpayments method(without iframe)
336
* @param $observer
337
*/
338
- public function addRedirectForXpaymentMethod($observer){
339
$profiles = $observer->getData("recurring_profiles");
340
- if(!empty($profiles)){
341
$profile = current($profiles);
342
$currentPaymentMethodCode = $profile->getData("method_code");
343
$xpaymentPaymentCode = Mage::getModel("xpaymentsconnector/payment_cc")->getCode();
344
$useIframe = Mage::getStoreConfig('payment/xpayments/use_iframe');
345
- if(($currentPaymentMethodCode == $xpaymentPaymentCode) && !$useIframe){
346
$redirectUrl = Mage::getUrl('xpaymentsconnector/processing/redirect', array('_secure' => true));
347
Mage::getSingleton("checkout/session")->setRedirectUrl($redirectUrl);
348
}
@@ -356,7 +416,8 @@ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model
356
* Remove X-Payments token
357
* @param $observer
358
*/
359
- public function updateCartItem($observer){
360
$unsetParams = array("token");
361
Mage::helper("xpaymentsconnector")->unsetXpaymentPrepareOrder($unsetParams);
362
@@ -368,7 +429,8 @@ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model
368
* Remove X-Payments token
369
* @param $observer
370
*/
371
- public function checkoutCartAdd($observer){
372
$unsetParams = array("token");
373
Mage::helper("xpaymentsconnector")->unsetXpaymentPrepareOrder($unsetParams);
374
}
@@ -377,8 +439,9 @@ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model
377
* Remove X-Payments token and prepare order number.
378
* @param $observer
379
*/
380
- public function postdispatchCartDelete($observer){
381
- $unsetParams = array("token","prepare_order_id");
382
Mage::helper("xpaymentsconnector")->unsetXpaymentPrepareOrder($unsetParams);
383
}
384
@@ -387,7 +450,8 @@ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model
387
* Set 'place_display' flag for feature x-payment form.
388
* @param $observer
389
*/
390
- public function predispatchSaveShippingMethod(){
391
Mage::helper("xpaymentsconnector")->setIframePlaceDisplaySettings();
392
}
393
@@ -404,7 +468,8 @@ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model
404
}
405
}
406
407
- public function postDispatchSavePayment($observer){
408
$quote = Mage::getSingleton('checkout/session')->getQuote();
409
$paymentMethodCode = $quote->getPayment()->getMethodInstance()->getCode();
410
$xpaymentPaymentCode = Mage::getModel("xpaymentsconnector/payment_cc")->getCode();
@@ -413,12 +478,12 @@ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model
413
if ($isXpayments) {
414
Mage::helper("xpaymentsconnector")->prepareOrderKey();
415
}
416
- if ($paymentMethodCode == $xpaymentPaymentCode){
417
$saveCard = Mage::app()->getRequest()->getPost("savecard");
418
- if($saveCard){
419
- Mage::getSingleton("checkout/session")->setData("user_card_save",$saveCard);
420
}
421
- }else{
422
Mage::getSingleton("checkout/session")->unsetData("user_card_save");
423
}
424
}
@@ -427,18 +492,64 @@ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model
427
* Set discount for recurring product
428
* @param $observer
429
*/
430
- public function preDispatchCartIndex($observer){
431
$unsetXpPrepareOrder = Mage::app()->getRequest()->getParam("unset_xp_prepare_order");
432
- if(isset($unsetXpPrepareOrder)){
433
$unsetParams = array("token");
434
Mage::helper("xpaymentsconnector")->unsetXpaymentPrepareOrder($unsetParams);
435
}
436
437
438
-
439
//set recurring product discount
440
Mage::helper("xpaymentsconnector")->setRecurringProductDiscount();
441
442
}
443
444
}
23
* Class Cdev_XPaymentsConnector_Model_Observer
24
*/
25
26
+ class Cdev_XPaymentsConnector_Model_Observer extends Mage_CatalogInventory_Model_Observer
27
+ {
28
29
public function preDispatchCheckout($observer)
30
{
51
52
}
53
54
+ public function paymentMethodIsActive($observer)
55
+ {
56
$event = $observer->getEvent();
57
$method = $event->getMethodInstance();
58
$result = $event->getResult();
59
$saveCardsPaymentCode = Mage::getModel("xpaymentsconnector/payment_savedcards")->getCode();
60
$prepaidpayments = Mage::getModel("xpaymentsconnector/payment_prepaidpayments")->getCode();
61
62
+ if (($method->getCode() == $saveCardsPaymentCode) || ($method->getCode() == $prepaidpayments)) {
63
$quote = $event->getQuote();
64
+ if ($quote) {
65
$customerId = $quote->getData("customer_id");
66
$isBalanceCard = Cdev_XPaymentsConnector_Model_Usercards::SIMPLE_CARD;
67
+ if ($method->getCode() == $prepaidpayments) {
68
$isBalanceCard = Cdev_XPaymentsConnector_Model_Usercards::BALANCE_CARD;
69
}
70
if ($customerId) {
76
if ($cardsCount == 0) {
77
$result->isAvailable = false;
78
}
79
+ } else {
80
$result->isAvailable = false;
81
}
82
}
138
139
}
140
141
+
142
+ /**
143
+ * @param Varien_Event_Observer $observer
144
+ */
145
public function orderSuccessAction($observer)
146
{
147
Mage::helper("xpaymentsconnector")->unsetXpaymentPrepareOrder();
148
}
149
150
+
151
+ /**
152
+ * @param Varien_Event_Observer $observer
153
+ */
154
+ public function postdispatchAdminhtmlSalesOrderCreateSave($observer)
155
+ {
156
$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
157
$incrementId = $quote->getData("reserved_order_id");
158
$order = Mage::getModel('sales/order')->load($incrementId, 'increment_id');
161
$saveCardsPaymentCode = Mage::getModel("xpaymentsconnector/payment_savedcards")->getCode();
162
$prepaidpayments = Mage::getModel("xpaymentsconnector/payment_prepaidpayments")->getCode();
163
164
+ if ($paymentMethod == $saveCardsPaymentCode) {
165
+ $orderId = $order->getId();
166
$grandTotal = $quote->getData("grand_total");
167
+ $this->adminhtmlSendSaveCardsPaymentTransaction($orderId,$grandTotal);
168
+ } elseif ($paymentMethod == $prepaidpayments) {
169
$xpPrepaidPaymentsCard = $admSession->getData("xp_prepaid_payments");
170
$currentUserCard = Mage::getModel("xpaymentsconnector/usercards")->load($xpPrepaidPaymentsCard);
171
+ $order->setData("xpc_txnid", $currentUserCard->getData("txnId"));
172
$order->getPayment()->setTransactionId($currentUserCard->getData("txnId"));
173
$order->getPayment()->setLastTransId($currentUserCard->getData("txnId"));
174
+ $order->setData("xp_card_data", serialize($currentUserCard->getData()));
175
$order->setState(
176
Mage_Sales_Model_Order::STATE_PROCESSING,
177
(bool)Mage_Sales_Model_Order::STATE_PROCESSING,
184
185
}
186
187
+
188
+ /**
189
+ * Send transaction to X-Payment for 'order edit' event
190
+ * @param Varien_Event_Observer $observer
191
+ */
192
+ public function postdispatchAdminhtmlSalesOrderEditSave($observer)
193
+ {
194
+ $adminhtmlSessionQuote = Mage::getSingleton('adminhtml/session_quote');
195
+ $parentOrder = $adminhtmlSessionQuote->getOrder();
196
+ $incrementId = $parentOrder->getRelationChildRealId();
197
+
198
+ if($incrementId){
199
+ $order = Mage::getModel('sales/order')->load($incrementId, 'increment_id');
200
+ $paymentMethod = $order->getPayment()->getMethodInstance()->getCode();
201
+ $saveCardsPaymentCode = Mage::getModel('xpaymentsconnector/payment_savedcards')->getCode();
202
+
203
+ if ($paymentMethod == $saveCardsPaymentCode && $order) {
204
+ $orderId = $order->getId();
205
+ $grandTotal = $order->getGrandTotal();
206
+ $parentOrderGrandTotal = $parentOrder->getGrandTotal();
207
+
208
+ if($grandTotal > $parentOrderGrandTotal){
209
+ $checkOrderAmount = false;
210
+ $recalculcateGrandTotal = $grandTotal-$parentOrderGrandTotal;
211
+ $this->adminhtmlSendSaveCardsPaymentTransaction($orderId,$recalculcateGrandTotal,$checkOrderAmount);
212
+ }
213
+ }
214
+ }
215
+ }
216
+
217
+ /**
218
+ * Send transaction from the admin panel
219
+ * @param int $orderId
220
+ * @param float $grandTotal
221
+ * @param bool $checkOrderAmount
222
+ */
223
+ protected function adminhtmlSendSaveCardsPaymentTransaction($orderId,$grandTotal,$checkOrderAmount = true)
224
+ {
225
+ $admSession = Mage::getSingleton('adminhtml/session');
226
+ $xpCreditCards = $admSession->getData("xp_payment_card");
227
+
228
+ $response = Mage::getModel("xpaymentsconnector/payment_cc")->sendAgainTransactionRequest($orderId, $xpCreditCards, $grandTotal);
229
+ if ($response["success"]) {
230
+ Mage::getModel("xpaymentsconnector/payment_cc")->updateOrderByXpaymentResponse($orderId, $response["response"]['transaction_id'],$checkOrderAmount);
231
+ } else {
232
+ Mage::getSingleton("adminhtml/session")->addError($response["error_message"]);
233
+ }
234
+
235
+ }
236
+
237
+ public function predispatchAdminhtmlSalesOrderCreateSave($observer)
238
+ {
239
$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
240
$paymentMethod = $quote->getPayment()->getMethodInstance()->getCode();
241
$prepaidpayments = Mage::getModel("xpaymentsconnector/payment_prepaidpayments")->getCode();
242
+ if ($paymentMethod == $prepaidpayments) {
243
$admSession = Mage::getSingleton('adminhtml/session');
244
$xpPrepaidPaymentsCard = $admSession->getData("xp_prepaid_payments");
245
$currentUserCard = Mage::getModel("xpaymentsconnector/usercards")->load($xpPrepaidPaymentsCard);
246
$grandTotal = $quote->getData("grand_total");
247
$cardAmount = $currentUserCard->getAmount();
248
+ if ($cardAmount < $grandTotal) {
249
$errorMessage = Mage::helper("xpaymentsconnector")
250
->__("You can't make an order using card (**%s) worth over %s",
251
$currentUserCard->getData("last_4_cc_num"),
255
Mage::app()->getResponse()->setRedirect($_SERVER['HTTP_REFERER']);
256
Mage::app()->getResponse()->sendResponse();
257
exit;
258
+ } else {
259
$cardBalance = $cardAmount - $grandTotal;
260
+ if ($cardBalance == 0) {
261
$currentUserCard->delete();
262
+ } else {
263
$currentUserCard->setAmount($cardBalance)->save();
264
}
265
267
}
268
}
269
270
+ public function adminhtmlSavePaymentCard()
271
+ {
272
$payment = Mage::app()->getRequest()->getPost("payment");
273
$saveCardsPaymentCode = Mage::getModel("xpaymentsconnector/payment_savedcards")->getCode();
274
$prepaidpayments = Mage::getModel("xpaymentsconnector/payment_prepaidpayments")->getCode();
275
276
+ if ($payment) {
277
+ if ($payment["method"] == $saveCardsPaymentCode) {
278
+ if ($payment["xp_payment_card"]) {
279
$admSession = Mage::getSingleton('adminhtml/session');
280
+ $admSession->setData("xp_payment_card", $payment["xp_payment_card"]);
281
}
282
+ } elseif ($payment["method"] == $prepaidpayments) {
283
+ if ($payment["xp_prepaid_payments"]) {
284
$admSession = Mage::getSingleton('adminhtml/session');
285
+ $admSession->setData("xp_prepaid_payments", $payment["xp_prepaid_payments"]);
286
}
287
}
288
}
289
}
290
291
+ public function unsetXpaymentSelectedCard()
292
+ {
293
$admSession = Mage::getSingleton('adminhtml/session');
294
$admSession->unsetData("xp_payment_card");
295
$admSession->unsetData("xp_prepaid_payments");
296
}
297
298
+ public function orderInvoiceSaveBefore($observer)
299
+ {
300
$invoice = $observer->getEvent()->getInvoice();
301
$order = $invoice->getOrder();
302
+ $paymentCode = $order->getPayment()->getMethodInstance()->getCode();
303
+ if (Mage::helper("xpaymentsconnector")->isXpaymentsMethod($paymentCode)) {
304
+ $txnid = $order->getData("xpc_txnid");
305
+ $invoice->setTransactionId($txnid);
306
+ }
307
}
308
309
+ public function invoiceVoid($observer)
310
+ {
311
$invoice = $observer->getInvoice();
312
$order = $invoice->getOrder();
313
+ $paymentCode = $order->getPayment()->getMethodInstance()->getCode();
314
+ if (Mage::helper("xpaymentsconnector")->isXpaymentsMethod($paymentCode)) {
315
$data = array(
316
+ 'txnId' => $order->getData("xpc_txnid"),
317
+ 'amount' => number_format($invoice->getGrandTotal(), 2, '.', ''),
318
);
319
Mage::getModel("xpaymentsconnector/payment_cc")->authorizedTransactionRequest('void', $data);
320
}
321
}
322
323
+ public function createOrdersByCustomerSubscriptions($observer)
324
+ {
325
+ $xpaymentsHelper = Mage::helper("xpaymentsconnector");
326
$recurringProfileList = Mage::getModel('sales/recurring_profile')
327
+ ->getCollection()
328
+ ->addFieldToFilter("state", Mage_Sales_Model_Recurring_Profile::STATE_ACTIVE);
329
+ if ($recurringProfileList->getSize() > 0) {
330
+ foreach ($recurringProfileList as $profile) {
331
+ $startDateTime = strtotime($profile->getStartDatetime());
332
$lastSuccessTransactionDate = strtotime($profile->getXpSuccessTransactionDate());
333
$lastActionDate = ($startDateTime > $lastSuccessTransactionDate) ? $startDateTime : $lastSuccessTransactionDate;
334
335
$profilePeriodValue = $xpaymentsHelper->getCurrentBillingPeriodTimeStamp($profile);
336
+ $newTransactionDate = $lastActionDate + $profilePeriodValue;
337
338
$currentDateObj = new Zend_Date(time());
339
$currentDateStamp = $currentDateObj->getTimestamp();
340
341
//var_dump("current = ".date("Y-m-d H:m:s",$currentDateStamp),"start = ".date("Y-m-d H:m:s",$startDateTime),"last = ".date("Y-m-d H:m:s",$lastActionDate),"new = ".date("Y-m-d H:m:s",$newTransactionDate),"profile_id = ".$profile->getProfileId());die;
342
343
+ $timePassed = $currentDateStamp - $lastActionDate;
344
345
+ if ($timePassed >= $profilePeriodValue) {
346
// check by count of success transaction
347
$currentSuccessCycles = $profile->getXpCountSuccessTransaction();
348
$periodMaxCycles = $profile->getPeriodMaxCycles();
349
350
+ if ($periodMaxCycles >= $currentSuccessCycles) {
351
$orderItemInfo = $profile->getData("order_item_info");
352
+ if (!is_array($orderItemInfo)) {
353
$orderItemInfo = unserialize($orderItemInfo);
354
}
355
$grandTotal = $orderItemInfo["nominal_row_total"];
362
$orderId = $xpaymentsHelper->createOrder($profile);
363
$cardData = $xpaymentsHelper->getProfileOrderCardData($profile);
364
365
+ $response = Mage::getModel("xpaymentsconnector/payment_cc")->sendAgainTransactionRequest($orderId, NULL, $grandTotal - $initialFeeAmount + $discountAmount, $cardData);
366
367
if ($response["success"]) {
368
$result = Mage::getModel("xpaymentsconnector/payment_cc")->updateOrderByXpaymentResponse($orderId, $response["response"]['transaction_id']);
369
+ $xpaymentsHelper->updateCurrentBillingPeriodTimeStamp($profile, $result["success"], $newTransactionDate);
370
if (!$result["success"]) {
371
+ Mage::log($result["error_message"], null, $xpaymentsHelper::XPAYMENTS_LOG_FILE, true);
372
}
373
374
} else {
375
+ $xpaymentsHelper->updateCurrentBillingPeriodTimeStamp($profile, $response["success"], $newTransactionDate);
376
+ Mage::log($response["error_message"], null, $xpaymentsHelper::XPAYMENTS_LOG_FILE, true);
377
}
378
379
+ } else {
380
// Subscription is completed
381
$profile->cancel();
382
394
* Add redirect for buying recurring product by xpayments method(without iframe)
395
* @param $observer
396
*/
397
+ public function addRedirectForXpaymentMethod($observer)
398
+ {
399
$profiles = $observer->getData("recurring_profiles");
400
+ if (!empty($profiles)) {
401
$profile = current($profiles);
402
$currentPaymentMethodCode = $profile->getData("method_code");
403
$xpaymentPaymentCode = Mage::getModel("xpaymentsconnector/payment_cc")->getCode();
404
$useIframe = Mage::getStoreConfig('payment/xpayments/use_iframe');
405
+ if (($currentPaymentMethodCode == $xpaymentPaymentCode) && !$useIframe) {
406
$redirectUrl = Mage::getUrl('xpaymentsconnector/processing/redirect', array('_secure' => true));
407
Mage::getSingleton("checkout/session")->setRedirectUrl($redirectUrl);
408
}
416
* Remove X-Payments token
417
* @param $observer
418
*/
419
+ public function updateCartItem($observer)
420
+ {
421
$unsetParams = array("token");
422
Mage::helper("xpaymentsconnector")->unsetXpaymentPrepareOrder($unsetParams);
423
429
* Remove X-Payments token
430
* @param $observer
431
*/
432
+ public function checkoutCartAdd($observer)
433
+ {
434
$unsetParams = array("token");
435
Mage::helper("xpaymentsconnector")->unsetXpaymentPrepareOrder($unsetParams);
436
}
439
* Remove X-Payments token and prepare order number.
440
* @param $observer
441
*/
442
+ public function postdispatchCartDelete($observer)
443
+ {
444
+ $unsetParams = array("token", "prepare_order_id");
445
Mage::helper("xpaymentsconnector")->unsetXpaymentPrepareOrder($unsetParams);
446
}
447
450
* Set 'place_display' flag for feature x-payment form.
451
* @param $observer
452
*/
453
+ public function predispatchSaveShippingMethod()
454
+ {
455
Mage::helper("xpaymentsconnector")->setIframePlaceDisplaySettings();
456
}
457
468
}
469
}
470
471
+ public function postDispatchSavePayment($observer)
472
+ {
473
$quote = Mage::getSingleton('checkout/session')->getQuote();
474
$paymentMethodCode = $quote->getPayment()->getMethodInstance()->getCode();
475
$xpaymentPaymentCode = Mage::getModel("xpaymentsconnector/payment_cc")->getCode();
478
if ($isXpayments) {
479
Mage::helper("xpaymentsconnector")->prepareOrderKey();
480
}
481
+ if ($paymentMethodCode == $xpaymentPaymentCode) {
482
$saveCard = Mage::app()->getRequest()->getPost("savecard");
483
+ if ($saveCard) {
484
+ Mage::getSingleton("checkout/session")->setData("user_card_save", $saveCard);
485
}
486
+ } else {
487
Mage::getSingleton("checkout/session")->unsetData("user_card_save");
488
}
489
}
492
* Set discount for recurring product
493
* @param $observer
494
*/
495
+ public function preDispatchCartIndex($observer)
496
+ {
497
$unsetXpPrepareOrder = Mage::app()->getRequest()->getParam("unset_xp_prepare_order");
498
+ if (isset($unsetXpPrepareOrder)) {
499
$unsetParams = array("token");
500
Mage::helper("xpaymentsconnector")->unsetXpaymentPrepareOrder($unsetParams);
501
}
502
503
504
//set recurring product discount
505
Mage::helper("xpaymentsconnector")->setRecurringProductDiscount();
506
507
}
508
509
+
510
+ /**
511
+ * Send xp transaction from 'XP Order State tab'
512
+ * @param $observer
513
+ */
514
+ public function adminhtmlSalesOrderView($observer){
515
+ $xpTransactionData = Mage::app()->getRequest()->getPost();
516
+ if(!empty($xpTransactionData)){
517
+
518
+ if(!empty($xpTransactionData)
519
+ && isset($xpTransactionData['xpaction'])
520
+ && isset($xpTransactionData["xpc_txnid"])
521
+ && isset($xpTransactionData["transaction_amount"])
522
+ ){
523
+
524
+ $xpaymentModel = Mage::getModel("xpaymentsconnector/payment_cc");
525
+ $data = array(
526
+ 'txnId' => $xpTransactionData["xpc_txnid"],
527
+ 'amount' => number_format($xpTransactionData["transaction_amount"], 2, '.', ''),
528
+ );
529
+ $result = array();
530
+ switch ($xpTransactionData['xpaction']) {
531
+ case 'refund':
532
+ $result = $xpaymentModel->authorizedTransactionRequest('refund', $data);
533
+ break;
534
+ case 'capture':
535
+ $result = $xpaymentModel->authorizedTransactionRequest('capture', $data);
536
+ break;
537
+ case 'void':
538
+ $result = $xpaymentModel->authorizedTransactionRequest('void', $data);
539
+ break;
540
+ }
541
+
542
+ if(empty($result['error_message'])){
543
+ $message = Mage::helper("xpaymentsconnector")->__("Transaction '%s' to order (%s) was successful!",
544
+ $xpTransactionData['xpaction'],
545
+ $xpTransactionData['orderid']);
546
+ Mage::getSingleton('adminhtml/session')->addSuccess($message);
547
+ } else{
548
+ Mage::getSingleton('adminhtml/session')->addError($result['error_message']);
549
+ }
550
+
551
+ }
552
+ }
553
+ }
554
+
555
}
app/code/community/Cdev/XPaymentsConnector/Model/Payment/Cc.php CHANGED
@@ -1636,8 +1636,14 @@ class Cdev_XPaymentsConnector_Model_Payment_Cc extends Mage_Payment_Model_Method
1636
return $result;
1637
}
1638
1639
-
1640
- public function updateOrderByXpaymentResponse($orderId,$txnid){
1641
$result = array();
1642
$order = Mage::getModel('sales/order')->load($orderId);
1643
$order->setData('xpc_txnid', $txnid);
@@ -1655,7 +1661,7 @@ class Cdev_XPaymentsConnector_Model_Payment_Cc extends Mage_Payment_Model_Method
1655
}
1656
*/
1657
/**/
1658
- if ($response['amount'] != number_format($order->getGrandTotal(), 2, '.','')) {
1659
1660
// Total wrong
1661
Mage::log(
@@ -1762,9 +1768,10 @@ class Cdev_XPaymentsConnector_Model_Payment_Cc extends Mage_Payment_Model_Method
1762
list($status, $response) = $this->request('payment', $action, $data);
1763
1764
//****************stop*****************//
1765
- if ( $status && (!empty($response['error_message']))) {
1766
Mage::throwException(Mage::helper('sales')->__($response['error_message']));
1767
- }
1768
1769
}
1770
1636
return $result;
1637
}
1638
1639
+ /**
1640
+ * Update order data by xpayment response data
1641
+ * @param int $orderId
1642
+ * @param string $txnid
1643
+ * @param bool $checkOrderAmount
1644
+ * @return array
1645
+ */
1646
+ public function updateOrderByXpaymentResponse($orderId,$txnid,$checkOrderAmount = true){
1647
$result = array();
1648
$order = Mage::getModel('sales/order')->load($orderId);
1649
$order->setData('xpc_txnid', $txnid);
1661
}
1662
*/
1663
/**/
1664
+ if ($response['amount'] != number_format($order->getGrandTotal(), 2, '.','') && $checkOrderAmount) {
1665
1666
// Total wrong
1667
Mage::log(
1768
list($status, $response) = $this->request('payment', $action, $data);
1769
1770
//****************stop*****************//
1771
+ /*if ( $status && (!empty($response['error_message']))) {
1772
Mage::throwException(Mage::helper('sales')->__($response['error_message']));
1773
+ }*/
1774
+ return $response;
1775
1776
}
1777
app/code/community/Cdev/XPaymentsConnector/etc/config.xml CHANGED
@@ -161,6 +161,17 @@
161
</paymentfilter_payment_method_is_active>
162
</observers>
163
</payment_method_is_active>
164
<controller_action_postdispatch_adminhtml_sales_order_create_save>
165
<observers>
166
<xpaymentsconnector>
@@ -179,6 +190,16 @@
179
</xpaymentsconnector>
180
</observers>
181
</controller_action_predispatch_adminhtml_sales_order_create_save>
182
<controller_action_predispatch_adminhtml_sales_order_create_index>
183
<observers>
184
<xpaymentsconnector>
@@ -188,6 +209,16 @@
188
</xpaymentsconnector>
189
</observers>
190
</controller_action_predispatch_adminhtml_sales_order_create_index>
191
<controller_action_postdispatch_adminhtml_sales_order_create_loadBlock>
192
<observers>
193
<xpaymentsconnector>
161
</paymentfilter_payment_method_is_active>
162
</observers>
163
</payment_method_is_active>
164
+ <!--send xp transaction from 'XP Order State tab'-->
165
+ <controller_action_predispatch_adminhtml_sales_order_view>
166
+ <observers>
167
+ <xpaymentsconnector>
168
+ <type>singleton</type>
169
+ <class>Cdev_XPaymentsConnector_Model_Observer</class>
170
+ <method>adminhtmlSalesOrderView</method>
171
+ </xpaymentsconnector>
172
+ </observers>
173
+ </controller_action_predispatch_adminhtml_sales_order_view>
174
+
175
<controller_action_postdispatch_adminhtml_sales_order_create_save>
176
<observers>
177
<xpaymentsconnector>
190
</xpaymentsconnector>
191
</observers>
192
</controller_action_predispatch_adminhtml_sales_order_create_save>
193
+ <!--add x-payments transaction for 'admin order edit' event -->
194
+ <controller_action_postdispatch_adminhtml_sales_order_edit_save>
195
+ <observers>
196
+ <xpaymentsconnector>
197
+ <type>singleton</type>
198
+ <class>Cdev_XPaymentsConnector_Model_Observer</class>
199
+ <method>postdispatchAdminhtmlSalesOrderEditSave</method>
200
+ </xpaymentsconnector>
201
+ </observers>
202
+ </controller_action_postdispatch_adminhtml_sales_order_edit_save>
203
<controller_action_predispatch_adminhtml_sales_order_create_index>
204
<observers>
205
<xpaymentsconnector>
209
</xpaymentsconnector>
210
</observers>
211
</controller_action_predispatch_adminhtml_sales_order_create_index>
212
+ <!--save selected x-payment card on admin side -->
213
+ <controller_action_postdispatch_adminhtml_sales_order_edit_loadBlock>
214
+ <observers>
215
+ <xpaymentsconnector>
216
+ <type>singleton</type>
217
+ <class>Cdev_XPaymentsConnector_Model_Observer</class>
218
+ <method>adminhtmlSavePaymentCard</method>
219
+ </xpaymentsconnector>
220
+ </observers>
221
+ </controller_action_postdispatch_adminhtml_sales_order_edit_loadBlock>
222
<controller_action_postdispatch_adminhtml_sales_order_create_loadBlock>
223
<observers>
224
<xpaymentsconnector>
app/code/community/Cdev/XPaymentsConnector_old.tar DELETED
Binary file
app/design/adminhtml/default/default/layout/xpaymentsconnector.xml CHANGED
@@ -52,6 +52,18 @@
52
</adminhtml_sales_order_create_index>
53
54
<adminhtml_sales_order_view>
55
<reference name="sales_order_tabs">
56
<action method="addTab">
57
<name>xp_order_state</name>
52
</adminhtml_sales_order_create_index>
53
54
<adminhtml_sales_order_view>
55
+ <reference name="head">
56
+ <action method="addItem">
57
+ <type>js</type>
58
+ <name>xpayment/backend-xpayment.js</name>
59
+ <params/>
60
+ </action>
61
+ <action method="addItem">
62
+ <type>js_css</type>
63
+ <name>xpayment/settings.css</name>
64
+ <params/>
65
+ </action>
66
+ </reference>
67
<reference name="sales_order_tabs">
68
<action method="addTab">
69
<name>xp_order_state</name>
app/design/adminhtml/default/default/template/xpaymentsconnector/order/view/tab/xporderstate.phtml CHANGED
@@ -29,156 +29,238 @@
29
30
<?php $xpaymentsOrderInfo = $this->getXpaymentsOrderInfo(); ?>
31
<?php if($xpaymentsOrderInfo["success"]): ?>
32
- <?php $xpaymentOrderState = $xpaymentsOrderInfo["info"]["payment"];?>
33
- <?php $xpaymentOrdertransactionsList = $xpaymentsOrderInfo["info"]["transactions"]; ?>
34
- <div class="entry-edit">
35
- <div class="entry-edit-head">
36
- <h4><?php echo $this->__('Transaction list'); ?></h4>
37
- </div>
38
39
- <div class="grid np">
40
- <div class="hor-scroll">
41
- <table cellspacing="0" id="xpayment-transaction-list" class="data order-tables">
42
- <colgroup>
43
- <col />
44
- <col />
45
- <col width="1">
46
- <col width="1">
47
- <col width="1">
48
- <col width="1">
49
- <col width="1">
50
- </colgroup><thead>
51
- <tr class="headings">
52
- <th><span class="nobr"><?php echo $this->__('Additional info'); ?></span></th>
53
- <th><span class="nobr"><?php echo $this->__('Date, time'); ?></span></th>
54
- <th><span class="nobr"><?php echo $this->__('Type'); ?></span></th>
55
- <th><span class="nobr"><?php echo $this->__('Result payment status'); ?></span></th>
56
- <th class="last"><span class="nobr"><?php echo $this->__('Transaction result'); ?></span></th>
57
- <th class="last"><span class="nobr"><?php echo $this->__('Total'); ?></span></th>
58
- </tr>
59
- </thead>
60
- <tbody>
61
- <?php $rowClass = "odd";?>
62
- <?php foreach($xpaymentOrdertransactionsList as $key => $transaction):?>
63
- <?php $rowClass = ($key%2==0)?"even":"odd"; ?>
64
- <tr class="border pointer <?php echo $rowClass?>">
65
- <td>
66
- <div class="item-container" >
67
- <table cellspacing="0" class="form-list">
68
- <tbody>
69
- <?php foreach($transaction["fields"] as $field): ?>
70
- <tr>
71
- <td class="label"><label><?php echo $field["name"]?></label></td>
72
- <td class="value"><strong><?php echo $field["value"]?></strong></td>
73
- </tr>
74
- <?php endforeach; ?>
75
- </tbody>
76
- </table>
77
- </div>
78
- </td>
79
- <td>
80
- <div class="item-container">
81
- <div class="item-text">
82
- <strong>
83
- <?php echo date("M d,Y H:i:s",$transaction["date"]);?>
84
- </strong>
85
- </div>
86
- </div>
87
- </td>
88
- <td class="a-center">
89
- <span class="price">
90
- <strong>
91
- <?php echo $transaction["action"];?>
92
- </strong>
93
- </span></td>
94
- <td class="a-center">
95
- <span class="price">
96
- <?php echo $transaction["payment_status"];?>
97
- </span>
98
- </td>
99
- <td class="a-center">
100
- <span class="price">
101
- <?php echo $transaction["status"];?>
102
- </span>
103
- </td>
104
- <td class="a-center">
105
- <span class="price">
106
- <strong>
107
- <?php echo $transaction["total"];?>
108
- </strong>
109
- </span>
110
- </td>
111
</tr>
112
- <?php endforeach;?>
113
- </tbody>
114
- </table>
115
- </div>
116
</div>
117
- </div>
118
119
- <p>
120
- <br />
121
- <br />
122
- <div class="entry-edit">
123
- <div class="entry-edit-head">
124
- <h4><?php echo $this->__('Order state'); ?></h4>
125
- </div>
126
127
- <div class="grid">
128
- <div class="hor-scroll">
129
- <table cellspacing="0" class="data order-tables">
130
- <colgroup><col>
131
- <col width="1">
132
- <col width="1">
133
- <col width="1">
134
- <col width="1">
135
- </colgroup><thead>
136
- <tr class="headings">
137
- <th><span class="nobr"><?php echo $this->__('Amount'); ?></span></th>
138
- <th><span class="nobr"><?php echo $this->__('Authorized'); ?></span></th>
139
- <th><span class="nobr"><?php echo $this->__('Captured'); ?></span></th>
140
- <th class="last"><span class="nobr"><?php echo $this->__('Refunds'); ?></span></th>
141
- </tr>
142
- </thead>
143
- <tbody class="even">
144
- <tr class="border">
145
- <td>
146
- <div class="item-container" id="order_item_446">
147
- <div class="item-text">
148
- <?php if(!empty($xpaymentOrderState["message"])): ?>
149
- <h5 class="title">
150
- <span id="order_title">
151
- <?php echo $this->__($xpaymentOrderState["message"]);?>
152
- </span></h5>
153
- <?php endif;?>
154
- <span class="price">
155
- <?php echo Mage::helper('core')->currency($xpaymentOrderState["amount"], true, false);?>
156
- </span>
157
- </div>
158
- </div>
159
- </td>
160
- <td class="a-center">
161
- <span class="price">
162
- <?php echo Mage::helper('core')->currency($xpaymentOrderState["authorized"], true, false);?>
163
- </span></td>
164
- <td class="a-center">
165
- <span class="price">
166
- <?php echo Mage::helper('core')->currency($xpaymentOrderState["capturedAmount"], true, false);?>
167
- </span>
168
- </td>
169
- <td class="a-center">
170
- <span class="price">
171
- <?php echo Mage::helper('core')->currency($xpaymentOrderState["refundedAmount"], true, false);?>
172
- </span>
173
- </td>
174
- </tr>
175
176
- </tbody>
177
- </table>
178
</div>
179
- </div>
180
- </div>
181
- </p>
182
183
<?php else: ?>
184
<?php echo $xpaymentsOrderInfo["error_message"];?>
29
30
<?php $xpaymentsOrderInfo = $this->getXpaymentsOrderInfo(); ?>
31
<?php if($xpaymentsOrderInfo["success"]): ?>
32
+ <?php $xpaymentOrdersInfoList = $xpaymentsOrderInfo["info"];?>
33
+ <?php foreach($xpaymentOrdersInfoList as $orderIncrementId => $xpaymentOrderInfoData): ?>
34
+ <?php $xpaymentOrdersState[$orderIncrementId] = $xpaymentOrderInfoData["payment"];?>
35
+ <?php $xpaymentOrdertransactionsList = $xpaymentOrderInfoData["transactions"]; ?>
36
+ <div class="entry-edit">
37
+ <div class="entry-edit-head xp-transaction-head-block">
38
+ <h4><?php echo $this->__("Transaction list for order %s",$orderIncrementId);?></h4>
39
+ <span class="transaction-accordion">
40
+ <span class="transaction-down" >
41
+ <img src="<?php echo Mage::getBaseUrl('js') . "xpayment/images/arrow-down.png" ?>">
42
+ </span>
43
+ <span class="transaction-up" style="display: none">
44
+ <img src="<?php echo Mage::getBaseUrl('js') . "xpayment/images/arrow-up.png" ?>">
45
+ </span>
46
+ </span>
47
+ </div>
48
49
+ <div class="grid np" style="display: none">
50
+ <div class="hor-scroll">
51
+ <table cellspacing="0" id="xpayment-transaction-list" class="data order-tables">
52
+ <colgroup>
53
+ <col />
54
+ <col />
55
+ <col width="1">
56
+ <col width="1">
57
+ <col width="1">
58
+ <col width="1">
59
+ <col width="1">
60
+ </colgroup><thead>
61
+ <tr class="headings">
62
+ <th><span class="nobr"><?php echo $this->__('Additional info'); ?></span></th>
63
+ <th><span class="nobr"><?php echo $this->__('Date, time'); ?></span></th>
64
+ <th><span class="nobr"><?php echo $this->__('Type'); ?></span></th>
65
+ <th><span class="nobr"><?php echo $this->__('Result payment status'); ?></span></th>
66
+ <th class="last"><span class="nobr"><?php echo $this->__('Transaction result'); ?></span></th>
67
+ <th class="last"><span class="nobr"><?php echo $this->__('Total'); ?></span></th>
68
</tr>
69
+ </thead>
70
+ <tbody>
71
+ <?php $rowClass = "odd";?>
72
+ <?php foreach($xpaymentOrdertransactionsList as $key => $transaction):?>
73
+ <?php $rowClass = ($key%2==0)?"even":"odd"; ?>
74
+ <tr class="border pointer <?php echo $rowClass?>">
75
+ <td>
76
+ <div class="item-container" >
77
+ <table cellspacing="0" class="form-list">
78
+ <tbody>
79
+ <?php foreach($transaction["fields"] as $field): ?>
80
+ <tr>
81
+ <td class="label"><label><?php echo $field["name"]?></label></td>
82
+ <td class="value"><strong><?php echo $field["value"]?></strong></td>
83
+ </tr>
84
+ <?php endforeach; ?>
85
+ </tbody>
86
+ </table>
87
+ </div>
88
+ </td>
89
+ <td>
90
+ <div class="item-container">
91
+ <div class="item-text">
92
+ <strong>
93
+ <?php echo date("M d,Y H:i:s",$transaction["date"]);?>
94
+ </strong>
95
+ </div>
96
+ </div>
97
+ </td>
98
+ <td class="a-center">
99
+ <span class="price">
100
+ <strong>
101
+ <?php echo $transaction["action"];?>
102
+ </strong>
103
+ </span></td>
104
+ <td class="a-center">
105
+ <span class="price">
106
+ <?php echo $transaction["payment_status"];?>
107
+ </span>
108
+ </td>
109
+ <td class="a-center">
110
+ <span class="price">
111
+ <?php echo $transaction["status"];?>
112
+ </span>
113
+ </td>
114
+ <td class="a-center">
115
+ <span class="price">
116
+ <strong>
117
+ <?php echo $transaction["total"];?>
118
+ </strong>
119
+ </span>
120
+ </td>
121
+ </tr>
122
+ <?php endforeach;?>
123
+ </tbody>
124
+ </table>
125
+ </div>
126
+ </div>
127
</div>
128
+ <br/>
129
+ <?php endforeach;?>
130
+ <?php if (!empty($xpaymentOrdersState)): ?>
131
+ <p>
132
+ <div class="entry-edit">
133
+ <div class="entry-edit-head">
134
+ <h4><?php echo $this->__('Order(s) state'); ?></h4>
135
+ </div>
136
137
+ <div class="grid">
138
+ <div class="hor-scroll">
139
+ <table cellspacing="0" class="data order-tables">
140
+ <colgroup>
141
+ <col>
142
+ <col width="1">
143
+ <col width="1">
144
+ <col width="1">
145
+ <col width="1">
146
+ </colgroup>
147
+ <thead>
148
+ <tr class="headings">
149
+ <th><span class="nobr"><?php echo $this->__('Order ID'); ?></span></th>
150
+ <th><span class="nobr"><?php echo $this->__('Amount'); ?></span></th>
151
+ <th><span class="nobr"><?php echo $this->__('Authorized'); ?></span></th>
152
+ <th><span class="nobr"><?php echo $this->__('Captured'); ?></span></th>
153
+ <th class="last"><span class="nobr"><?php echo $this->__('Refunds'); ?></span></th>
154
+ <th class="last"><span class="nobr"><?php echo $this->__('Actions'); ?></span></th>
155
+ </tr>
156
+ </thead>
157
+ <tbody class="even">
158
+ <?php foreach ($xpaymentOrdersState as $orderIncrementId => $orderStateData): ?>
159
+ <tr class="border">
160
+ <td>
161
+ <div class="item-text">
162
+ <?php echo $orderIncrementId;?>
163
+ </div>
164
+ </td>
165
+ <td>
166
+ <div class="item-container" id="order_item_446">
167
+ <div class="item-text">
168
+ <?php if (!empty($orderStateData["message"])): ?>
169
+ <h5 class="title">
170
+ <span id="order_title">
171
+ <?php echo $this->__($orderStateData["message"]); ?>
172
+ </span></h5>
173
+ <?php endif; ?>
174
+ <span class="price">
175
+ <?php echo Mage::helper('core')->currency($orderStateData["amount"], true, false); ?>
176
+ </span>
177
+ </div>
178
+ </div>
179
+ </td>
180
+ <td class="a-center">
181
+ <span class="price">
182
+ <?php echo Mage::helper('core')->currency($orderStateData["authorized"], true, false); ?>
183
+ </span></td>
184
+ <td class="a-center">
185
+ <span class="price">
186
+ <?php echo Mage::helper('core')->currency($orderStateData["capturedAmount"], true, false); ?>
187
+ </span>
188
+ </td>
189
+ <td class="a-center">
190
+ <span class="price">
191
+ <?php echo Mage::helper('core')->currency($orderStateData["refundedAmount"], true, false); ?>
192
+ </span>
193
+ </td>
194
+ <td>
195
+ <div class="item-text">
196
+ <?php
197
+ $actionAmount = $this->getCurrentActionAmount($orderStateData);
198
+ $cssFormId = "xp_fast_transactions_".$orderIncrementId;
199
+ $amountValidatorName = "validate-transaction-amount_".$orderIncrementId;
200
+ $requiredValidatorName = "required-entry_".$orderIncrementId;
201
+ $currentUrl = Mage::helper('core/url')->getCurrentUrl();
202
+ $formKey = Mage::getSingleton('core/session')->getFormKey();
203
+ ?>
204
205
+ <form method="post" id="<?php echo $cssFormId?>" class="xp_fast_transactions" action="<?php echo $currentUrl;?>" >
206
+ <input type="hidden" name="form_key" value="<?php echo $formKey; ?>" />
207
+ <input type="text"
208
+ class="<?php echo $amountValidatorName." ".$requiredValidatorName;?> input-text transaction-amount"
209
+ name="transaction_amount"
210
+ value="<?php echo $actionAmount?>">
211
212
+ <input type="hidden" name="orderid" value="<?php echo $orderIncrementId;?>">
213
+ <input type="hidden" name="xpc_txnid" value="<?php echo $orderStateData['xpc_txnid'];?>">
214
+ <input type="hidden" name="xpaction" class="xpaction" value="">
215
+ <?php if($orderStateData["capturedAmountAvailGateway"] > 0): ?>
216
+ <input type="button"
217
+ class="form-button xp-transaction-submit"
218
+ name="capture"
219
+ onclick="submitXpTransaction(
220
+ 'capture',
221
+ '<?php echo $cssFormId?>',
222
+ '<?php echo $amountValidatorName?>',
223
+ '<?php echo $requiredValidatorName?>')"
224
+ value="Capture">
225
+ </br>
226
+ <?endif;?>
227
+ <?php if($orderStateData["voidedAmountAvailGateway"] > 0): ?>
228
+ <input type="button"
229
+ class="form-button xp-transaction-submit"
230
+ name="void"
231
+ onclick="submitXpTransaction(
232
+ 'void',
233
+ '<?php echo $cssFormId?>',
234
+ '<?php echo $amountValidatorName?>',
235
+ '<?php echo $requiredValidatorName?>',
236
+ '<?php echo $orderStateData["voidedAmountAvailGateway"]?>')"
237
+ class="form-button "
238
+ value="Void (<?php echo Mage::helper('core')->currency($orderStateData["voidedAmountAvailGateway"], true, false);?>)">
239
+ <?endif;?>
240
+ <?php if($orderStateData["refundedAmountAvailGateway"] > 0): ?>
241
+ <input
242
+ type="button"
243
+ name="refund"
244
+ class="form-button"
245
+ onclick="submitXpTransaction(
246
+ 'refund',
247
+ '<?php echo $cssFormId?>',
248
+ '<?php echo $amountValidatorName?>',
249
+ '<?php echo $requiredValidatorName?>')"
250
+ value="Refund">
251
+ <?endif;?>
252
+ </form>
253
+ </div>
254
+ </td>
255
+ </tr>
256
+ <?endforeach?>
257
+ </tbody>
258
+ </table>
259
+ </div>
260
+ </div>
261
</div>
262
+ </p>
263
+ <?php endif?>
264
265
<?php else: ?>
266
<?php echo $xpaymentsOrderInfo["error_message"];?>
js/xpayment/backend-xpayment.js ADDED
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Magento
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Open Software License (OSL 3.0)
7
+ * that is bundled with this package in the file LICENSE.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magentocommerce.com so we can send you a copy immediately.
13
+ *
14
+ * @author Valerii Demidov
15
+ * @category Cdev
16
+ * @package Cdev_XPaymentsConnector
17
+ * @copyright (c) Qualiteam Software Ltd. <info@qtmsoft.com>. All rights reserved.
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+
22
+ /**
23
+ *
24
+ * @param formName
25
+ * @param amountValidatorName
26
+ * @param requiredValidatorName
27
+ */
28
+ function submitXpTransaction(action,formName,amountValidatorName,requiredValidatorName,amount) {
29
+ Validation.add(amountValidatorName,'Please enter a valid amount. For example 100.00.',function(v){
30
+ return Validation.get('IsEmpty').test(v) || /^([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)#x2F;.test(v);
31
+ });
32
+ Validation.add(requiredValidatorName,'This is a required field.',function(v){
33
+ return !Validation.get('IsEmpty').test(v);
34
+ });
35
+
36
+ var xpTransactionForm = new varienForm(formName);
37
+ $(formName).down('.xpaction').value = action;
38
+ if (action == "void") {
39
+ $(formName).down('.transaction-amount').value = amount;
40
+ xpTransactionForm.submit();
41
+ } else {
42
+ if (xpTransactionForm.validator.validate()) {
43
+ xpTransactionForm.submit();
44
+ }
45
+ }
46
+
47
+
48
+ };
49
+
50
+ document.observe("dom:loaded", function () {
51
+
52
+ $('.xp-transaction-head-block').each(function(element) {
53
+ element.on("click", function(event) {
54
+ var grid = $(this).up('.entry-edit');
55
+
56
+ if ( $(grid).down('.grid').getStyle('display') === 'none'){
57
+ $(grid).down('.grid').show();
58
+
59
+ $(grid).down('.transaction-down').hide();
60
+ $(grid).down('.transaction-up').show();
61
+ } else {
62
+ $(grid).down('.grid').hide();
63
+
64
+ $(grid).down('.transaction-down').show();
65
+ $(grid).down('.transaction-up').hide();
66
+ }
67
+
68
+ });
69
+ });
70
+
71
+ });
72
+
js/xpayment/images/arrow-down.png ADDED
Binary file
js/xpayment/images/arrow-up.png ADDED
Binary file
js/xpayment/settings.css CHANGED
@@ -441,5 +441,16 @@ iframe .buttonRow {
441
#new-card-block #xpayment-iframe-block #xp-iframe{
442
height: 260px;
443
}
444
- xp-iframe
445
- /*end (add new credit card block style)*/
441
#new-card-block #xpayment-iframe-block #xp-iframe{
442
height: 260px;
443
}
444
+
445
+ /*end (xp transaction form)*/
446
+ .xp_fast_transactions input {
447
+ max-width: 170px;
448
+ margin: 5px;
449
+ }
450
+
451
+
452
+ .transaction-accordion {
453
+ float: right;
454
+ }
455
+
456
+ /*end(xp transaction form)*/
package.xml CHANGED
@@ -1,7 +1,7 @@
1
<?xml version="1.0"?>
2
<package>
3
<name>CDev_XPaymentsConnector</name>
4
- <version>1.2.8</version>
5
<stability>stable</stability>
6
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
<channel>community</channel>
@@ -10,11 +10,11 @@
10
<description>X-Payments connector&#xD;
11
This extension integrates Magento with X-Payments - a PA-DSS certified payment module.&#xD;
12
</description>
13
- <notes>Version number: 1.2.8</notes>
14
<authors><author><name>Valerii Demidov</name><user>Valerii</user><email>vdemidov@corp.web4pro.com.ua</email></author></authors>
15
- <date>2014-11-21</date>
16
- <time>15:54:14</time>
17
- <contents><target name="magecommunity"><dir name="Cdev"><dir name="XPaymentsConnector"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Edit"><dir name="Renderer"><file name="Cardtype.php" hash="62499b375fa9c7ba091ff7763d54a95d"/><file name="Txnid.php" hash="13d4ed0d24df35cc9956dc155b3ce8b5"/></dir><dir name="Tab"><file name="Usercards.php" hash="248e454bc1c43d41013fd5d077b39961"/></dir></dir></dir><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Xporderstate.php" hash="c18f9945cc3a67e8687bc14b4a989fa1"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Subselect.php" hash="c989f9ce4b9af2885c6d28e874825eab"/></dir></dir></dir><dir name="Usercards"><file name="Grid.php" hash="ba4e515d5e9342b11d63dc796aa96e8a"/></dir></dir><file name="Beforesuccess.php" hash="60a7d25651a98f71ca67ed70380e1659"/><file name="Cancel.php" hash="3283657e21047278d81ac4478ac81de6"/><dir name="Checkout"><dir name="Onepage"><file name="Settings.php" hash="cb6c6eac7712be2889b03a9762db25b6"/></dir></dir><file name="Control.php" hash="e0ef77a236030598882937acb2a9c4e0"/><dir name="Customer"><dir name="Account"><file name="Navigation.php" hash="aad9aa09d20706f042f1deac00d04473"/></dir><file name="Cardadd.php" hash="d46b80f3ee05cc46faf3d74b589baafa"/><file name="Success.php" hash="54f243e60b735cdd5cd879be65838fee"/><file name="Usercards.php" hash="ce4b7f73fb735a55d914ba0dad38d68a"/></dir><file name="Failure.php" hash="537aec3d3ee63ff1ac2d2300c2ca259e"/><dir name="Form"><file name="Cc.php" hash="e66f4a72b6ef02cdec8c45522a171568"/><file name="Container.php" hash="f5b3fd1fbf43eee8a6036a2a3a0bd5f7"/><file name="Prepaidpayments.php" hash="66959c7b8e7714f80f44da9afde93936"/><file name="Savedcards.php" hash="552579e7918fc666dc6de8983fc185b3"/></dir><dir name="Info"><file name="Cc.php" hash="80ec2f2dd7691519d481977ab7bdcec4"/><file name="Prepaidpayments.php" hash="5046201a95c114c6020696b7d2855b7f"/><file name="Savedcards.php" hash="5e8b71515b6d516621aea6abfda332fe"/></dir><dir name="Recurring"><dir name="Profile"><file name="View.php" hash="ee800cc7d48e437d3e993e5bd6d42a96"/></dir></dir><file name="Redirect.php" hash="e4745b70dbe2d33b327a70eb195c9345"/><file name="Success.php" hash="d2f023bc2206cbb33997b791a57b1b4e"/></dir><dir name="Helper"><file name="Data.php" hash="f8788883d2a01fbfbc036d445637b7df"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Placedisplay.php" hash="a42a68646dc2e1aa77502ec1be0dbaf7"/></dir></dir></dir></dir><dir name="Mysql4"><dir name="Paymentconfiguration"><file name="Collection.php" hash="98760f276af5182d42801865cb116db4"/></dir><file name="Paymentconfiguration.php" hash="ca045f953ec018c583279340c137ff71"/><dir name="Usercards"><file name="Collection.php" hash="6df6d26bef085e86c6db625487006086"/></dir><file name="Usercards.php" hash="ffb98ad5a0c252bbbf14adb086cf0d3c"/></dir><file name="Observer.php" hash="2e10fd26ebdee15572b34bd893ff1c8a"/><dir name="Payment"><file name="Cc.php" hash="88acf267268b5d38feb9ebbdb89a4b2f"/><file name="Prepaidpayments.php" hash="9bbab2a26748c59609d6c81d8fc37c41"/><dir name="Recurring"><file name="Profile.php" hash="7c0e5c707531e5d258b8c493243c00a1"/></dir><file name="Savedcards.php" hash="e97d591bcdf4b66231aa62cb72b32770"/></dir><file name="Paymentconfiguration.php" hash="c0a6c5b610e42037f9904247e657a0e6"/><dir name="Quote"><dir name="Address"><dir name="Total"><dir name="Nominal"><dir name="Recurring"><file name="Discount.php" hash="9c2ee0abac22865bb349dc11cebd66b2"/></dir></dir><file name="Nominal.php" hash="a835e5ed1692a8712571db963c22bd60"/></dir></dir></dir><file name="Quote.php" hash="01a8a985a91d805a1af4950406bd89bf"/><dir name="Sales"><dir name="Recurring"><file name="Profile.php" hash="5f5486cb753946720ad932b6eb5d6831"/></dir></dir><dir name="Source"><file name="Paymentconfiguration.php" hash="eb9b8e1187a4a4f4614582d5f7932c37"/></dir><file name="Usercards.php" hash="049b38f03920a17d5dbd0ba5e3a834cc"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CustomerController.php" hash="8f2bc887259b9d5ae6f3a731e7a2eb6a"/></dir><file name="ControlController.php" hash="92e1380179483d97cd27be1d147833ba"/><file name="CustomerController.php" hash="38cb8af6cf9cf609fd31da5ec79ef263"/><file name="ProcessingController.php" hash="027c7e13ef50375a030aca4dba27381f"/></dir><dir name="etc"><file name="config.xml" hash="aee71c1283c101a0829d012a66479b34"/><file name="system.xml" hash="40015b50b9b503d49bed0e850cd78e03"/></dir><dir name="sql"><dir name="xpaymentsconnector_setup"><file name="mysql4-install-1.0.0.php" hash="5b6ed901a54700d986dd81029104ed72"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="5e2da32a0f87b747a5e9f3d9095e962a"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="566cd8aa894ff488f60bd718ad8b2772"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="0f44cf02457c2b6a887b399e94b89e57"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="f353d20a6d6ac827be5cd581cc988660"/><file name="mysql4-upgrade-1.0.4-1.0.5.php" hash="9b71385496b9b42e5a79b0cbbc557dff"/><file name="mysql4-upgrade-1.0.5-1.0.6.php" hash="fa79555b4802a96579f314a670ab8ed3"/><file name="mysql4-upgrade-1.0.6-1.0.7.php" hash="b9708303f3160fc0c9347f4600e27aba"/><file name="mysql4-upgrade-1.0.7-1.0.8.php" hash="2d07945a0438bf29f1386e47b2b5498b"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="83a4aace7f0e389c5caaaf97675f6c24"/></dir></dir></dir><file name="XPaymentsConnector_old.tar" hash="76ced1e6443eba5a902ce579964957b1"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="xpaymentsconnector.xml" hash="bfe38bbacc0cc7d3a2bc4c51fc0c2a53"/></dir><dir name="template"><dir name="xpaymentsconnector"><file name="control.phtml" hash="66bb941b66f57585b2035f29afcea22d"/><dir name="form"><file name="prepaidpayments.phtml" hash="bfe70a3c62187bcd9915fb621eda58b9"/><file name="savedcards.phtml" hash="27ef4734f19ded0eb98214276a58e550"/></dir><dir name="info"><file name="cc.phtml" hash="67282ccf6f932de083bc477cc4238d22"/><file name="prepaidpayments.phtml" hash="f4bd2aa628257cb1f3450a1632a0b771"/><file name="savedcards.phtml" hash="299a1719dd63755b9d31f25c4d9738ac"/></dir><file name="info.phtml" hash="ab312e6f206c51ff3134b9a3ce5b5440"/><dir name="order"><dir name="view"><dir name="tab"><file name="xporderstate.phtml" hash="9a91a75622f7b2309e1fc16d61552952"/></dir></dir></dir><dir name="pdf"><file name="info.phtml" hash="9603c212b8efd1247ce36239d7365a73"/></dir><dir name="usercards"><dir name="tab"><file name="js.phtml" hash="ae8189ee0b9f0bd09d61692403527331"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="xpaymentsconnector.xml" hash="3c61c475430307e89459a92b44b140e6"/></dir><dir name="template"><dir name="xpaymentsconnector"><file name="blank.phtml" hash="a22778db8681a9aaee22eb2d8f8c6533"/><file name="cancel.phtml" hash="3ba9764fcbf85a3504664b342450ec2b"/><dir name="checkout"><dir name="onepage"><file name="beforesuccess.phtml" hash="8e05eff3705ac40d758c21523640f969"/><dir name="review"><file name="button.phtml" hash="ed96034bc129f74af1020384499840a9"/></dir><file name="xpayment-iframe.phtml" hash="193d75fa0cc4c11f7ffc94becbfb4afa"/></dir></dir><dir name="customer"><file name="cardaddsuccess.phtml" hash="6771721173b99c0cf70391c22d878276"/><dir name="usercards"><file name="cardadd.phtml" hash="8b347d0f43deb95710709ab7010bf1d7"/><file name="list.phtml" hash="5bf980a24c788af17cd80a8bf511807f"/></dir></dir><file name="failure.phtml" hash="3d0691440fda2d1f3a314cd151d6ea90"/><dir name="form"><file name="cc.phtml" hash="6977a84c16bc2ba0bff8347dc7715069"/><file name="savedcards.phtml" hash="acbfcc5771443fcee06d715c3c049546"/></dir><dir name="info"><file name="cc.phtml" hash="9f96547c119d966eb26c67fb557cf1b8"/><file name="prepaidpayments.phtml" hash="f4bd2aa628257cb1f3450a1632a0b771"/><file name="savedcards.phtml" hash="b44b31ecdf8c653ea8299c9664061b27"/></dir><file name="redirect.phtml" hash="4c9c74e94c9a3015dee181a0ef978550"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="layout"><file name="xpaymentsconnector.xml" hash="3c61c475430307e89459a92b44b140e6"/></dir><dir name="template"><dir name="xpaymentsconnector"><file name="blank.phtml" hash="a22778db8681a9aaee22eb2d8f8c6533"/><file name="cancel.phtml" hash="3ba9764fcbf85a3504664b342450ec2b"/><dir name="checkout"><dir name="onepage"><file name="beforesuccess.phtml" hash="8e05eff3705ac40d758c21523640f969"/><dir name="review"><file name="button.phtml" hash="ed96034bc129f74af1020384499840a9"/></dir><file name="xpayment-iframe.phtml" hash="193d75fa0cc4c11f7ffc94becbfb4afa"/></dir></dir><dir name="customer"><file name="cardaddsuccess.phtml" hash="6771721173b99c0cf70391c22d878276"/><dir name="usercards"><file name="cardadd.phtml" hash="8b347d0f43deb95710709ab7010bf1d7"/><file name="list.phtml" hash="5bf980a24c788af17cd80a8bf511807f"/></dir></dir><file name="failure.phtml" hash="3d0691440fda2d1f3a314cd151d6ea90"/><dir name="form"><file name="cc.phtml" hash="6977a84c16bc2ba0bff8347dc7715069"/><file name="savedcards.phtml" hash="acbfcc5771443fcee06d715c3c049546"/></dir><dir name="info"><file name="cc.phtml" hash="9f96547c119d966eb26c67fb557cf1b8"/><file name="prepaidpayments.phtml" hash="f4bd2aa628257cb1f3450a1632a0b771"/><file name="savedcards.phtml" hash="b44b31ecdf8c653ea8299c9664061b27"/></dir><file name="redirect.phtml" hash="4c9c74e94c9a3015dee181a0ef978550"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Cdev_XPaymentsConnector.xml" hash="3b87bc5a9c17519d38e7de93b5ad13b9"/></dir></target><target name="mage"><dir name="js"><dir name="xpayment"><file name="checkout-submit.js" hash="f6203cdcc53d44b281eae5349d55d412"/><dir name="images"><file name="card_types.png" hash="d35ba97c55e2cc1273a0dd1d7862d84c"/><file name="loader.gif" hash="e67d85a8d2d4021514815d0ff4d65173"/></dir><file name="settings.css" hash="f637ab74b9e0854f4180ff808da0ff16"/></dir></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Cdev_XPaymentsConnector.csv" hash="d3b55522dd6832c05138d65195a82f87"/></dir></dir></target></contents>
18
<compatible/>
19
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
20
</package>
1
<?xml version="1.0"?>
2
<package>
3
<name>CDev_XPaymentsConnector</name>
4
+ <version>1.2.9</version>
5
<stability>stable</stability>
6
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
<channel>community</channel>
10
<description>X-Payments connector&#xD;
11
This extension integrates Magento with X-Payments - a PA-DSS certified payment module.&#xD;
12
</description>
13
+ <notes>Version number: 1.2.9</notes>
14
<authors><author><name>Valerii Demidov</name><user>Valerii</user><email>vdemidov@corp.web4pro.com.ua</email></author></authors>
15
+ <date>2014-12-09</date>
16
+ <time>14:58:56</time>
17
+ <contents><target name="magecommunity"><dir name="Cdev"><dir name="XPaymentsConnector"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Edit"><dir name="Renderer"><file name="Cardtype.php" hash="62499b375fa9c7ba091ff7763d54a95d"/><file name="Txnid.php" hash="13d4ed0d24df35cc9956dc155b3ce8b5"/></dir><dir name="Tab"><file name="Usercards.php" hash="248e454bc1c43d41013fd5d077b39961"/></dir></dir></dir><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Xporderstate.php" hash="0c2950110b1c055b346710f992563db4"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Subselect.php" hash="c989f9ce4b9af2885c6d28e874825eab"/></dir></dir></dir><dir name="Usercards"><file name="Grid.php" hash="ba4e515d5e9342b11d63dc796aa96e8a"/></dir></dir><file name="Beforesuccess.php" hash="60a7d25651a98f71ca67ed70380e1659"/><file name="Cancel.php" hash="3283657e21047278d81ac4478ac81de6"/><dir name="Checkout"><dir name="Onepage"><file name="Settings.php" hash="cb6c6eac7712be2889b03a9762db25b6"/></dir></dir><file name="Control.php" hash="e0ef77a236030598882937acb2a9c4e0"/><dir name="Customer"><dir name="Account"><file name="Navigation.php" hash="aad9aa09d20706f042f1deac00d04473"/></dir><file name="Cardadd.php" hash="d46b80f3ee05cc46faf3d74b589baafa"/><file name="Success.php" hash="54f243e60b735cdd5cd879be65838fee"/><file name="Usercards.php" hash="ce4b7f73fb735a55d914ba0dad38d68a"/></dir><file name="Failure.php" hash="537aec3d3ee63ff1ac2d2300c2ca259e"/><dir name="Form"><file name="Cc.php" hash="e66f4a72b6ef02cdec8c45522a171568"/><file name="Container.php" hash="f5b3fd1fbf43eee8a6036a2a3a0bd5f7"/><file name="Prepaidpayments.php" hash="66959c7b8e7714f80f44da9afde93936"/><file name="Savedcards.php" hash="552579e7918fc666dc6de8983fc185b3"/></dir><dir name="Info"><file name="Cc.php" hash="80ec2f2dd7691519d481977ab7bdcec4"/><file name="Prepaidpayments.php" hash="5046201a95c114c6020696b7d2855b7f"/><file name="Savedcards.php" hash="5e8b71515b6d516621aea6abfda332fe"/></dir><dir name="Recurring"><dir name="Profile"><file name="View.php" hash="ee800cc7d48e437d3e993e5bd6d42a96"/></dir></dir><file name="Redirect.php" hash="e4745b70dbe2d33b327a70eb195c9345"/><file name="Success.php" hash="d2f023bc2206cbb33997b791a57b1b4e"/></dir><dir name="Helper"><file name="Data.php" hash="f8788883d2a01fbfbc036d445637b7df"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Placedisplay.php" hash="a42a68646dc2e1aa77502ec1be0dbaf7"/></dir></dir></dir></dir><dir name="Mysql4"><dir name="Paymentconfiguration"><file name="Collection.php" hash="98760f276af5182d42801865cb116db4"/></dir><file name="Paymentconfiguration.php" hash="ca045f953ec018c583279340c137ff71"/><dir name="Usercards"><file name="Collection.php" hash="6df6d26bef085e86c6db625487006086"/></dir><file name="Usercards.php" hash="ffb98ad5a0c252bbbf14adb086cf0d3c"/></dir><file name="Observer.php" hash="22049409c083694f6d4211e1bb59258d"/><dir name="Payment"><file name="Cc.php" hash="9ee16eaff532a8c12a838b22e320055b"/><file name="Prepaidpayments.php" hash="9bbab2a26748c59609d6c81d8fc37c41"/><dir name="Recurring"><file name="Profile.php" hash="7c0e5c707531e5d258b8c493243c00a1"/></dir><file name="Savedcards.php" hash="e97d591bcdf4b66231aa62cb72b32770"/></dir><file name="Paymentconfiguration.php" hash="c0a6c5b610e42037f9904247e657a0e6"/><dir name="Quote"><dir name="Address"><dir name="Total"><dir name="Nominal"><dir name="Recurring"><file name="Discount.php" hash="9c2ee0abac22865bb349dc11cebd66b2"/></dir></dir><file name="Nominal.php" hash="a835e5ed1692a8712571db963c22bd60"/></dir></dir></dir><file name="Quote.php" hash="01a8a985a91d805a1af4950406bd89bf"/><dir name="Sales"><dir name="Recurring"><file name="Profile.php" hash="5f5486cb753946720ad932b6eb5d6831"/></dir></dir><dir name="Source"><file name="Paymentconfiguration.php" hash="eb9b8e1187a4a4f4614582d5f7932c37"/></dir><file name="Usercards.php" hash="049b38f03920a17d5dbd0ba5e3a834cc"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CustomerController.php" hash="8f2bc887259b9d5ae6f3a731e7a2eb6a"/></dir><file name="ControlController.php" hash="92e1380179483d97cd27be1d147833ba"/><file name="CustomerController.php" hash="38cb8af6cf9cf609fd31da5ec79ef263"/><file name="ProcessingController.php" hash="027c7e13ef50375a030aca4dba27381f"/></dir><dir name="etc"><file name="config.xml" hash="04277e4db8262ae9d325218019acbfa8"/><file name="system.xml" hash="40015b50b9b503d49bed0e850cd78e03"/></dir><dir name="sql"><dir name="xpaymentsconnector_setup"><file name="mysql4-install-1.0.0.php" hash="5b6ed901a54700d986dd81029104ed72"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="5e2da32a0f87b747a5e9f3d9095e962a"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="566cd8aa894ff488f60bd718ad8b2772"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="0f44cf02457c2b6a887b399e94b89e57"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="f353d20a6d6ac827be5cd581cc988660"/><file name="mysql4-upgrade-1.0.4-1.0.5.php" hash="9b71385496b9b42e5a79b0cbbc557dff"/><file name="mysql4-upgrade-1.0.5-1.0.6.php" hash="fa79555b4802a96579f314a670ab8ed3"/><file name="mysql4-upgrade-1.0.6-1.0.7.php" hash="b9708303f3160fc0c9347f4600e27aba"/><file name="mysql4-upgrade-1.0.7-1.0.8.php" hash="2d07945a0438bf29f1386e47b2b5498b"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="83a4aace7f0e389c5caaaf97675f6c24"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="xpaymentsconnector.xml" hash="4a769cd81f4c37da59b400510c49593d"/></dir><dir name="template"><dir name="xpaymentsconnector"><file name="control.phtml" hash="66bb941b66f57585b2035f29afcea22d"/><dir name="form"><file name="prepaidpayments.phtml" hash="bfe70a3c62187bcd9915fb621eda58b9"/><file name="savedcards.phtml" hash="27ef4734f19ded0eb98214276a58e550"/></dir><dir name="info"><file name="cc.phtml" hash="67282ccf6f932de083bc477cc4238d22"/><file name="prepaidpayments.phtml" hash="f4bd2aa628257cb1f3450a1632a0b771"/><file name="savedcards.phtml" hash="299a1719dd63755b9d31f25c4d9738ac"/></dir><file name="info.phtml" hash="ab312e6f206c51ff3134b9a3ce5b5440"/><dir name="order"><dir name="view"><dir name="tab"><file name="xporderstate.phtml" hash="2c3b54ae9b32e16724329e4d9b600f6d"/></dir></dir></dir><dir name="pdf"><file name="info.phtml" hash="9603c212b8efd1247ce36239d7365a73"/></dir><dir name="usercards"><dir name="tab"><file name="js.phtml" hash="ae8189ee0b9f0bd09d61692403527331"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="xpaymentsconnector.xml" hash="3c61c475430307e89459a92b44b140e6"/></dir><dir name="template"><dir name="xpaymentsconnector"><file name="blank.phtml" hash="a22778db8681a9aaee22eb2d8f8c6533"/><file name="cancel.phtml" hash="3ba9764fcbf85a3504664b342450ec2b"/><dir name="checkout"><dir name="onepage"><file name="beforesuccess.phtml" hash="8e05eff3705ac40d758c21523640f969"/><dir name="review"><file name="button.phtml" hash="ed96034bc129f74af1020384499840a9"/></dir><file name="xpayment-iframe.phtml" hash="193d75fa0cc4c11f7ffc94becbfb4afa"/></dir></dir><dir name="customer"><file name="cardaddsuccess.phtml" hash="6771721173b99c0cf70391c22d878276"/><dir name="usercards"><file name="cardadd.phtml" hash="8b347d0f43deb95710709ab7010bf1d7"/><file name="list.phtml" hash="5bf980a24c788af17cd80a8bf511807f"/></dir></dir><file name="failure.phtml" hash="3d0691440fda2d1f3a314cd151d6ea90"/><dir name="form"><file name="cc.phtml" hash="6977a84c16bc2ba0bff8347dc7715069"/><file name="savedcards.phtml" hash="acbfcc5771443fcee06d715c3c049546"/></dir><dir name="info"><file name="cc.phtml" hash="9f96547c119d966eb26c67fb557cf1b8"/><file name="prepaidpayments.phtml" hash="f4bd2aa628257cb1f3450a1632a0b771"/><file name="savedcards.phtml" hash="b44b31ecdf8c653ea8299c9664061b27"/></dir><file name="redirect.phtml" hash="4c9c74e94c9a3015dee181a0ef978550"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="layout"><file name="xpaymentsconnector.xml" hash="3c61c475430307e89459a92b44b140e6"/></dir><dir name="template"><dir name="xpaymentsconnector"><file name="blank.phtml" hash="a22778db8681a9aaee22eb2d8f8c6533"/><file name="cancel.phtml" hash="3ba9764fcbf85a3504664b342450ec2b"/><dir name="checkout"><dir name="onepage"><file name="beforesuccess.phtml" hash="8e05eff3705ac40d758c21523640f969"/><dir name="review"><file name="button.phtml" hash="ed96034bc129f74af1020384499840a9"/></dir><file name="xpayment-iframe.phtml" hash="193d75fa0cc4c11f7ffc94becbfb4afa"/></dir></dir><dir name="customer"><file name="cardaddsuccess.phtml" hash="6771721173b99c0cf70391c22d878276"/><dir name="usercards"><file name="cardadd.phtml" hash="8b347d0f43deb95710709ab7010bf1d7"/><file name="list.phtml" hash="5bf980a24c788af17cd80a8bf511807f"/></dir></dir><file name="failure.phtml" hash="3d0691440fda2d1f3a314cd151d6ea90"/><dir name="form"><file name="cc.phtml" hash="6977a84c16bc2ba0bff8347dc7715069"/><file name="savedcards.phtml" hash="acbfcc5771443fcee06d715c3c049546"/></dir><dir name="info"><file name="cc.phtml" hash="9f96547c119d966eb26c67fb557cf1b8"/><file name="prepaidpayments.phtml" hash="f4bd2aa628257cb1f3450a1632a0b771"/><file name="savedcards.phtml" hash="b44b31ecdf8c653ea8299c9664061b27"/></dir><file name="redirect.phtml" hash="4c9c74e94c9a3015dee181a0ef978550"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Cdev_XPaymentsConnector.xml" hash="3b87bc5a9c17519d38e7de93b5ad13b9"/></dir></target><target name="mage"><dir name="js"><dir name="xpayment"><file name="backend-xpayment.js" hash="adb23ae4c5a320318d9e3cf26558fffd"/><file name="checkout-submit.js" hash="f6203cdcc53d44b281eae5349d55d412"/><dir name="images"><file name="arrow-down.png" hash="a0beb6cd0ca4dd686ee5bf772432176e"/><file name="arrow-up.png" hash="df40115c816a7e08016c04120ac22e53"/><file name="card_types.png" hash="d35ba97c55e2cc1273a0dd1d7862d84c"/><file name="loader.gif" hash="e67d85a8d2d4021514815d0ff4d65173"/></dir><file name="settings.css" hash="2fd21e43fa991f0304d0de4dc377643c"/></dir></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Cdev_XPaymentsConnector.csv" hash="d3b55522dd6832c05138d65195a82f87"/></dir></dir></target></contents>
18
<compatible/>
19
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
20
</package>