First_Data_Gateway_Integration - Version 1.0.6

Version Notes

This version is properly tested on the following Magento CE versions: 1.5, 1.6, 1.7,1.8,1.9.*

This version also supports for PHP V5.6.12

Download this release

Release Info

Developer Rave Infosys
Extension First_Data_Gateway_Integration
Version 1.0.6
Comparing to
See all releases


Code changes from version 1.0.5 to 1.0.6

app/code/community/Raveinfosys/Linkpoint/Model/Linkpoint.php CHANGED
@@ -14,33 +14,33 @@
14
  * @author RaveInfosys, Inc.
15
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
  */
17
- class Raveinfosys_Linkpoint_Model_Linkpoint extends Mage_Payment_Model_Method_Cc {
 
18
 
19
- protected $_code = 'linkpoint'; //unique internal payment method identifier
20
-
21
- protected $_isGateway = true; //Is this payment method a gateway (online auth/charge) ?
22
- protected $_canAuthorize = true; //Can authorize online?
23
- protected $_canCapture = true; //Can capture funds online?
24
- protected $_canCapturePartial = false; //Can capture partial amounts online?
25
- protected $_canRefund = true; //Can refund online?
26
- protected $_canRefundInvoicePartial = true; //Can refund invoices partially?
27
- protected $_canVoid = true; //Can void transactions online?
28
- protected $_canUseInternal = true; //Can use this payment method in administration panel?
29
- protected $_canUseCheckout = true; //Can show this payment method as an option on checkout payment page?
30
- protected $_canUseForMultishipping = false; //Is this payment method suitable for multi-shipping checkout?
31
  protected $_isInitializeNeeded = false;
32
  protected $_canFetchTransactionInfo = false;
33
  protected $_canReviewPayment = false;
34
  protected $_canCreateBillingAgreement = false;
35
  protected $_canManageRecurringProfiles = false;
36
- protected $_canSaveCc = false; //Can save credit card information for future processing?
37
 
38
  /**
39
  * Fields that should be replaced in debug with '***'
40
  *
41
  * @var array
42
  */
43
- protected $_debugReplacePrivateDataKeys = array('cvmvalue', 'keyfile', 'cardnumber', 'cardexpmonth', 'cardexpyear');
44
 
45
  /**
46
  * Validate payment method information object
@@ -48,17 +48,18 @@ class Raveinfosys_Linkpoint_Model_Linkpoint extends Mage_Payment_Model_Method_Cc
48
  * @param Mage_Payment_Model_Info $info
49
  * @return Mage_Payment_Model_Abstract
50
  */
51
- public function validate() {
 
52
  $info = $this->getInfoInstance();
53
- $order_amount=0;
54
  if ($info instanceof Mage_Sales_Model_Quote_Payment) {
55
- $order_amount=(double)$info->getQuote()->getBaseGrandTotal();
56
  } elseif ($info instanceof Mage_Sales_Model_Order_Payment) {
57
- $order_amount=(double)$info->getOrder()->getQuoteBaseGrandTotal();
58
  }
59
 
60
- $order_min=$this->getConfigData('min_order_total');
61
- $order_max=$this->getConfigData('max_order_total');
62
  if(!empty($order_max) && (double)$order_max<$order_amount) {
63
  Mage::throwException("Order amount greater than permissible Maximum order amount.");
64
  }
@@ -72,39 +73,142 @@ class Raveinfosys_Linkpoint_Model_Linkpoint extends Mage_Payment_Model_Method_Cc
72
  }
73
 
74
  /**
75
- * Send capture request to gateway
76
  *
77
  * @param Varien_Object $payment
78
  * @param decimal $amount
79
  * @return Mage_Paygate_Model_Authorizenet
80
  * @throws Mage_Core_Exception
81
  */
82
- public function capture(Varien_Object $payment, $amount) {
 
83
  if ($amount <= 0) {
84
  Mage::throwException(Mage::helper('linkpoint')->__('Invalid amount for transaction.'));
85
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
 
87
- $payment->setAmount($amount);
88
 
89
- $data=$this->_prepareData();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
- $data['ordertype'] = "SALE";
92
 
93
- $creditcard=array(
 
 
 
94
  'cardnumber' => $payment->getCcNumber(),
95
  'cardexpmonth' => $payment->getCcExpMonth(),
96
  'cardexpyear' => substr($payment->getCcExpYear(),-2),
 
97
  );
98
  if($this->getConfigData('useccv')==1) {
99
  $creditcard["cvmindicator"] = "provided";
100
  $creditcard["cvmvalue"] = $payment->getCcCid();
 
 
101
  }
102
 
103
- $shipping=array();
104
- $billing=array();
105
-
106
- $order = $payment->getOrder();
107
-
108
  if (!empty($order)) {
109
  $BillingAddress = $order->getBillingAddress();
110
 
@@ -129,35 +233,89 @@ class Raveinfosys_Linkpoint_Model_Linkpoint extends Mage_Payment_Model_Method_Cc
129
  $shipping['scountry'] = $ShippingAddress->getCountry();
130
  }
131
  }
132
- $transactiondetails=array();
 
 
 
 
 
 
 
 
 
 
 
133
 
134
- $merchantinfo=array();
135
- $merchantinfo['configfile'] = $data['storenumber'];
136
- $merchantinfo['keyfile'] = $data['key'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
 
138
- $paymentdetails=array();
139
- $paymentdetails['chargetotal']=$payment->getAmount();
140
 
141
- $data=array_merge($data, $creditcard, $billing, $shipping, $transactiondetails, $merchantinfo, $paymentdetails);
142
 
143
- $result = $this->_postRequest($data);
 
144
  if(is_array($result) && count($result)>0) {
145
- if(array_key_exists("r_approved",$result)) {
146
- if ($result["r_approved"] != "APPROVED") {
 
147
  $payment->setStatus(self::STATUS_ERROR);
148
- Mage::throwException("Gateway error : {".(string)$result["r_error"]."}");
149
- } else {
 
 
 
 
 
 
 
 
150
  $payment->setStatus(self::STATUS_APPROVED);
151
- $payment->setLastTransId((string)$result["r_ordernum"]);
152
- if (!$payment->getParentTransactionId() || (string)$result["r_ordernum"] != $payment->getParentTransactionId()) {
153
- $payment->setTransactionId((string)$result["r_ordernum"]);
 
154
  }
155
  return $this;
156
  }
157
- } else {
 
158
  Mage::throwException("No approval found");
159
  }
160
-
161
  } else {
162
  Mage::throwException("No response found");
163
  }
@@ -172,27 +330,34 @@ class Raveinfosys_Linkpoint_Model_Linkpoint extends Mage_Payment_Model_Method_Cc
172
  */
173
  public function refund(Varien_Object $payment, $amount) {
174
  if ($payment->getRefundTransactionId() && $amount > 0) {
175
- $data=$this->_prepareData();
176
- $data['ordertype'] = "CREDIT";
177
- $data["oid"] = $payment->getRefundTransactionId();
178
-
179
- $merchantinfo=array();
180
- $merchantinfo['configfile'] = $data['storenumber'];
181
- $merchantinfo['keyfile'] = $data['key'];
182
 
183
- $paymentdetails=array();
184
- $paymentdetails['chargetotal']=$amount;
185
-
186
- $data=array_merge($data, $merchantinfo, $paymentdetails);
187
-
188
- $result = $this->_postRequest($data);
 
 
 
189
 
 
 
190
  if(is_array($result) && count($result)>0) {
191
- if(array_key_exists("r_approved",$result)) {
192
- if ($result["r_approved"] != "APPROVED") {
193
- Mage::throwException("Gateway error : {".(string)$result["r_error"]."}");
194
  } else {
195
  $payment->setStatus(self::STATUS_SUCCESS);
 
 
 
 
196
  return $this;
197
  }
198
  } else {
@@ -213,26 +378,30 @@ class Raveinfosys_Linkpoint_Model_Linkpoint extends Mage_Payment_Model_Method_Cc
213
  * @return Mage_Paygate_Model_Authorizenet
214
  * @throws Mage_Core_Exception
215
  */
216
- public function void(Varien_Object $payment) {
217
- if ($payment->getParentTransactionId()) {
218
- $data=$this->_prepareData();
219
- $data['ordertype'] = "VOID";
220
- $data["oid"] = $payment->getParentTransactionId();
221
-
222
- $merchantinfo=array();
223
- $merchantinfo['configfile'] = $data['storenumber'];
224
- $merchantinfo['keyfile'] = $data['key'];
225
-
226
- $data=array_merge($data, $merchantinfo);
227
-
228
- $result = $this->_postRequest($data);
229
-
 
 
 
 
230
  if(is_array($result) && count($result)>0) {
231
- if(array_key_exists("r_approved",$result)) {
232
- if ($result["r_approved"] != "APPROVED") {
233
- Mage::throwException("Gateway error : {".(string)$result["r_error"]."}");
234
  } else {
235
- $payment->setStatus(self::STATUS_SUCCESS );
236
  return $this;
237
  }
238
  } else {
@@ -258,212 +427,55 @@ class Raveinfosys_Linkpoint_Model_Linkpoint extends Mage_Payment_Model_Method_Cc
258
 
259
  /**
260
  * converts a hash of name-value pairs
261
- * to the correct XML format for LSGS
 
262
  *
263
  * @param Array $pdata
264
  * @return String $xml
265
  */
266
- protected function _buildRequest($pdata) {
267
- $xml = "<order>";
268
- ### ORDEROPTIONS NODE ###
269
- $xml .= "<orderoptions>";
270
- if (isset($pdata["ordertype"]))
271
- $xml .= "<ordertype>" . $pdata["ordertype"] . "</ordertype>";
272
-
273
- if (isset($pdata["result"]))
274
- $xml .= "<result>" . $pdata["result"] . "</result>";
275
-
276
- $xml .= "</orderoptions>";
277
- ### ORDEROPTIONS NODE ###
278
-
279
- ### CREDITCARD NODE ###
280
- $xml .= "<creditcard>";
281
-
282
- if (isset($pdata["cardnumber"]))
283
- $xml .= "<cardnumber>" . $pdata["cardnumber"] . "</cardnumber>";
284
-
285
- if (isset($pdata["cardexpmonth"]))
286
- $xml .= "<cardexpmonth>" . $pdata["cardexpmonth"] . "</cardexpmonth>";
287
-
288
- if (isset($pdata["cardexpyear"]))
289
- $xml .= "<cardexpyear>" . $pdata["cardexpyear"] . "</cardexpyear>";
290
-
291
- if (isset($pdata["cvmvalue"]))
292
- $xml .= "<cvmvalue>" . $pdata["cvmvalue"] . "</cvmvalue>";
293
-
294
- if (isset($pdata["cvmindicator"]))
295
- $xml .= "<cvmindicator>" . $pdata["cvmindicator"] . "</cvmindicator>";
296
-
297
- if (isset($pdata["track"]))
298
- $xml .= "<track>" . $pdata["track"] . "</track>";
299
-
300
- $xml .= "</creditcard>";
301
- ### CREDITCARD NODE ###
302
-
303
- ### BILLING NODE ###
304
- $xml .= "<billing>";
305
-
306
- if (isset($pdata["name"]))
307
- $xml .= "<name>" . $pdata["name"] . "</name>";
308
-
309
- if (isset($pdata["company"]))
310
- $xml .= "<company>" . $pdata["company"] . "</company>";
311
-
312
- if (isset($pdata["address1"]))
313
- $xml .= "<address1>" . $pdata["address1"] . "</address1>";
314
- elseif (isset($pdata["address"]))
315
- $xml .= "<address1>" . $pdata["address"] . "</address1>";
316
-
317
- if (isset($pdata["address2"]))
318
- $xml .= "<address2>" . $pdata["address2"] . "</address2>";
319
-
320
- if (isset($pdata["city"]))
321
- $xml .= "<city>" . $pdata["city"] . "</city>";
322
-
323
- if (isset($pdata["state"]))
324
- $xml .= "<state>" . $pdata["state"] . "</state>";
325
-
326
- if (isset($pdata["zip"]))
327
- $xml .= "<zip>" . $pdata["zip"] . "</zip>";
328
-
329
- if (isset($pdata["country"]))
330
- $xml .= "<country>" . $pdata["country"] . "</country>";
331
-
332
- if (isset($pdata["userid"]))
333
- $xml .= "<userid>" . $pdata["userid"] . "</userid>";
334
-
335
- if (isset($pdata["email"]))
336
- $xml .= "<email>" . $pdata["email"] . "</email>";
337
-
338
- if (isset($pdata["phone"]))
339
- $xml .= "<phone>" . $pdata["phone"] . "</phone>";
340
-
341
- if (isset($pdata["fax"]))
342
- $xml .= "<fax>" . $pdata["fax"] . "</fax>";
343
-
344
- if (isset($pdata["addrnum"]))
345
- $xml .= "<addrnum>" . $pdata["addrnum"] . "</addrnum>";
346
-
347
- $xml .= "</billing>";
348
- ### BILLING NODE ###
349
-
350
- ## SHIPPING NODE ##
351
- $xml .= "<shipping>";
352
-
353
- if (isset($pdata["sname"]))
354
- $xml .= "<name>" . $pdata["sname"] . "</name>";
355
-
356
- if (isset($pdata["saddress1"]))
357
- $xml .= "<address1>" . $pdata["saddress1"] . "</address1>";
358
-
359
- if (isset($pdata["saddress2"]))
360
- $xml .= "<address2>" . $pdata["saddress2"] . "</address2>";
361
-
362
- if (isset($pdata["scity"]))
363
- $xml .= "<city>" . $pdata["scity"] . "</city>";
364
-
365
- if (isset($pdata["sstate"]))
366
- $xml .= "<state>" . $pdata["sstate"] . "</state>";
367
-
368
- if (isset($pdata["szip"]))
369
- $xml .= "<zip>" . $pdata["szip"] . "</zip>";
370
-
371
- if (isset($pdata["scountry"]))
372
- $xml .= "<country>" . $pdata["scountry"] . "</country>";
373
-
374
- if (isset($pdata["scarrier"]))
375
- $xml .= "<carrier>" . $pdata["scarrier"] . "</carrier>";
376
-
377
- if (isset($pdata["sitems"]))
378
- $xml .= "<items>" . $pdata["sitems"] . "</items>";
379
-
380
- if (isset($pdata["sweight"]))
381
- $xml .= "<weight>" . $pdata["sweight"] . "</weight>";
382
-
383
- if (isset($pdata["stotal"]))
384
- $xml .= "<total>" . $pdata["stotal"] . "</total>";
385
-
386
- $xml .= "</shipping>";
387
- ## SHIPPING NODE ##
388
-
389
- ### TRANSACTIONDETAILS NODE ###
390
- $xml .= "<transactiondetails>";
391
-
392
- if (isset($pdata["oid"]))
393
- $xml .= "<oid>" . $pdata["oid"] . "</oid>";
394
-
395
- if (isset($pdata["ponumber"]))
396
- $xml .= "<ponumber>" . $pdata["ponumber"] . "</ponumber>";
397
-
398
- if (isset($pdata["recurring"]))
399
- $xml .= "<recurring>" . $pdata["recurring"] . "</recurring>";
400
-
401
- if (isset($pdata["taxexempt"]))
402
- $xml .= "<taxexempt>" . $pdata["taxexempt"] . "</taxexempt>";
403
-
404
- if (isset($pdata["terminaltype"]))
405
- $xml .= "<terminaltype>" . $pdata["terminaltype"] . "</terminaltype>";
406
-
407
- if (isset($pdata["ip"]))
408
- $xml .= "<ip>" . $pdata["ip"] . "</ip>";
409
-
410
- if (isset($pdata["reference_number"]))
411
- $xml .= "<reference_number>" . $pdata["reference_number"] . "</reference_number>";
412
-
413
- if (isset($pdata["transactionorigin"]))
414
- $xml .= "<transactionorigin>" . $pdata["transactionorigin"] . "</transactionorigin>";
415
-
416
- if (isset($pdata["tdate"]))
417
- $xml .= "<tdate>" . $pdata["tdate"] . "</tdate>";
418
-
419
- $xml .= "</transactiondetails>";
420
- ### TRANSACTIONDETAILS NODE ###
421
-
422
- ### MERCHANTINFO NODE ###
423
- $xml .= "<merchantinfo>";
424
-
425
- if (isset($pdata["configfile"]))
426
- $xml .= "<configfile>" . $pdata["configfile"] . "</configfile>";
427
-
428
- if (isset($pdata["keyfile"]))
429
- $xml .= "<keyfile>" . $pdata["keyfile"] . "</keyfile>";
430
-
431
- if (isset($pdata["host"]))
432
- $xml .= "<host>" . $pdata["host"] . "</host>";
433
-
434
- if (isset($pdata["port"]))
435
- $xml .= "<port>" . $pdata["port"] . "</port>";
436
-
437
- if (isset($pdata["appname"]))
438
- $xml .= "<appname>" . $pdata["appname"] . "</appname>";
439
-
440
- $xml .= "</merchantinfo>";
441
- ### MERCHANTINFO NODE ###
442
-
443
- ### PAYMENT NODE ###
444
- $xml .= "<payment>";
445
-
446
- if (isset($pdata["chargetotal"]))
447
- $xml .= "<chargetotal>" . $pdata["chargetotal"] . "</chargetotal>";
448
-
449
- if (isset($pdata["tax"]))
450
- $xml .= "<tax>" . $pdata["tax"] . "</tax>";
451
-
452
- if (isset($pdata["vattax"]))
453
- $xml .= "<vattax>" . $pdata["vattax"] . "</vattax>";
454
-
455
- if (isset($pdata["shipping"]))
456
- $xml .= "<shipping>" . $pdata["shipping"] . "</shipping>";
457
-
458
- if (isset($pdata["subtotal"]))
459
- $xml .= "<subtotal>" . $pdata["subtotal"] . "</subtotal>";
460
-
461
- $xml .= "</payment>";
462
- ### PAYMENT NODE ###
463
-
464
- $xml .= "</order>";
465
-
466
- return $xml;
467
  }
468
 
469
  /**
@@ -473,94 +485,98 @@ class Raveinfosys_Linkpoint_Model_Linkpoint extends Mage_Payment_Model_Method_Cc
473
  * @param String $xml
474
  * @return Array $retarr
475
  */
476
- protected function _readResponse($xml) {
477
- preg_match_all ("/<(.*?)>(.*?)\</", $xml, $out, PREG_SET_ORDER);
478
-
479
- $n = 0;
480
- while (isset($out[$n])) {
481
- $retarr[$out[$n][1]] = strip_tags($out[$n][0]);
482
- $n++;
483
  }
484
-
485
  return $retarr;
486
  }
487
 
488
  /**
489
- * process hash table or xml string table using cURL
 
 
490
  *
491
  * @param Array $data
492
  * @return String $xml
493
  */
494
  protected function _postRequest($data) {
 
495
  $debugData = array('request' => $data);
496
-
497
- $xml='';
498
-
499
- // convert incoming hash to XML string
500
- $xml = $this->_buildRequest($data);
501
-
502
- //get Store Number from core config table
503
-
504
- $key = $data["keyfile"];
505
- $host = $data["host"];
506
- $port = $data["port"];
507
-
508
- $host = "https://".$host.":".$port."/";
509
-
510
- $ch = curl_init ();
511
- curl_setopt ($ch, CURLOPT_URL,$host);
512
- curl_setopt ($ch, CURLOPT_VERBOSE, 1);
513
- curl_setopt ($ch, CURLOPT_POST, 1);
514
- curl_setopt ($ch, CURLOPT_POSTFIELDS, $xml);
515
- curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
516
- curl_setopt ($ch, CURLOPT_SSLCERT, $key);
517
- curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
518
- curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
519
-
520
- $result = curl_exec ($ch);
521
-
522
-
523
- if (!$result) {
524
- Mage::throwException(ucwords(curl_error($ch)));
525
  }
526
- $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
527
- if ($httpcode && substr($httpcode, 0, 2) != "20") { //Unsuccessful post request...
528
- Mage::throwException("Returned HTTP CODE: " . $httpcode . " for this URL: " . $host);
 
 
529
  }
530
- curl_close($ch);
531
 
532
- #convert xml response to hash
533
- $retarr = $this->_readResponse($result);
 
 
534
 
535
- # log details
536
- $debugData['response']=$retarr;
537
- if($this->getConfigData('debug')==1) {
538
  $this->_debug($debugData);
539
- }
540
-
541
- # and send it back
542
- return ($retarr);
543
  }
544
 
545
- protected function _prepareData() {
546
- $data=array(
547
- 'key' => $this->getConfigData('pem_path_test'),
548
- 'storenumber' => $this->getConfigData('store_number_test'),
549
- 'host' => $this->getConfigData('host_test'),
550
- 'port' => $this->getConfigData('port_test')
551
- );
552
-
553
- if($this->getConfigData('test')==0) {
554
- $data['key'] = $this->getConfigData('pem_path_live');
555
- $data['storenumber'] = $this->getConfigData('store_number_live');
556
- $data['host'] = $this->getConfigData('host_live');
557
- $data['port'] = $this->getConfigData('port_live');
 
558
  }
559
- if(empty($data['key']) || empty($data['storenumber']) || empty($data['host']) || empty($data['port'])){
 
560
  Mage::throwException("Gateway Parameters Missing");
561
- }
562
- $data['terminaltype'] = "UNSPECIFIED";
563
- return $data;
564
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
565
  }
 
566
  ?>
14
  * @author RaveInfosys, Inc.
15
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
  */
17
+ class Raveinfosys_Linkpoint_Model_Linkpoint extends Mage_Payment_Model_Method_Ccsave
18
+ {
19
 
20
+ protected $_code = 'linkpoint'; //unique internal payment method identifier
21
+ protected $_isGateway = true; //Is this payment method a gateway (online auth/charge) ?
22
+ protected $_canAuthorize = true; //Can authorize online?
23
+ protected $_canCapture = true; //Can capture funds online?
24
+ protected $_canCapturePartial = false; //Can capture partial amounts online?
25
+ protected $_canRefund = true; //Can refund online?
26
+ protected $_canRefundInvoicePartial = true; //Can refund invoices partially?
27
+ protected $_canVoid = true; //Can void transactions online?
28
+ protected $_canUseInternal = true; //Can use this payment method in administration panel?
29
+ protected $_canUseCheckout = true; //Can show this payment method as an option on checkout payment page?
30
+ protected $_canUseForMultishipping = false; //Is this payment method suitable for multi-shipping checkout?
 
31
  protected $_isInitializeNeeded = false;
32
  protected $_canFetchTransactionInfo = false;
33
  protected $_canReviewPayment = false;
34
  protected $_canCreateBillingAgreement = false;
35
  protected $_canManageRecurringProfiles = false;
36
+ protected $_canSaveCc = true; //Can save credit card information for future processing?
37
 
38
  /**
39
  * Fields that should be replaced in debug with '***'
40
  *
41
  * @var array
42
  */
43
+ protected $_debugReplacePrivateDataKeys = array('keyId', 'hmacKey', 'gatewayId', 'gatewayPass');
44
 
45
  /**
46
  * Validate payment method information object
48
  * @param Mage_Payment_Model_Info $info
49
  * @return Mage_Payment_Model_Abstract
50
  */
51
+ public function validate()
52
+ {
53
  $info = $this->getInfoInstance();
54
+ $order_amount = 0;
55
  if ($info instanceof Mage_Sales_Model_Quote_Payment) {
56
+ $order_amount = (double)$info->getQuote()->getBaseGrandTotal();
57
  } elseif ($info instanceof Mage_Sales_Model_Order_Payment) {
58
+ $order_amount = (double)$info->getOrder()->getQuoteBaseGrandTotal();
59
  }
60
 
61
+ $order_min = $this->getConfigData('min_order_total');
62
+ $order_max = $this->getConfigData('max_order_total');
63
  if(!empty($order_max) && (double)$order_max<$order_amount) {
64
  Mage::throwException("Order amount greater than permissible Maximum order amount.");
65
  }
73
  }
74
 
75
  /**
76
+ * Send authorize request to gateway
77
  *
78
  * @param Varien_Object $payment
79
  * @param decimal $amount
80
  * @return Mage_Paygate_Model_Authorizenet
81
  * @throws Mage_Core_Exception
82
  */
83
+ public function authorize(Varien_Object $payment, $amount)
84
+ {
85
  if ($amount <= 0) {
86
  Mage::throwException(Mage::helper('linkpoint')->__('Invalid amount for transaction.'));
87
+ }
88
+ $payment->setAmount($amount);
89
+ $data = $this->_prepareData();
90
+ $data['trans_type'] = "01";
91
+ $creditcard = array(
92
+ 'cardnumber' => $payment->getCcNumber(),
93
+ 'cardexpmonth' => $payment->getCcExpMonth(),
94
+ 'ccname' => $payment->getCcOwner(),
95
+ 'cardexpyear' => substr($payment->getCcExpYear(),-2),
96
+ );
97
+ if($this->getConfigData('useccv')==1) {
98
+ $creditcard["cvmindicator"] = "provided";
99
+ $creditcard["cvmvalue"] = $payment->getCcCid();
100
+ $creditcard["cvv2indicator"]= 1;
101
+ $creditcard["cvv2value"] = $payment->getCcCid();
102
+ }
103
+
104
+ $shipping = array();
105
+ $billing = array();
106
+ $order = $payment->getOrder();
107
+ if (!empty($order)) {
108
+ $BillingAddress = $order->getBillingAddress();
109
+
110
+ $billing['name'] = $BillingAddress->getFirstname()." ".$BillingAddress->getLastname();
111
+ $billing['company'] = $BillingAddress->getCompany();
112
+ $billing['address'] = $BillingAddress->getStreet(1);
113
+ $billing['city'] = $BillingAddress->getCity();
114
+ $billing['state'] = $BillingAddress->getRegion();
115
+ $billing['zip'] = $BillingAddress->getPostcode();
116
+ $billing['country'] = $BillingAddress->getCountry();
117
+ $billing['email'] = $order->getCustomerEmail();
118
+ $billing['phone'] = $BillingAddress->getTelephone();
119
+ $billing['fax'] = $BillingAddress->getFax();
120
+
121
+ $ShippingAddress = $order->getShippingAddress();
122
+ if (!empty($shipping)) {
123
+ $shipping['sname'] = $ShippingAddress->getFirstname()." ".$ShippingAddress->getLastname();
124
+ $shipping['saddress1'] = $ShippingAddress->getStreet(1);
125
+ $shipping['scity'] = $ShippingAddress->getCity();
126
+ $shipping['sstate'] = $ShippingAddress->getRegion();
127
+ $shipping['szip'] = $ShippingAddress->getPostcode();
128
+ $shipping['scountry'] = $ShippingAddress->getCountry();
129
+ }
130
+ }
131
+
132
+ $merchantinfo = array();
133
+ $merchantinfo['gatewayId'] = $data['gatewayId'];
134
+ $merchantinfo['gatewayPass'] = $data['gatewayPass'];
135
+ $paymentdetails = array();
136
+ $paymentdetails['chargetotal'] = $payment->getAmount();
137
 
138
+ $data = array_merge($data, $creditcard, $billing, $shipping, $merchantinfo, $paymentdetails);
139
 
140
+ $result = $this->_postRequest($data);
141
+
142
+ if(is_array($result) && count($result)>0) {
143
+
144
+ if(array_key_exists("Bank_Message",$result)) {
145
+ if ($result["Bank_Message"] != "Approved") {
146
+ $payment->setStatus(self::STATUS_ERROR);
147
+ Mage::throwException("Gateway error : {".(string)$result["EXact_Message"]."}");
148
+ }
149
+ elseif($trxnResult->Transaction_Error){
150
+ Mage::throwException("Returned Error Message: $trxnResult->EXact_Message");
151
+ }
152
+ /*
153
+ elseif($this->getConfigData('useccv') && $trxnResult->CVV2 != "M" ){
154
+ Mage::throwException("Invalid Card Verification Number(".$trxnResult->CVV2.")");
155
+ }*/
156
+ else {
157
+ $payment->setStatus(self::STATUS_APPROVED);
158
+ $payment->setAdditionalInformation('payment_type', $this->getConfigData('payment_action'));
159
+ $payment->setLastTransId((string)$result["Authorization_Num"]);
160
+ $payment->setTransactionTag((string)$result["Transaction_Tag"]);
161
+ if (!$payment->getParentTransactionId() || (string)$result["Authorization_Num"] != $payment->getParentTransactionId()) {
162
+ $payment->setTransactionId((string)$result["Authorization_Num"]);
163
+ }
164
+ $this->_addTransaction(
165
+ $payment,
166
+ $result["Authorization_Num"],
167
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH,
168
+ array('is_transaction_closed' => 0));
169
+ $payment->setSkipTransactionCreation(true);
170
+ return $this;
171
+ }
172
+ }
173
+ else {
174
+ Mage::throwException("No approval found");
175
+ }
176
+ } else {
177
+ Mage::throwException("No response found");
178
+ }
179
+ }
180
+
181
+ public function capture(Varien_Object $payment, $amount)
182
+ {
183
+ if ($amount <= 0) {
184
+ Mage::throwException(Mage::helper('linkpoint')->__('Invalid amount for transaction.'));
185
+ }
186
+
187
+ if($payment->getTransactionTag() != '' && Mage::app()->getStore()->isAdmin()){
188
+ return $this->authorizePayment($payment, number_format($amount, 2, '.', ''));
189
+ }
190
+
191
 
 
192
 
193
+ $payment->setAmount($amount);
194
+ $data = $this->_prepareData();
195
+ $data['trans_type'] = "00";
196
+ $creditcard = array(
197
  'cardnumber' => $payment->getCcNumber(),
198
  'cardexpmonth' => $payment->getCcExpMonth(),
199
  'cardexpyear' => substr($payment->getCcExpYear(),-2),
200
+ 'ccname' => $payment->getCcOwner()
201
  );
202
  if($this->getConfigData('useccv')==1) {
203
  $creditcard["cvmindicator"] = "provided";
204
  $creditcard["cvmvalue"] = $payment->getCcCid();
205
+ $creditcard["cvv2indicator"]= 1;
206
+ $creditcard["cvv2value"] = $payment->getCcCid();
207
  }
208
 
209
+ $shipping = array();
210
+ $billing = array();
211
+ $order = $payment->getOrder();
 
 
212
  if (!empty($order)) {
213
  $BillingAddress = $order->getBillingAddress();
214
 
233
  $shipping['scountry'] = $ShippingAddress->getCountry();
234
  }
235
  }
236
+
237
+ $merchantinfo = array();
238
+ $merchantinfo['gatewayId'] = $data['gatewayId'];
239
+ $merchantinfo['gatewayPass'] = $data['gatewayPass'];
240
+ $paymentdetails = array();
241
+ $paymentdetails['chargetotal'] = $payment->getAmount();
242
+
243
+ $data = array_merge($data, $creditcard, $billing, $shipping, $merchantinfo, $paymentdetails);
244
+
245
+ $result = $this->_postRequest($data);
246
+
247
+ if(is_array($result) && count($result)>0) {
248
 
249
+ if(array_key_exists("Bank_Message",$result)) {
250
+ if ($result["Bank_Message"] != "Approved") {
251
+ $payment->setStatus(self::STATUS_ERROR);
252
+ Mage::throwException("Gateway error : {".(string)$result["EXact_Message"]."}");
253
+ }
254
+ elseif($trxnResult->Transaction_Error){
255
+ Mage::throwException("Returned Error Message: $trxnResult->EXact_Message");
256
+ }
257
+ /*
258
+ elseif($this->getConfigData('useccv') && $trxnResult->CVV2 != "M" ){
259
+ Mage::throwException("Invalid Card Verification Number(".$trxnResult->CVV2.")");
260
+ }*/
261
+ else {
262
+ $payment->setStatus(self::STATUS_APPROVED);
263
+ $payment->setLastTransId((string)$result["Authorization_Num"]);
264
+ $payment->setTransactionTag((string)$result["Transaction_Tag"]);
265
+ if (!$payment->getParentTransactionId() || (string)$result["Authorization_Num"] != $payment->getParentTransactionId()) {
266
+ $payment->setTransactionId((string)$result["Authorization_Num"]);
267
+ }
268
+ return $this;
269
+ }
270
+ }
271
+ else {
272
+ Mage::throwException("No approval found");
273
+ }
274
+ } else {
275
+ Mage::throwException("No response found");
276
+ }
277
+ }
278
+
279
+ public function authorizePayment(Varien_Object $payment, $amount) {
280
+ $payment->setAmount($amount);
281
+ $data = $this->_prepareData();
282
+ $data['trans_type'] = "32";
283
+ $data['transaction_tag'] = $payment->getTransactionTag();
284
 
285
+ #$data['authorization_num'] = $payment->getLastTransId();
286
+ $data['authorization_num'] = $payment->getParentTransactionId();
287
 
288
+ $data['chargetotal'] = $amount;
289
 
290
+ $result = $this->_postRequest($data);
291
+
292
  if(is_array($result) && count($result)>0) {
293
+
294
+ if(array_key_exists("Bank_Message",$result)) {
295
+ if ($result["Bank_Message"] != "Approved") {
296
  $payment->setStatus(self::STATUS_ERROR);
297
+ Mage::throwException("Gateway error : {".(string)$result["EXact_Message"]."}");
298
+ }
299
+ elseif($trxnResult->Transaction_Error){
300
+ Mage::throwException("Returned Error Message: $trxnResult->EXact_Message");
301
+ }
302
+ /*
303
+ elseif($this->getConfigData('useccv') && $trxnResult->CVV2 != "M" ){
304
+ Mage::throwException("Invalid Card Verification Number(".$trxnResult->CVV2.")");
305
+ }*/
306
+ else {
307
  $payment->setStatus(self::STATUS_APPROVED);
308
+ $payment->setLastTransId((string)$result["Authorization_Num"]);
309
+ $payment->setTransactionTag((string)$result["Transaction_Tag"]);
310
+ if (!$payment->getParentTransactionId() || (string)$result["Authorization_Num"] != $payment->getParentTransactionId()) {
311
+ $payment->setTransactionId((string)$result["Authorization_Num"]);
312
  }
313
  return $this;
314
  }
315
+ }
316
+ else {
317
  Mage::throwException("No approval found");
318
  }
 
319
  } else {
320
  Mage::throwException("No response found");
321
  }
330
  */
331
  public function refund(Varien_Object $payment, $amount) {
332
  if ($payment->getRefundTransactionId() && $amount > 0) {
333
+ $data = $this->_prepareData();
334
+ $data["trans_type"] = '34';
335
+ $data["oid"] = $payment->getRefundTransactionId();
336
+ $data['transaction_tag'] = $payment->getTransactionTag();
337
+ $data['authorization_num'] = $payment->getParentTransactionId();
 
 
338
 
339
+ $instance = $payment->getMethodInstance()->getInfoInstance();
340
+ $paymentdetails = array();
341
+ $paymentdetails['chargetotal'] = $amount;
342
+ $paymentdetails['cardnumber'] = $instance->getCcNumber();
343
+ $paymentdetails['ccname'] = $instance->getCcOwner();
344
+ $paymentdetails['cardexpmonth'] = $instance->getCcExpMonth();
345
+ $paymentdetails['cardexpyear'] = substr($instance->getCcExpYear(),-2);
346
+ $shipping = array();
347
+ $billing = array();
348
 
349
+ $data = array_merge($data, $paymentdetails);
350
+ $result = $this->_postRequest($data);
351
  if(is_array($result) && count($result)>0) {
352
+ if(array_key_exists("Bank_Message",$result)) {
353
+ if ($result["Bank_Message"] != "Approved") {
354
+ Mage::throwException("Gateway error : {".(string)$result["EXact_Message"]."}");
355
  } else {
356
  $payment->setStatus(self::STATUS_SUCCESS);
357
+ $payment->setLastTransId((string)$result["Authorization_Num"]);
358
+ if (!$payment->getParentTransactionId() || (string)$result["Authorization_Num"] != $payment->getParentTransactionId()) {
359
+ $payment->setTransactionId((string)$result["Authorization_Num"]);
360
+ }
361
  return $this;
362
  }
363
  } else {
378
  * @return Mage_Paygate_Model_Authorizenet
379
  * @throws Mage_Core_Exception
380
  */
381
+ public function void(Varien_Object $payment)
382
+ {
383
+ if ($payment->getParentTransactionId()) {
384
+ $data = $this->_prepareData();
385
+ $data["trans_type"] = '33';
386
+ $data["oid"] = $payment->getParentTransactionId();
387
+ $data['transaction_tag'] = $payment->getTransactionTag();
388
+ $data['authorization_num'] = $payment->getParentTransactionId();
389
+ $instance = $payment->getMethodInstance()->getInfoInstance();
390
+ $paymentdetails = array();
391
+ $paymentdetails['cardnumber'] = $instance->getCcNumber();
392
+ $data['ccname'] = $instance->getCcOwner();
393
+ $paymentdetails['cardexpmonth'] = $instance->getCcExpMonth();
394
+ $paymentdetails['cardexpyear'] = substr($instance->getCcExpYear(),-2);
395
+ $order = $payment->getOrder();
396
+ $data['chargetotal'] = $order->getGrandTotal();
397
+ $data = array_merge($data, $paymentdetails);
398
+ $result = $this->_postRequest($data);
399
  if(is_array($result) && count($result)>0) {
400
+ if(array_key_exists("Bank_Message",$result)) {
401
+ if ($result["Bank_Message"] != "Approved") {
402
+ Mage::throwException("Gateway error : {".(string)$result["EXact_Message"]."}");
403
  } else {
404
+ $payment->setStatus(self::STATUS_SUCCESS);
405
  return $this;
406
  }
407
  } else {
427
 
428
  /**
429
  * converts a hash of name-value pairs
430
+ * to the correct array for new API
431
+ * change on 19-feb-15
432
  *
433
  * @param Array $pdata
434
  * @return String $xml
435
  */
436
+ protected function _buildRequest($req)
437
+ {
438
+ $request = array(
439
+ "User_Name" => "",
440
+ "Secure_AuthResult" => "",
441
+ "Ecommerce_Flag" => "",
442
+ "XID" => $req["oid"],
443
+ "ExactID" => $req["gatewayId"],
444
+ "CAVV" => "",
445
+ "Password" => $req["gatewayPass"],
446
+ "CAVV_Algorithm" => "",
447
+ "Transaction_Type" => $req["trans_type"],
448
+ "Reference_No" => "",
449
+ "Customer_Ref" => "",
450
+ "Reference_3" => "",
451
+ "Client_IP" => $req["ip"],
452
+ "Client_Email" => $req["email"],
453
+ "Language" => "en",
454
+ "Card_Number" => $req["cardnumber"],
455
+ "Expiry_Date" => sprintf("%02d", $req['cardexpmonth']).$req['cardexpyear'],
456
+ "CardHoldersName" => $req["ccname"],
457
+ "Track1" => "",
458
+ "Track2" => "",
459
+ "Authorization_Num" => $req["authorization_num"],
460
+ "Transaction_Tag" => $req["transaction_tag"],
461
+ "DollarAmount" => $req["chargetotal"],
462
+ "VerificationStr1" => "",
463
+ "VerificationStr2" => $req["cvv2value"],
464
+ "CVD_Presence_Ind" => $req["cvv2indicator"],
465
+ "Secure_AuthRequired"=> "",
466
+ "Currency" => "",
467
+ "PartialRedemption" => "",
468
+ "ZipCode" => $req["zip"],
469
+ "Tax1Amount" => "",
470
+ "Tax1Number" => "",
471
+ "Tax2Amount" => "",
472
+ "Tax2Number" => "",
473
+ "SurchargeAmount" => "",
474
+ "PAN" => ""
475
+ );
476
+
477
+ return $request;
478
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
479
  }
480
 
481
  /**
485
  * @param String $xml
486
  * @return Array $retarr
487
  */
488
+ protected function _readResponse($trxnResult) {
489
+ foreach($trxnResult as $key=>$value){
490
+ $value = nl2br($value);
491
+ $retarr[$key] = $value;
 
 
 
492
  }
 
493
  return $retarr;
494
  }
495
 
496
  /**
497
+ * chnage from: process hash table or xml string table using cURL
498
+ * change to : process data using SoapClientHMAC for latest version of API
499
+ * change on 19-feb-15
500
  *
501
  * @param Array $data
502
  * @return String $xml
503
  */
504
  protected function _postRequest($data) {
505
+
506
  $debugData = array('request' => $data);
507
+ $trxnProperties = '';
508
+ $trxnProperties = $this->_buildRequest($data);
509
+ try
510
+ {
511
+ $client = Mage::getModel('linkpoint/soapclienthmac', array( "url" => $data["wsdlUrl"]));
512
+ $response = $client->SendAndCommit($trxnProperties);
513
+ }catch(Exception $e){
514
+ $debugData['response'] = $e->getMessage();
515
+ $this->_debug($debugData);
516
+ Mage::throwException("Link point authorization failed");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
517
  }
518
+
519
+ if (!$response) {
520
+ $debugData['response'] = $response;
521
+ $this->_debug($debugData);
522
+ Mage::throwException(ucwords("error in $response"));
523
  }
 
524
 
525
+ if(@$client->fault){
526
+ Mage::throwException("FAULT: Code: {$client->faultcode} <BR /> String: {$client->faultstring} </B>");
527
+ $response["CTR"] = "There was an error while processing. No TRANSACTION DATA IN CTR!";
528
+ }
529
 
530
+ $result = $this->_readResponse($response);
531
+ $debugData['response'] = $result;
532
+ /* if($this->getConfigData('debug') == 1) {
533
  $this->_debug($debugData);
534
+ } */
535
+ $this->_debug($debugData);
536
+ return $result;
 
537
  }
538
 
539
+ protected function _prepareData()
540
+ {
541
+ $_coreHelper = Mage::helper('core');
542
+
543
+ $data = array(
544
+ 'keyId' => $_coreHelper->decrypt($this->getConfigData('key_id')),
545
+ 'hmacKey' => $_coreHelper->decrypt($this->getConfigData('hmac_key')),
546
+ 'wsdlUrl' => $this->getConfigData('wsdl_url'),
547
+ 'gatewayId' => $_coreHelper->decrypt($this->getConfigData('gateway_id')),
548
+ 'gatewayPass' => $_coreHelper->decrypt($this->getConfigData('gateway_pass')),
549
+ );
550
+
551
+ if($this->getConfigData('mode')) {
552
+ $data['wsdlUrl'] = "https://api.demo.globalgatewaye4.firstdata.com/transaction/wsdl";
553
  }
554
+
555
+ if(empty($data['keyId']) || empty($data['hmacKey']) || empty($data['wsdlUrl']) || empty($data['gatewayId']) || empty($data['gatewayPass'])){
556
  Mage::throwException("Gateway Parameters Missing");
557
+ }
558
+ return $data;
 
559
  }
560
+
561
+ protected function _addTransaction(Mage_Sales_Model_Order_Payment $payment, $transactionId, $transactionType,
562
+ array $transactionDetails = array(), $message = false ) {
563
+
564
+ $payment->setTransactionId($transactionId);
565
+ $payment->resetTransactionAdditionalInfo();
566
+ foreach ($transactionDetails as $key => $value) {
567
+ $payment->setData($key, $value);
568
+ }
569
+
570
+ $transaction = $payment->addTransaction($transactionType, null, false , $message);
571
+ foreach ($transactionDetails as $key => $value) {
572
+ $payment->unsetData($key);
573
+ }
574
+ $payment->unsLastTransId();
575
+
576
+ $transaction->setMessage($message);
577
+
578
+ return $transaction;
579
+ }
580
  }
581
+
582
  ?>
app/code/community/Raveinfosys/Linkpoint/Model/Observer.php CHANGED
@@ -14,14 +14,17 @@
14
  * @author RaveInfosys, Inc.
15
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
  */
17
- class Raveinfosys_Linkpoint_Model_Observer {
18
- public function disableMethod(Varien_Event_Observer $observer){
19
- $moduleName="Raveinfosys_Linkpoint";
20
- if('linkpoint'==$observer->getMethodInstance()->getCode()){
21
- if(!Mage::getStoreConfigFlag('advanced/modules_disable_output/'.$moduleName)) {
22
- //nothing here, as module is ENABLE
23
- } else {
24
- $observer->getResult()->isAvailable=false;
 
 
 
25
  }
26
 
27
  }
14
  * @author RaveInfosys, Inc.
15
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
  */
17
+ class Raveinfosys_Linkpoint_Model_Observer
18
+ {
19
+
20
+ public function disableMethod(Varien_Event_Observer $observer)
21
+ {
22
+ $moduleName = "Raveinfosys_Linkpoint";
23
+ if('linkpoint' == $observer->getMethodInstance()->getCode())
24
+ {
25
+ if(Mage::getStoreConfigFlag('advanced/modules_disable_output/'.$moduleName))
26
+ {
27
+ $observer->getResult()->isAvailable = false;
28
  }
29
 
30
  }
app/code/community/Raveinfosys/Linkpoint/Model/Soapclienthmac.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Raveinfosys_Linkpoint_Model_Soapclienthmac extends SoapClient
4
+ {
5
+ public function __construct($wsdl, $options = NULL) {
6
+ global $context;
7
+ $context = stream_context_create();
8
+ $options['stream_context'] = $context;
9
+ return parent::SoapClient($wsdl['url'], $options);
10
+ }
11
+
12
+ public function __doRequest($request, $location, $action, $version, $one_way = NULL) {
13
+ global $context;
14
+ $hmacKey = Mage::helper('core')->decrypt(Mage::getStoreConfig('payment/linkpoint/hmac_key'));
15
+ $keyId = Mage::helper('core')->decrypt(Mage::getStoreConfig('payment/linkpoint/key_id'));
16
+ $hashtime = date("c");
17
+ $hashstr = "POST\ntext/xml; charset=utf-8\n" . sha1($request) . "\n" . $hashtime . "\n" . parse_url($location,PHP_URL_PATH);
18
+ $authstr = base64_encode(hash_hmac("sha1", $hashstr, $hmacKey, TRUE));
19
+ if (version_compare(PHP_VERSION, '5.3.11') == -1) {
20
+ ini_set("user_agent", "PHP-SOAP/" . PHP_VERSION . "\r\nAuthorization: GGE4_API " . $keyId . ":" . $authstr . "\r\nx-gge4-date: " . $hashtime . "\r\nx-gge4-content-sha1: " . sha1($request));
21
+ } else {
22
+ stream_context_set_option($context,array("http" => array("header" => "authorization: GGE4_API " . $keyId . ":" . $authstr . "\r\nx-gge4-date: " . $hashtime . "\r\nx-gge4-content-sha1: " . sha1($request))));
23
+ }
24
+ return parent::__doRequest($request, $location, $action, $version, $one_way);
25
+ }
26
+
27
+
28
+ }
app/code/community/Raveinfosys/Linkpoint/etc/config.xml CHANGED
@@ -41,6 +41,17 @@
41
  <class>Raveinfosys_Linkpoint_Model</class>
42
  </linkpoint>
43
  </models>
 
 
 
 
 
 
 
 
 
 
 
44
  </global>
45
  <default>
46
  <payment>
41
  <class>Raveinfosys_Linkpoint_Model</class>
42
  </linkpoint>
43
  </models>
44
+ <resources>
45
+ <linkpoint_setup>
46
+ <setup>
47
+ <module>Raveinfosys_Linkpoint</module>
48
+ <class>Mage_Customer_Model_Entity_Setup</class>
49
+ </setup>
50
+ <connection>
51
+ <use>core_setup</use>
52
+ </connection>
53
+ </linkpoint_setup>
54
+ </resources>
55
  </global>
56
  <default>
57
  <payment>
app/code/community/Raveinfosys/Linkpoint/etc/system.xml CHANGED
@@ -39,25 +39,71 @@
39
  <title translate="label">
40
  <label>Title</label>
41
  <frontend_type>text</frontend_type>
42
- <sort_order>3</sort_order>
43
  <show_in_default>1</show_in_default>
44
  <show_in_website>1</show_in_website>
45
  <show_in_store>1</show_in_store>
46
  </title>
47
- <order_status translate="label">
48
- <label>New Order Status</label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  <frontend_type>select</frontend_type>
50
- <source_model>adminhtml/system_config_source_order_status_newprocessing</source_model>
51
- <sort_order>4</sort_order>
52
  <show_in_default>1</show_in_default>
53
  <show_in_website>1</show_in_website>
54
  <show_in_store>0</show_in_store>
55
- </order_status>
 
56
  <cctypes translate="label">
57
  <label>Credit Card Types</label>
58
  <frontend_type>multiselect</frontend_type>
59
  <source_model>adminhtml/system_config_source_payment_cctype</source_model>
60
- <sort_order>5</sort_order>
61
  <show_in_default>1</show_in_default>
62
  <show_in_website>1</show_in_website>
63
  <show_in_store>0</show_in_store>
@@ -67,34 +113,33 @@
67
  <label>Request Card Security Code</label>
68
  <frontend_type>select</frontend_type>
69
  <source_model>adminhtml/system_config_source_yesno</source_model>
70
- <sort_order>6</sort_order>
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
  </useccv>
75
- <allowspecific translate="label">
76
- <label>Payment from Applicable Countries</label>
77
- <frontend_type>allowspecific</frontend_type>
78
- <sort_order>50</sort_order>
79
- <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
80
  <show_in_default>1</show_in_default>
81
  <show_in_website>1</show_in_website>
82
  <show_in_store>0</show_in_store>
83
- </allowspecific>
84
- <specificcountry translate="label">
85
- <label>Payment from Specific Countries</label>
86
- <frontend_type>multiselect</frontend_type>
87
- <sort_order>51</sort_order>
88
- <source_model>adminhtml/system_config_source_country</source_model>
89
  <show_in_default>1</show_in_default>
90
  <show_in_website>1</show_in_website>
91
  <show_in_store>0</show_in_store>
92
- <can_be_empty>1</can_be_empty>
93
- </specificcountry>
94
  <min_order_total translate="label">
95
  <label>Minimum Order Total</label>
96
  <frontend_type>text</frontend_type>
97
- <sort_order>98</sort_order>
98
  <show_in_default>1</show_in_default>
99
  <show_in_website>1</show_in_website>
100
  <show_in_store>0</show_in_store>
@@ -102,121 +147,47 @@
102
  <max_order_total translate="label">
103
  <label>Maximum Order Total</label>
104
  <frontend_type>text</frontend_type>
105
- <sort_order>99</sort_order>
106
  <show_in_default>1</show_in_default>
107
  <show_in_website>1</show_in_website>
108
  <show_in_store>0</show_in_store>
109
  </max_order_total>
110
- <debug translate="label">
111
- <label>Debug</label>
112
- <frontend_type>select</frontend_type>
113
- <source_model>adminhtml/system_config_source_yesno</source_model>
114
  <sort_order>55</sort_order>
 
115
  <show_in_default>1</show_in_default>
116
  <show_in_website>1</show_in_website>
117
  <show_in_store>0</show_in_store>
118
- </debug>
119
- <test translate="label">
120
- <label>Test Mode</label>
121
- <frontend_type>select</frontend_type>
122
- <source_model>adminhtml/system_config_source_yesno</source_model>
123
  <sort_order>60</sort_order>
 
124
  <show_in_default>1</show_in_default>
125
  <show_in_website>1</show_in_website>
126
  <show_in_store>0</show_in_store>
127
- </test>
128
- <heading_live translate="label">
129
- <label>Live Details</label>
130
- <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
131
- <sort_order>61</sort_order>
132
- <show_in_default>1</show_in_default>
133
- <show_in_website>1</show_in_website>
134
- </heading_live>
135
- <store_number_live translate="label">
136
- <label>Store Number (Live)</label>
137
- <frontend_type>text</frontend_type>
138
- <sort_order>62</sort_order>
139
- <show_in_default>1</show_in_default>
140
- <show_in_website>1</show_in_website>
141
- <show_in_store>0</show_in_store>
142
- </store_number_live>
143
- <host_live translate="label">
144
- <label>Host Name (Live)</label>
145
- <frontend_type>text</frontend_type>
146
- <comment>Live Host Name</comment>
147
- <sort_order>63</sort_order>
148
- <show_in_default>1</show_in_default>
149
- <show_in_website>1</show_in_website>
150
- <show_in_store>0</show_in_store>
151
- </host_live>
152
- <port_live translate="label">
153
- <label>Port (Live)</label>
154
- <frontend_type>text</frontend_type>
155
- <comment>Port</comment>
156
- <sort_order>64</sort_order>
157
- <show_in_default>1</show_in_default>
158
- <show_in_website>1</show_in_website>
159
- <show_in_store>0</show_in_store>
160
- </port_live>
161
- <pem_path_live translate="label">
162
- <label>Pem Path (Live)</label>
163
- <frontend_type>text</frontend_type>
164
- <comment><![CDATA[Absolute Path to .pem file.<br />For eg. "\var\site\www\" (for Linux Servers), or "c:/wamp/www/site/"(for Windows server).]]></comment>
165
- <sort_order>65</sort_order>
166
- <show_in_default>1</show_in_default>
167
- <show_in_website>1</show_in_website>
168
- <show_in_store>0</show_in_store>
169
- </pem_path_live>
170
- <heading_test translate="label">
171
- <label>Test Details</label>
172
- <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
173
- <sort_order>66</sort_order>
174
- <show_in_default>1</show_in_default>
175
- <show_in_website>1</show_in_website>
176
- </heading_test>
177
- <store_number_test translate="label">
178
- <label>Store Number (Test)</label>
179
- <frontend_type>text</frontend_type>
180
- <sort_order>67</sort_order>
181
- <show_in_default>1</show_in_default>
182
- <show_in_website>1</show_in_website>
183
- <show_in_store>0</show_in_store>
184
- </store_number_test>
185
- <host_test translate="label">
186
- <label>Host Name (Test)</label>
187
- <frontend_type>text</frontend_type>
188
- <comment>Test Host Name</comment>
189
- <sort_order>68</sort_order>
190
- <show_in_default>1</show_in_default>
191
- <show_in_website>1</show_in_website>
192
- <show_in_store>0</show_in_store>
193
- </host_test>
194
- <port_test translate="label">
195
- <label>Port (Test)</label>
196
- <frontend_type>text</frontend_type>
197
- <comment>Port</comment>
198
- <sort_order>69</sort_order>
199
- <show_in_default>1</show_in_default>
200
- <show_in_website>1</show_in_website>
201
- <show_in_store>0</show_in_store>
202
- </port_test>
203
- <pem_path_test translate="label">
204
- <label>Pem Path (Test)</label>
205
- <frontend_type>text</frontend_type>
206
- <comment><![CDATA[Absolute Path to .pem file. <br />For eg. "\var\site\www\" (for Linux Servers), or "c:/wamp/www/site/"(for Windows server).]]></comment>
207
- <sort_order>70</sort_order>
208
- <show_in_default>1</show_in_default>
209
- <show_in_website>1</show_in_website>
210
- <show_in_store>0</show_in_store>
211
- </pem_path_test>
212
  <sort_order translate="label">
213
  <label>Sort Order</label>
214
  <frontend_type>text</frontend_type>
215
- <sort_order>100</sort_order>
216
  <show_in_default>1</show_in_default>
217
  <show_in_website>1</show_in_website>
218
  <show_in_store>0</show_in_store>
219
  </sort_order>
 
 
 
 
 
 
 
 
 
220
  </fields>
221
  </linkpoint>
222
  </groups>
39
  <title translate="label">
40
  <label>Title</label>
41
  <frontend_type>text</frontend_type>
42
+ <sort_order>5</sort_order>
43
  <show_in_default>1</show_in_default>
44
  <show_in_website>1</show_in_website>
45
  <show_in_store>1</show_in_store>
46
  </title>
47
+ <!-- *************************************** -->
48
+ <wsdl_url translate="label">
49
+ <label>Gateway URL</label>
50
+ <frontend_type>text</frontend_type>
51
+ <sort_order>6</sort_order>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>0</show_in_store>
55
+ </wsdl_url>
56
+ <gateway_id translate="label">
57
+ <label>Merchant Gateway Id</label>
58
+ <frontend_type>obscure</frontend_type>
59
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
60
+ <sort_order>10</sort_order>
61
+ <show_in_default>1</show_in_default>
62
+ <show_in_website>1</show_in_website>
63
+ <show_in_store>0</show_in_store>
64
+ </gateway_id>
65
+ <gateway_pass translate="label">
66
+ <label>Merchant Gateway Password</label>
67
+ <frontend_type>obscure</frontend_type>
68
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
69
+ <sort_order>15</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>0</show_in_store>
73
+ </gateway_pass>
74
+ <key_id translate="label">
75
+ <label>Key Id</label>
76
+ <frontend_type>obscure</frontend_type>
77
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
78
+ <sort_order>20</sort_order>
79
+ <show_in_default>1</show_in_default>
80
+ <show_in_website>1</show_in_website>
81
+ <show_in_store>0</show_in_store>
82
+ </key_id>
83
+ <hmac_key translate="label">
84
+ <label>HMAC Key</label>
85
+ <frontend_type>obscure</frontend_type>
86
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
87
+ <sort_order>25</sort_order>
88
+ <show_in_default>1</show_in_default>
89
+ <show_in_website>1</show_in_website>
90
+ <show_in_store>0</show_in_store>
91
+ </hmac_key>
92
+ <payment_action translate="label">
93
+ <label>Payment Action</label>
94
  <frontend_type>select</frontend_type>
95
+ <source_model>paygate/authorizenet_source_paymentAction</source_model>
96
+ <sort_order>2</sort_order>
97
  <show_in_default>1</show_in_default>
98
  <show_in_website>1</show_in_website>
99
  <show_in_store>0</show_in_store>
100
+ </payment_action>
101
+ <!-- *************************************** -->
102
  <cctypes translate="label">
103
  <label>Credit Card Types</label>
104
  <frontend_type>multiselect</frontend_type>
105
  <source_model>adminhtml/system_config_source_payment_cctype</source_model>
106
+ <sort_order>30</sort_order>
107
  <show_in_default>1</show_in_default>
108
  <show_in_website>1</show_in_website>
109
  <show_in_store>0</show_in_store>
113
  <label>Request Card Security Code</label>
114
  <frontend_type>select</frontend_type>
115
  <source_model>adminhtml/system_config_source_yesno</source_model>
116
+ <sort_order>35</sort_order>
117
  <show_in_default>1</show_in_default>
118
  <show_in_website>1</show_in_website>
119
  <show_in_store>0</show_in_store>
120
  </useccv>
121
+ <mode translate="label">
122
+ <label>Test Mode</label>
123
+ <frontend_type>select</frontend_type>
124
+ <source_model>adminhtml/system_config_source_yesno</source_model>
125
+ <sort_order>32</sort_order>
126
  <show_in_default>1</show_in_default>
127
  <show_in_website>1</show_in_website>
128
  <show_in_store>0</show_in_store>
129
+ </mode>
130
+ <order_status translate="label">
131
+ <label>New Order Status</label>
132
+ <frontend_type>select</frontend_type>
133
+ <source_model>adminhtml/system_config_source_order_status_newprocessing</source_model>
134
+ <sort_order>40</sort_order>
135
  <show_in_default>1</show_in_default>
136
  <show_in_website>1</show_in_website>
137
  <show_in_store>0</show_in_store>
138
+ </order_status>
 
139
  <min_order_total translate="label">
140
  <label>Minimum Order Total</label>
141
  <frontend_type>text</frontend_type>
142
+ <sort_order>45</sort_order>
143
  <show_in_default>1</show_in_default>
144
  <show_in_website>1</show_in_website>
145
  <show_in_store>0</show_in_store>
147
  <max_order_total translate="label">
148
  <label>Maximum Order Total</label>
149
  <frontend_type>text</frontend_type>
150
+ <sort_order>50</sort_order>
151
  <show_in_default>1</show_in_default>
152
  <show_in_website>1</show_in_website>
153
  <show_in_store>0</show_in_store>
154
  </max_order_total>
155
+ <allowspecific translate="label">
156
+ <label>Payment from Applicable Countries</label>
157
+ <frontend_type>allowspecific</frontend_type>
 
158
  <sort_order>55</sort_order>
159
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
160
  <show_in_default>1</show_in_default>
161
  <show_in_website>1</show_in_website>
162
  <show_in_store>0</show_in_store>
163
+ </allowspecific>
164
+ <specificcountry translate="label">
165
+ <label>Payment from Specific Countries</label>
166
+ <frontend_type>multiselect</frontend_type>
 
167
  <sort_order>60</sort_order>
168
+ <source_model>adminhtml/system_config_source_country</source_model>
169
  <show_in_default>1</show_in_default>
170
  <show_in_website>1</show_in_website>
171
  <show_in_store>0</show_in_store>
172
+ <can_be_empty>1</can_be_empty>
173
+ </specificcountry>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  <sort_order translate="label">
175
  <label>Sort Order</label>
176
  <frontend_type>text</frontend_type>
177
+ <sort_order>65</sort_order>
178
  <show_in_default>1</show_in_default>
179
  <show_in_website>1</show_in_website>
180
  <show_in_store>0</show_in_store>
181
  </sort_order>
182
+ <debug translate="label">
183
+ <label>Debug</label>
184
+ <frontend_type>select</frontend_type>
185
+ <source_model>adminhtml/system_config_source_yesno</source_model>
186
+ <sort_order>70</sort_order>
187
+ <show_in_default>1</show_in_default>
188
+ <show_in_website>1</show_in_website>
189
+ <show_in_store>0</show_in_store>
190
+ </debug>
191
  </fields>
192
  </linkpoint>
193
  </groups>
app/code/community/Raveinfosys/Linkpoint/sql/linkpoint_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+ $connection = $installer->getConnection();
5
+
6
+ $installer->startSetup();
7
+
8
+ $connection->addColumn($this->getTable('sales/order_payment'), 'transaction_tag', 'text null');
9
+
10
+ $installer->endSetup();
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>First_Data_Gateway_Integration</name>
4
- <version>1.0.5</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
@@ -10,12 +10,12 @@
10
  <description>To facilitate the payment options, this extension provides seamless integration with First Data Global Gateway. This extension allows you to make secure payments using FirstData Global Gateway for all your online shopping needs. It supports all credit cards such as Visa, MasterCard, AE, JCB etc.&amp;#xD;&#xD;
11
  &amp;#xD;&#xD;
12
  The customer is not required to leave the Magento store for making the payment. FDGG does support multiple currencies however you need to check FDGG website for latest updates.</description>
13
- <notes>This version is properly tested on the following Magento CE versions: 1.5, 1.6, 1.7,1.8,1.9.0.1.&amp;#xD;&#xD;
14
- This version also supports for PHP V5.5.15</notes>
15
- <authors><author><name>Rave Infosys</name><user>raveinfo</user><email>lpext@raveinfosys.com</email></author></authors>
16
- <date>2014-11-27</date>
17
- <time>10:27:13</time>
18
- <contents><target name="magecommunity"><dir name="Raveinfosys"><dir name="Linkpoint"><dir name="Model"><file name="Linkpoint.php" hash="f8d8f6d8b90fbdee945068da741db51c"/><file name="Observer.php" hash="693ae2128bea852549c719b53aa5d3f8"/></dir><dir name="etc"><file name="config.xml" hash="8809b7589fdab005fbae48aca7d2e9d4"/><file name="system.xml" hash="d1727b5f1a15e19adc00d8c3581b3ec8"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Raveinfosys_Linkpoint.xml" hash="87645041b22e2b0adf581b54991c6ee1"/></dir></target></contents>
19
  <compatible/>
20
- <dependencies><required><php><min>5.2.0</min><max>5.6.3</max></php><extension><name>curl</name><min>7.21.4</min><max>7.36.0</max></extension></required></dependencies>
21
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>First_Data_Gateway_Integration</name>
4
+ <version>1.0.6</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
10
  <description>To facilitate the payment options, this extension provides seamless integration with First Data Global Gateway. This extension allows you to make secure payments using FirstData Global Gateway for all your online shopping needs. It supports all credit cards such as Visa, MasterCard, AE, JCB etc.&amp;#xD;&#xD;
11
  &amp;#xD;&#xD;
12
  The customer is not required to leave the Magento store for making the payment. FDGG does support multiple currencies however you need to check FDGG website for latest updates.</description>
13
+ <notes>This version is properly tested on the following Magento CE versions: 1.5, 1.6, 1.7,1.8,1.9.* &amp;#xD;&#xD;
14
+ This version also supports for PHP V5.6.12</notes>
15
+ <authors><author><name>Rave Infosys</name><user>raveinfo</user><email>magento@raveinfosys.com</email></author></authors>
16
+ <date>2015-09-23</date>
17
+ <time>14:07:38</time>
18
+ <contents><target name="magecommunity"><dir name="Raveinfosys"><dir name="Linkpoint"><dir name="Model"><file name="Linkpoint.php" hash="649ed667cad8da2f8c67e1c84229d2cc"/><file name="Observer.php" hash="139c6944d0935ca220443b9778fb9636"/><file name="Soapclienthmac.php" hash="141d1de345fd2a50e5f1d8a02864ac71"/></dir><dir name="etc"><file name="config.xml" hash="82371b941c82e83de319823153b52822"/><file name="system.xml" hash="0239f9e631759ec0701b8a576b4aeb02"/></dir><dir name="sql"><dir name="linkpoint_setup"><file name="mysql4-install-1.0.0.php" hash="1dde8f774ac03f7b29066f45567f707e"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Raveinfosys_Linkpoint.xml" hash="87645041b22e2b0adf581b54991c6ee1"/></dir></target></contents>
19
  <compatible/>
20
+ <dependencies><required><php><min>5.2.0</min><max>5.6.12</max></php><extension><name>curl</name><min>7.21.4</min><max>7.44.0</max></extension></required></dependencies>
21
  </package>