ND_Amex - Version 0.1.3

Version Notes

This module will integrate Amex payment method using its Api.

Download this release

Release Info

Developer Nikul Doshi
Extension ND_Amex
Version 0.1.3
Comparing to
See all releases


Code changes from version 0.1.1 to 0.1.3

app/code/local/ND/Amex/Model/Server.php CHANGED
@@ -130,17 +130,22 @@ class ND_Amex_Model_Server extends Mage_Payment_Model_Method_Abstract
130
  $lengs = 0;
131
  $paymentInfo = $this->getInfoInstance();
132
  $fields = array(
133
- //"Title"=>'Amex VPC',
134
  "vpc_AccessCode"=>$this->getAccessCode(),
135
- "vpc_Amount"=>$this->_getAmount(), // 1000 - For Testing
 
 
 
136
  "vpc_Command"=>"pay",
 
137
  "vpc_Locale"=>"en",
138
  "vpc_MerchTxnRef"=>$paymentInfo->getOrder()->getRealOrderId(),
139
  "vpc_Merchant"=>$this->getMerchantId(),
140
  "vpc_OrderInfo"=>$paymentInfo->getOrder()->getRealOrderId(),
141
  "vpc_ReturnURL"=>Mage::getUrl('amex/' . $this->_paymentMethod . '/response', array('_secure' => true)),
142
  "vpc_TicketNo"=>'1',
143
- "vpc_Version"=>'1'
 
 
144
  );
145
  $str = '';
146
  foreach($fields as $key => $val)
@@ -149,19 +154,20 @@ class ND_Amex_Model_Server extends Mage_Payment_Model_Method_Abstract
149
  }
150
 
151
  $secure_hash_key = strtoupper(md5($this->getSecureHashKey().$str));
152
-
153
- //$fieldsArr['Title'] = 'Amex VPC';
154
  $fieldsArr['vpc_AccessCode'] = $this->getAccessCode();
155
  $fieldsArr['vpc_Amount'] = $this->_getAmount();
156
  $fieldsArr['vpc_Command'] = 'pay';
157
- //$fieldsArr['vpc_Currency']='USD';
158
  $fieldsArr['vpc_Locale'] = 'en';
159
  $fieldsArr['vpc_MerchTxnRef'] = $paymentInfo->getOrder()->getRealOrderId();
160
  $fieldsArr['vpc_Merchant'] = $this->getMerchantId();
161
  $fieldsArr['vpc_OrderInfo'] = $paymentInfo->getOrder()->getRealOrderId();
162
  $fieldsArr['vpc_ReturnURL'] = Mage::getUrl('amex/' . $this->_paymentMethod . '/response', array('_secure' => true));
163
  $fieldsArr['vpc_TicketNo'] = '1';
164
- $fieldsArr['vpc_Version'] = '1';
 
 
165
  $fieldsArr['vpc_SecureHash'] = $secure_hash_key;
166
 
167
  return $fieldsArr;
@@ -254,7 +260,16 @@ class ND_Amex_Model_Server extends Mage_Payment_Model_Method_Abstract
254
  //$paymentInst->setTransactionId($response['vpc_TransactionNo']);
255
  $paymentInst->setStatus(self::STATUS_APPROVED)
256
  ->setLastTransId($response->Reference)
257
- ->setTransactionId($response->Reference);
 
 
 
 
 
 
 
 
 
258
  /*->setAdditionalInformation(ND_Amex_Model_Info::PAN_INFO,$response->PAN)
259
  ->setAdditionalInformation(ND_Amex_Model_Info::AUTH_CODE,$response->AuthCode)
260
  ->setAdditionalInformation(ND_Amex_Model_Info::SCHEME,$response->Scheme);*/
130
  $lengs = 0;
131
  $paymentInfo = $this->getInfoInstance();
132
  $fields = array(
 
133
  "vpc_AccessCode"=>$this->getAccessCode(),
134
+ "vpc_Amount"=>$this->_getAmount(), // 1000 - For Testing
135
+ /*"vpc_CardExp"=>,
136
+ "vpc_CardNum"=>,
137
+ "vpc_CardSecurityCode"=>,*/
138
  "vpc_Command"=>"pay",
139
+ //"vpc_Currency"=>$paymentInfo->getOrder()->getBaseCurrencyCode(),
140
  "vpc_Locale"=>"en",
141
  "vpc_MerchTxnRef"=>$paymentInfo->getOrder()->getRealOrderId(),
142
  "vpc_Merchant"=>$this->getMerchantId(),
143
  "vpc_OrderInfo"=>$paymentInfo->getOrder()->getRealOrderId(),
144
  "vpc_ReturnURL"=>Mage::getUrl('amex/' . $this->_paymentMethod . '/response', array('_secure' => true)),
145
  "vpc_TicketNo"=>'1',
146
+ "vpc_Version"=>'1',
147
+ "vpc_card"=>"Amex",
148
+ "vpc_gateway"=>"ssl",
149
  );
