Mage_Usaepay - Version 1.0.1

Version Notes

* Add setting for changing list of accepted card types

* Line item details are transmitted to gateway

Download this release

Release Info

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


Code changes from version 1.0.0 to 1.0.1

app/code/community/Mage/Usaepay/Block/Form.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * USA ePay Magento Plugin.
4
- * v1.0.0 - September 9th, 2010
5
  *
6
  * For assistance please contact devsupport@usaepay.com
7
  *
@@ -50,14 +50,34 @@ class Mage_Usaepay_Block_Form extends Mage_Payment_Block_Form
50
  $this->setTemplate('usaepay/form.phtml');
51
  parent::_construct();
52
  }
 
 
 
 
 
 
 
 
 
 
 
53
  public function getCcAvailableTypes()
54
  {
55
- $cards['AE'] = 'American Express';
56
- $cards['DI'] = 'Discover Card';
57
- $cards['MC'] = 'Mastercard';
58
- $cards['VI'] = 'Visa';
59
- return $cards;
 
 
 
 
 
 
 
 
60
  }
 
61
  public function getCcMonths(){
62
  $months['01'] = 'January';
63
  $months['02'] = 'February';
@@ -80,5 +100,4 @@ class Mage_Usaepay_Block_Form extends Mage_Payment_Block_Form
80
  return $years;
81
  }
82
 
83
-
84
  }
1
  <?php
2
  /**
3
  * USA ePay Magento Plugin.
4
+ * v1.0.1 - January 28th, 2011
5
  *
6
  * For assistance please contact devsupport@usaepay.com
7
  *
50
  $this->setTemplate('usaepay/form.phtml');
51
  parent::_construct();
52
  }
53
+
54
+ /**
55
+ * Retrieve payment configuration object
56
+ *
57
+ * @return Mage_Payment_Model_Config
58
+ */
59
+ protected function _getConfig()
60
+ {
61
+ return Mage::getSingleton('payment/config');
62
+ }
63
+
64
  public function getCcAvailableTypes()
65
  {
66
+ $types = $this->_getConfig()->getCcTypes();
67
+ if ($method = $this->getMethod()) {
68
+ $availableTypes = $method->getConfigData('cctypes');
69
+ if ($availableTypes) {
70
+ $availableTypes = explode(',', $availableTypes);
71
+ foreach ($types as $code=>$name) {
72
+ if (!in_array($code, $availableTypes)) {
73
+ unset($types[$code]);
74
+ }
75
+ }
76
+ }
77
+ }
78
+ return $types;
79
  }
80
+
81
  public function getCcMonths(){
82
  $months['01'] = 'January';
83
  $months['02'] = 'February';
100
  return $years;
101
  }
102
 
 
103
  }
app/code/community/Mage/Usaepay/Helper/Data.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * USA ePay Magento Plugin.
4
- * v1.0.0 - September 9th, 2010
5
  *
6
  * For assistance please contact devsupport@usaepay.com
7
  *
1
  <?php