150
  $str = '';
151
  foreach($fields as $key => $val)
154
  }
155
 
156
  $secure_hash_key = strtoupper(md5($this->getSecureHashKey().$str));
157
+
 
158
  $fieldsArr['vpc_AccessCode'] = $this->getAccessCode();
159
  $fieldsArr['vpc_Amount'] = $this->_getAmount();
160
  $fieldsArr['vpc_Command'] = 'pay';
161
+ //$fieldsArr['vpc_Currency']=$paymentInfo->getOrder()->getBaseCurrencyCode();
162
  $fieldsArr['vpc_Locale'] = 'en';
163
  $fieldsArr['vpc_MerchTxnRef'] = $paymentInfo->getOrder()->getRealOrderId();
164
  $fieldsArr['vpc_Merchant'] = $this->getMerchantId();
165
  $fieldsArr['vpc_OrderInfo'] = $paymentInfo->getOrder()->getRealOrderId();
166
  $fieldsArr['vpc_ReturnURL'] = Mage::getUrl('amex/' . $this->_paymentMethod . '/response', array('_secure' => true));
167
  $fieldsArr['vpc_TicketNo'] = '1';
168
+ $fieldsArr['vpc_Version'] = '1';
169
+ $fieldsArr['vpc_card'] = 'Amex';
170
+ $fieldsArr['vpc_gateway'] = 'ssl';
171
  $fieldsArr['vpc_SecureHash'] = $secure_hash_key;
172
 
173
  return $fieldsArr;
260
  //$paymentInst->setTransactionId($response['vpc_TransactionNo']);
261
  $paymentInst->setStatus(self::STATUS_APPROVED)
262
  ->setLastTransId($response->Reference)
263
+ ->setTransactionId($response->Reference)
264
+ ->setAdditionalInformation(ND_Amex_Model_Info::ORDER_INFO,$response['vpc_OrderInfo'])
265
+ ->setAdditionalInformation(ND_Amex_Model_Info::RECEIPT_NO,$response['vpc_ReceiptNo'])
266
+ ->setAdditionalInformation(ND_Amex_Model_Info::TRANSACTION_NO,$response['vpc_TransactionNo'])
267
+ ->setAdditionalInformation(ND_Amex_Model_Info::TRANSACTION_CODE,$response['vpc_TransactionCode'])
268
+ ->setAdditionalInformation(ND_Amex_Model_Info::MERCH_TXN_REF,$response['vpc_MerchTxnRef'])
269
+ ->setAdditionalInformation(ND_Amex_Model_Info::BATCH_NO,$response['vpc_BatchNo'])
270
+ ->setAdditionalInformation(ND_Amex_Model_Info::AVS_RESULT_CODE,$response['vpc_AVSResultCode'])
271
+ ->setAdditionalInformation(ND_Amex_Model_Info::AVS_RESPONSE_CODE,$response['vpc_AcqAVSRespCode'])
272
+ ->setAdditionalInformation(ND_Amex_Model_Info::ACQ_CSC_RESPONSE_CODE,$response['vpc_AcqCSCRespCode']);
273
  /*->setAdditionalInformation(ND_Amex_Model_Info::PAN_INFO,$response->PAN)
274
  ->setAdditionalInformation(ND_Amex_Model_Info::AUTH_CODE,$response->AuthCode)
275
  ->setAdditionalInformation(ND_Amex_Model_Info::SCHEME,$response->Scheme);*/
app/code/local/ND/Amex/controllers/ServerController.php CHANGED
@@ -38,7 +38,7 @@ class ND_Amex_ServerController extends ND_Amex_Controller_Abstract
38
  }
39
  elseif($responseParams['vpc_TxnResponseCode']=='0')
40
  {
41
- Mage::getModel('migsvpc/server')->afterSuccessOrder($responseParams);
42
  $cart = Mage::getSingleton('checkout/cart');
43
  $cart->truncate();
44
  $cart->save();
38
  }