2
  /**
3
  * USA ePay Magento Plugin.
4
+ * v1.0.1 - January 28th, 2011
5
  *
6
  * For assistance please contact devsupport@usaepay.com
7
  *
app/code/community/Mage/Usaepay/Model/CCPaymentAction.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * USA ePay Magento Plugin.
4
- * v1.0.0 - September 9th, 2010
5
  *
6
  * For assistance please contact devsupport@usaepay.com
7
  *
@@ -52,6 +52,7 @@ class Mage_Usaepay_Model_CCPaymentAction extends Mage_Payment_Model_Method_Cc
52
  protected $_canCapture = true;
53
  protected $_canCapturePartial = true;
54
  protected $_canRefund = true;
 
55
  protected $_canVoid = true;
56
  protected $_canUseInternal = true;
57
  protected $_canUseCheckout = true;
@@ -199,6 +200,11 @@ class Mage_Usaepay_Model_CCPaymentAction extends Mage_Payment_Model_Method_Cc
199
  $tran->shipzip = $shipping->getPostcode();
200
  $tran->shipcountry = $shipping->getCountry();
201
  }
 
 
 
 
 
202
  }
203
 
204
  //file_put_contents(tempnam('/tmp','authorize'), print_r($payment,true));
@@ -332,7 +338,7 @@ class Mage_Usaepay_Model_CCPaymentAction extends Mage_Payment_Model_Method_Cc
332
 
333
  if($tran->resultcode=='A')
334
  {
335
- $payment->setLastTransId($tran->refnum);
336
  $payment->setStatus(self::STATUS_APPROVED);
337
  //ueLogDebug("Transaction Approved");
338
  } elseif($tran->resultcode == 'D') {
@@ -520,7 +526,7 @@ class Mage_Usaepay_Model_CCPaymentAction extends Mage_Payment_Model_Method_Cc
520
 
521
  $tran->key=$this->getConfigData('sourcekey');
522
  $tran->pin=$this->getConfigData('sourcepin');
523
-
524
  return $tran;
525
  }
526
  }
1
  <?php
2
  /**
3
  * USA ePay Magento Plugin.
4
+ * v1.0.1 - January 28th, 2011
5
  *
6
  * For assistance please contact devsupport@usaepay.com
7
  *
52
  protected $_canCapture = true;
53
  protected $_canCapturePartial = true;
54
  protected $_canRefund = true;
55
+ protected $_canRefundInvoicePartial = true;
56
  protected $_canVoid = true;
57
  protected $_canUseInternal = true;
58
  protected $_canUseCheckout = true;
200
  $tran->shipzip = $shipping->getPostcode();
201
  $tran->shipcountry = $shipping->getCountry();
202
  }
203
+
204
+ // line item data
205
+ foreach ($order->getAllItems() as $item) {
206
+ $tran->addLine($item->getSku(), $item->getName(), '', $item->getPrice(), $item->getQty(), $item->getTaxAmount() );
207
+ }
208
  }
209
 
210
  //file_put_contents(tempnam('/tmp','authorize'), print_r($payment,true));
338
 
339
  if($tran->resultcode=='A')
340
  {
341
+ if($tran->refnum) $payment->setLastTransId($tran->refnum);
342
  $payment->setStatus(self::STATUS_APPROVED);
343
  //ueLogDebug("Transaction Approved");
344
  } elseif($tran->resultcode == 'D') {
526
 
527
  $tran->key=$this->getConfigData('sourcekey');
528
  $tran->pin=$this->getConfigData('sourcepin');
529
+ $tran->software = 'Mage_Usaepay 1.0.1';
530
  return $tran;
531
  }
532
  }
app/code/community/Mage/Usaepay/Model/TranApi.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * USA ePay Magento Plugin.
4
- * v1.0.0 - September 9th, 2010
5
  *
6
  * Copyright (c) 2010 USAePay
7
  * All rights reserved.
1
  <?php
2
  /**
3
  * USA ePay Magento Plugin.
4
+ * v1.0.1 - January 28th, 2011
5
  *
6
  * Copyright (c) 2010 USAePay
7
  * All rights reserved.
app/code/community/Mage/Usaepay/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <!--
3
  /**
4
  * USA ePay Magento Plugin.
5
- * v1.0.0 - September 9th, 2010
6
  *
7
  * For assistance please contact devsupport@usaepay.com
8
  *
@@ -82,6 +82,7 @@
82
  <allowspecific>0</allowspecific>
83
  <cctypes>AE,VI,MC,DI</cctypes>
84
  <payment_action>authorize</payment_action>
 
85
  </usaepay>
86
  </payment>
87
  </default>
2
  <!--
3
  /**
4
  * USA ePay Magento Plugin.
5
+ * v1.0.1 - January 28th, 2011
6
  *
7
  * For assistance please contact devsupport@usaepay.com
8
  *
82
  <allowspecific>0</allowspecific>
83
  <cctypes>AE,VI,MC,DI</cctypes>
84
  <payment_action>authorize</payment_action>
85
+ <currency>USD</currency>
86
  </usaepay>
87
  </payment>
88
  </default>
app/code/community/Mage/Usaepay/etc/system.xml CHANGED
@@ -2,7 +2,7 @@
2
  <!--
3
  /**
4
  * USA ePay Magento Plugin.
5
- * v1.0.0 - September 9th, 2010
6
  *
7
  * For assistance please contact devsupport@usaepay.com
8
  *
@@ -110,7 +110,7 @@
110
  <show_in_website>1</show_in_website>
111
  <show_in_store>0</show_in_store>
112
  </custreceipt>
113
- <custreceipt_template translate="label comment">
114
  <label>Receipt Template</label>
115
  <comment>Leave blank to use the default customer receipt template or enter the name of a custom receipt created in the USAePay merchant console.</comment>
116
  <frontend_type>text</frontend_type>
@@ -154,11 +154,20 @@
154
  <show_in_website>1</show_in_website>
155
  <show_in_store>0</show_in_store>
156
  </sort_order>
 
 
 
 
 
 
 
 
 
157
  <currency translate="label">
158
  <label>Accepted currency</label>
159
  <frontend_type>select</frontend_type>
160
  <source_model>adminhtml/system_config_source_currency</source_model>
161
- <sort_order>6</sort_order>
162
  <show_in_default>1</show_in_default>
163
  <show_in_website>1</show_in_website>
164
  <show_in_store>0</show_in_store>
2
  <!--
3
  /**
4
  * USA ePay Magento Plugin.
5
+ * v1.0.1 - January 28th, 2011
6
  *
7
  * For assistance please contact devsupport@usaepay.com
8
  *
110
  <show_in_website>1</show_in_website>
111
  <show_in_store>0</show_in_store>
112
  </custreceipt>
113
+ <custreceipt_template translate="label comment">
114
  <label>Receipt Template</label>
115
  <comment>Leave blank to use the default customer receipt template or enter the name of a custom receipt created in the USAePay merchant console.</comment>
116
  <frontend_type>text</frontend_type>
154
  <show_in_website>1</show_in_website>
155
  <show_in_store>0</show_in_store>
156
  </sort_order>
157
+ <cctypes translate="label">
158
+ <label>Credit Card Types</label>
159
+ <frontend_type>multiselect</frontend_type>
160
+ <source_model>paygate/authorizenet_source_cctype</source_model>
161
+ <sort_order>15</sort_order>
162
+ <show_in_default>1</show_in_default>
163
+ <show_in_website>1</show_in_website>
164
+ <show_in_store>0</show_in_store>
165
+ </cctypes>
166
  <currency translate="label">
167
  <label>Accepted currency</label>
168
  <frontend_type>select</frontend_type>
169
  <source_model>adminhtml/system_config_source_currency</source_model>
170
+ <sort_order>16</sort_order>
171
  <show_in_default>1</show_in_default>
172
  <show_in_website>1</show_in_website>
173
  <show_in_store>0</show_in_store>
app/design/adminhtml/{default → base}/default/template/usaepay/form.phtml RENAMED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * USA ePay Magento Plugin.
4
- * v1.0.0 - September 9th, 2010
5
  *
6
  * For assistance please contact devsupport@usaepay.com
7
  *
1
  <?php
2
  /**
3
  * USA ePay Magento Plugin.
4
+ * v1.0.1 - January 28th, 2011
5
  *
6
  * For assistance please contact devsupport@usaepay.com
7
  *
app/design/frontend/{default → base}/default/template/usaepay/form.phtml RENAMED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * USA ePay Magento Plugin.
4
- * v1.0.0 - September 9th, 2010
5
  *
6
  * For assistance please contact devsupport@usaepay.com
7
  *
1
  <?php
2
  /**
3
  * USA ePay Magento Plugin.
4
+ * v1.0.1 - January 28th, 2011
5
  *
6
  * For assistance please contact devsupport@usaepay.com
7
  *
app/etc/modules/Mage_Usaepay.xml CHANGED
@@ -2,7 +2,7 @@
2
  <!--
3
  /**
4
  * USA ePay Magento Plugin.
5
- * v1.0.0 - September 9th, 2010
6
  *
7
  * For assistance please contact devsupport@usaepay.com
8
  *
2
  <!--
3
  /**
4
  * USA ePay Magento Plugin.
5
+ * v1.0.1 - January 28th, 2011
6
  *
7
  * For assistance please contact devsupport@usaepay.com
8
  *
package.xml CHANGED
@@ -1,20 +1,20 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_Usaepay</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/bsd-license.php">BSD License</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Payment gateway module for USAePay.</summary>
10
  <description>Credit Card processing module for the USAePay payment gateway. Provides full payment integration, allowing merchants to manage their credit card payments entirely from within Magento. Supports partial shipments, refunds and voids.</description>
11
- <notes>* New setting to enable a customer receipt to be sent by the gateway. Also allows selection of custom receipt template.
12
 
13
- * Disable storing of credit card numbers in Magento. Instead, invoice and refund function use secure tokens (sale by refnum).</notes>
14
  <authors><author><name>Tim McEwen</name><user>auto-converted</user><email>magento@tmcode.com</email></author></authors>
15
- <date>2010-09-09</date>
16
- <time>22:06:37</time>
17
- <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="usaepay"><file name="form.phtml" hash="a002c4508f89475d7e813fa0825d9723"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="usaepay"><file name="form.phtml" hash="aba11c38e8836741b4fea3ddff08edfa"/></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Mage"><dir name="Usaepay"><dir name="Block"><file name="Form.php" hash="e2450d0cf28d83a26d377bcb241045dd"/></dir><dir name="etc"><file name="config.xml" hash="09ab9165497cd5a6dc6ec535548cc3ea"/><file name="system.xml" hash="83bc5121748efd73cff5a5be14cff0c9"/></dir><dir name="Helper"><file name="Data.php" hash="660b74bb453bafa462226d0a815c4d92"/></dir><dir name="Model"><file name="CCPaymentAction.php" hash="5047b8328b225207b9cf9922ebf4b43b"/><file name="TranApi.php" hash="911c8196e8f59ceaa49db20888b6a270"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Usaepay.xml" hash="4d1b04b969ec1e73aa3e009661349d5e"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies/>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_Usaepay</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/bsd-license.php">BSD License</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Payment gateway module for USAePay.</summary>
10
  <description>Credit Card processing module for the USAePay payment gateway. Provides full payment integration, allowing merchants to manage their credit card payments entirely from within Magento. Supports partial shipments, refunds and voids.</description>
11
+ <notes>* Add setting for changing list of accepted card types
12
 
13
+ * Line item details are transmitted to gateway</notes>
14
  <authors><author><name>Tim McEwen</name><user>auto-converted</user><email>magento@tmcode.com</email></author></authors>
15
+ <date>2011-01-26</date>
16
+ <time>20:38:42</time>
17
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="template"><dir name="usaepay"><file name="form.phtml" hash="dce0f6a88065a7d3a7c5177f2595faed"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="usaepay"><file name="form.phtml" hash="87863f9b608f89133c0532e222f83a06"/></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Mage"><dir name="Usaepay"><dir name="Block"><file name="Form.php" hash="3df424b9b657b9cb1b60bfe187a0ea91"/></dir><dir name="etc"><file name="config.xml" hash="94897d705a7b56bd980c1831d7425cf2"/><file name="system.xml" hash="c0c4675b5815dcc7a0f780874e425887"/></dir><dir name="Helper"><file name="Data.php" hash="5ce61e29e6ab579e7b69a7b29b443521"/></dir><dir name="Model"><file name="CCPaymentAction.php" hash="97ea35d3e76a5d7e0f82d5047832d05c"/><file name="TranApi.php" hash="ade39d688faf08fa7c50d31ba05f6922"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Usaepay.xml" hash="a8ed808ca7a716465eef0961c09d8711"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies/>
20
  </package>