39
  elseif($responseParams['vpc_TxnResponseCode']=='0')
40
  {
41
+ Mage::getModel('amex/server')->afterSuccessOrder($responseParams);
42
  $cart = Mage::getSingleton('checkout/cart');
43
  $cart->truncate();
44
  $cart->save();
app/code/local/ND/Amex/etc/config.xml CHANGED
@@ -24,7 +24,7 @@
24
  <config>
25
  <modules>
26
  <ND_Amex>
27
- <version>0.1.1</version>
28
  </ND_Amex>
29
  </modules>
30
  <global>
24
  <config>
25
  <modules>
26
  <ND_Amex>
27
+ <version>0.1.3</version>
28
  </ND_Amex>
29
  </modules>
30
  <global>
app/code/local/ND/Amex/etc/system.xml CHANGED
@@ -103,7 +103,7 @@
103
  <order_status translate="label">
104
  <label>New order status</label>
105
  <frontend_type>select</frontend_type>
106
- <source_model>adminhtml/system_config_source_order_status_processing</source_model>
107
  <sort_order>100</sort_order>
108
  <show_in_default>1</show_in_default>
109
  <show_in_website>1</show_in_website>
103
  <order_status translate="label">
104
  <label>New order status</label>
105
  <frontend_type>select</frontend_type>
106
+ <source_model>adminhtml/system_config_source_order_status_newprocessing</source_model>
107
  <sort_order>100</sort_order>
108
  <show_in_default>1</show_in_default>
109
  <show_in_website>1</show_in_website>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ND_Amex</name>
4
- <version>0.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>This module will integrate Amex payment method using its Api.</description>
11
  <notes>This module will integrate Amex payment method using its Api.</notes>
12
  <authors><author><name>Nikul Doshi</name><user>nikulonline</user><email>nikulonline@gmail.com</email></author></authors>
13
- <date>2014-10-18</date>
14
- <time>10:21:35</time>
15
- <contents><target name="magelocal"><dir name="ND"><dir name="Amex"><dir name="Block"><file name="Form.php" hash="5274e086aa14e46c3f418e74c02318fc"/><file name="Info.php" hash="107012a9d5e50cd2f2e227d5a7f9cb5d"/><dir name="Payment"><file name="Info.php" hash="29f650baf496d3d65bcdeab65b7c78d1"/></dir><dir name="Server"><file name="Failure.php" hash="4bc33161e1d1c221e68cd0234aa9cb00"/><file name="Form.php" hash="ab263fbbaa584a6374f3681b4d0d2110"/><file name="Redirect.php" hash="b265a9c50352bfd70745f7239f39b230"/><file name="Response.php" hash="cdc291119a3ac642d4b0e2595b8888ce"/></dir></dir><dir name="Controller"><file name="Abstract.php" hash="d79d2176d9eca6b0abb8bc59bdaae6da"/></dir><dir name="Helper"><file name="Data.php" hash="ec005848cf9242ee45ea818ceee01e94"/></dir><dir name="Model"><file name="Info.php" hash="30b74b0ff8f20a3032a6941d72c009bb"/><file name="Server.php" hash="95574c6b872846975c031852be8441a8"/></dir><dir name="controllers"><file name="ServerController.php" hash="b198ba194fd139368b1bb342466f9725"/></dir><dir name="etc"><file name="config.xml" hash="fb1658cca8435c2b357d96ec91c44b14"/><file name="system.xml" hash="5d8514366ac98cd017602e4108915521"/></dir><dir name="sql"><dir name="migsvpc_setup"><file name="mysql4-install-0.1.0.php" hash="807e55283d420d745aa65b31f376e22c"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="amex.xml" hash="37a6915378acaf8137359ff824f7ffe0"/></dir><dir name="template"><dir name="amex"><file name="form.phtml" hash="416411ec28758fa15de6c4d8ba6b102c"/><file name="info.phtml" hash="c13fe64ae97929b3b732d25b695527ea"/><dir name="method"><dir name="payment"><dir name="bpay"><file name="form.phtml" hash="4ec688f6b5e63186a91ff2414a567f81"/><file name="info.phtml" hash="7d010d2286e619e4a51de4f086ab71c1"/><file name="success.phtml" hash="55572c890d2fb68ded98b051502c31bd"/></dir><dir name="directdeposit"><file name="form.phtml" hash="ed7e15aa93805a227c00997961f7fb93"/><file name="info.phtml" hash="025c3e3b932f9864b0ccb46a58b6df78"/><file name="success.phtml" hash="d460923ed13b3e27abdebed921689490"/></dir></dir><file name="postcode-checkout.phtml" hash="dba2b90faf906a4ff17c72229600a259"/><file name="postcode.phtml" hash="e7c5e5c23f5c7750772321e1c4ffe06b"/></dir><dir name="server"><file name="form.phtml" hash="fcb0d5002d5efea2faeeefb5f66d0600"/><file name="response.phtml" hash="8a3f5b9be4901568104472399b1b1398"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="ND_Amex.xml" hash="811bcf28abb00dbfd03cc966c354eb0c"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ND_Amex</name>
4
+ <version>0.1.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
10
  <description>This module will integrate Amex payment method using its Api.</description>
11
  <notes>This module will integrate Amex payment method using its Api.</notes>
12
  <authors><author><name>Nikul Doshi</name><user>nikulonline</user><email>nikulonline@gmail.com</email></author></authors>
13
+ <date>2014-12-29</date>
14
+ <time>12:29:05</time>
15
+ <contents><target name="magelocal"><dir name="ND"><dir name="Amex"><dir name="Block"><file name="Form.php" hash="5274e086aa14e46c3f418e74c02318fc"/><file name="Info.php" hash="107012a9d5e50cd2f2e227d5a7f9cb5d"/><dir name="Payment"><file name="Info.php" hash="29f650baf496d3d65bcdeab65b7c78d1"/></dir><dir name="Server"><file name="Failure.php" hash="4bc33161e1d1c221e68cd0234aa9cb00"/><file name="Form.php" hash="ab263fbbaa584a6374f3681b4d0d2110"/><file name="Redirect.php" hash="b265a9c50352bfd70745f7239f39b230"/><file name="Response.php" hash="cdc291119a3ac642d4b0e2595b8888ce"/></dir></dir><dir name="Controller"><file name="Abstract.php" hash="d79d2176d9eca6b0abb8bc59bdaae6da"/></dir><dir name="Helper"><file name="Data.php" hash="ec005848cf9242ee45ea818ceee01e94"/></dir><dir name="Model"><file name="Info.php" hash="30b74b0ff8f20a3032a6941d72c009bb"/><file name="Server.php" hash="d55775e27bc4960fd941bb6c05aac0df"/></dir><dir name="controllers"><file name="ServerController.php" hash="e1ea3eacb326bad97807a1872441cb28"/></dir><dir name="etc"><file name="config.xml" hash="7b008e5039a36095b779d4932561ba9e"/><file name="system.xml" hash="d50c793eb4d3c6834fc6714d7edd0b41"/></dir><dir name="sql"><dir name="migsvpc_setup"><file name="mysql4-install-0.1.0.php" hash="807e55283d420d745aa65b31f376e22c"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="amex.xml" hash="37a6915378acaf8137359ff824f7ffe0"/></dir><dir name="template"><dir name="amex"><file name="form.phtml" hash="416411ec28758fa15de6c4d8ba6b102c"/><file name="info.phtml" hash="c13fe64ae97929b3b732d25b695527ea"/><dir name="method"><dir name="payment"><dir name="bpay"><file name="form.phtml" hash="4ec688f6b5e63186a91ff2414a567f81"/><file name="info.phtml" hash="7d010d2286e619e4a51de4f086ab71c1"/><file name="success.phtml" hash="55572c890d2fb68ded98b051502c31bd"/></dir><dir name="directdeposit"><file name="form.phtml" hash="ed7e15aa93805a227c00997961f7fb93"/><file name="info.phtml" hash="025c3e3b932f9864b0ccb46a58b6df78"/><file name="success.phtml" hash="d460923ed13b3e27abdebed921689490"/></dir></dir><file name="postcode-checkout.phtml" hash="dba2b90faf906a4ff17c72229600a259"/><file name="postcode.phtml" hash="e7c5e5c23f5c7750772321e1c4ffe06b"/></dir><dir name="server"><file name="form.phtml" hash="fcb0d5002d5efea2faeeefb5f66d0600"/><file name="response.phtml" hash="8a3f5b9be4901568104472399b1b1398"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="ND_Amex.xml" hash="811bcf28abb00dbfd03cc966c354eb0c"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>