Version Notes
add diners for pxpost
fix for cancelled payment
Download this release
Release Info
Developer | Magento Core Team |
Extension | MageBase_DpsPaymentExpress |
Version | 1.1.17 |
Comparing to | |
See all releases |
Code changes from version 1.1.13 to 1.1.17
- app/code/community/MageBase/DpsPaymentExpress/Model/Method/Pxpay.php +7 -7
- app/code/community/MageBase/DpsPaymentExpress/Model/Method/Pxpost.php +38 -18
- app/code/community/MageBase/DpsPaymentExpress/controllers/PxpayController.php +16 -5
- app/code/community/MageBase/DpsPaymentExpress/etc/config.xml +12 -1
- app/design/frontend/base/default/template/magebase/dps/pxpost/form.phtml +38 -63
- package.xml +6 -7
app/code/community/MageBase/DpsPaymentExpress/Model/Method/Pxpay.php
CHANGED
@@ -56,7 +56,7 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpay extends Mage_Payment_Model_M
|
|
56 |
*
|
57 |
* @return string
|
58 |
*/
|
59 |
-
|
60 |
{
|
61 |
return Mage::getStoreConfigFlag('payment/'.$this->_code.'/active');
|
62 |
}
|
@@ -66,7 +66,7 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpay extends Mage_Payment_Model_M
|
|
66 |
*
|
67 |
* @return string
|
68 |
*/
|
69 |
-
|
70 |
{
|
71 |
return Mage::helper('core')->decrypt(Mage::getStoreConfig('payment/'.$this->_code.'/pxpayuserid'));
|
72 |
}
|
@@ -76,7 +76,7 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpay extends Mage_Payment_Model_M
|
|
76 |
*
|
77 |
* @return string
|
78 |
*/
|
79 |
-
|
80 |
{
|
81 |
return Mage::helper('core')->decrypt(Mage::getStoreConfig('payment/'.$this->_code.'/pxpaykey'));
|
82 |
}
|
@@ -87,7 +87,7 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpay extends Mage_Payment_Model_M
|
|
87 |
*
|
88 |
* @return int
|
89 |
*/
|
90 |
-
|
91 |
{
|
92 |
switch(Mage::getStoreConfig('payment/'.$this->_code.'/payment_action')) {
|
93 |
case Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE:
|
@@ -308,7 +308,7 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpay extends Mage_Payment_Model_M
|
|
308 |
->setRequestBody($xml->asXML())
|
309 |
->save();
|
310 |
}
|
311 |
-
|
312 |
$response = $client->request('POST');
|
313 |
|
314 |
$responseXml = simplexml_load_string($response->getBody());
|
@@ -358,7 +358,7 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpay extends Mage_Payment_Model_M
|
|
358 |
);
|
359 |
return MageBase_DpsPaymentExpress_Model_Method_Common::STATUS_ERROR;
|
360 |
}
|
361 |
-
if((
|
362 |
Mage::log(
|
363 |
$order->getIncrementId(). " Error in DPS Response Validation: Mismatched currencies",
|
364 |
null,
|
@@ -394,7 +394,7 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpay extends Mage_Payment_Model_M
|
|
394 |
);
|
395 |
return MageBase_DpsPaymentExpress_Model_Method_Common::STATUS_OK_DONT_INVOICE;
|
396 |
break;
|
397 |
-
}
|
398 |
}
|
399 |
//not supported
|
400 |
Mage::log(
|
56 |
*
|
57 |
* @return string
|
58 |
*/
|
59 |
+
protected function _isActive()
|
60 |
{
|
61 |
return Mage::getStoreConfigFlag('payment/'.$this->_code.'/active');
|
62 |
}
|
66 |
*
|
67 |
* @return string
|
68 |
*/
|
69 |
+
protected function _getPxPayUserId()
|
70 |
{
|
71 |
return Mage::helper('core')->decrypt(Mage::getStoreConfig('payment/'.$this->_code.'/pxpayuserid'));
|
72 |
}
|
76 |
*
|
77 |
* @return string
|
78 |
*/
|
79 |
+
protected function _getPxPayKey()
|
80 |
{
|
81 |
return Mage::helper('core')->decrypt(Mage::getStoreConfig('payment/'.$this->_code.'/pxpaykey'));
|
82 |
}
|
87 |
*
|
88 |
* @return int
|
89 |
*/
|
90 |
+
protected function _getPxPayPaymentAction()
|
91 |
{
|
92 |
switch(Mage::getStoreConfig('payment/'.$this->_code.'/payment_action')) {
|
93 |
case Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE:
|
308 |
->setRequestBody($xml->asXML())
|
309 |
->save();
|
310 |
}
|
311 |
+
|
312 |
$response = $client->request('POST');
|
313 |
|
314 |
$responseXml = simplexml_load_string($response->getBody());
|
358 |
);
|
359 |
return MageBase_DpsPaymentExpress_Model_Method_Common::STATUS_ERROR;
|
360 |
}
|
361 |
+
if((string)$resultXml->CurrencySettlement != $order->getBaseCurrencyCode()) {
|
362 |
Mage::log(
|
363 |
$order->getIncrementId(). " Error in DPS Response Validation: Mismatched currencies",
|
364 |
null,
|
394 |
);
|
395 |
return MageBase_DpsPaymentExpress_Model_Method_Common::STATUS_OK_DONT_INVOICE;
|
396 |
break;
|
397 |
+
}
|
398 |
}
|
399 |
//not supported
|
400 |
Mage::log(
|
app/code/community/MageBase/DpsPaymentExpress/Model/Method/Pxpost.php
CHANGED
@@ -54,7 +54,7 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpost extends Mage_Payment_Model_
|
|
54 |
*
|
55 |
* @return string
|
56 |
*/
|
57 |
-
|
58 |
{
|
59 |
return Mage::helper('core')->decrypt(Mage::getStoreConfig('payment/'.$this->_code.'/postusername'));
|
60 |
}
|
@@ -64,7 +64,7 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpost extends Mage_Payment_Model_
|
|
64 |
*
|
65 |
* @return string
|
66 |
*/
|
67 |
-
|
68 |
{
|
69 |
return Mage::helper('core')->decrypt(Mage::getStoreConfig('payment/'.$this->_code.'/postpassword'));
|
70 |
}
|
@@ -86,7 +86,7 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpost extends Mage_Payment_Model_
|
|
86 |
break;
|
87 |
}
|
88 |
}
|
89 |
-
|
90 |
/**
|
91 |
* check if current currency code is allowed for this payment method
|
92 |
*
|
@@ -201,7 +201,7 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpost extends Mage_Payment_Model_
|
|
201 |
}
|
202 |
return $this;
|
203 |
}
|
204 |
-
|
205 |
/**
|
206 |
* create transaction object in xml and submit to server
|
207 |
*
|
@@ -211,7 +211,7 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpost extends Mage_Payment_Model_
|
|
211 |
{
|
212 |
|
213 |
$payment = $this->getPayment();
|
214 |
-
|
215 |
$client = new Zend_Http_Client();
|
216 |
$client->setUri(self::URL_PXPOST);
|
217 |
$client->setConfig(
|
@@ -225,8 +225,8 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpost extends Mage_Payment_Model_
|
|
225 |
if ($this->getPaymentAction() == MageBase_DpsPaymentExpress_Model_Method_Common::ACTION_COMPLETE ||
|
226 |
$this->getPaymentAction() == MageBase_DpsPaymentExpress_Model_Method_Common::ACTION_REFUND ) {
|
227 |
$xml = new SimpleXMLElement('<Txn></Txn>');
|
228 |
-
$xml->addChild('PostUsername', htmlentities($this->
|
229 |
-
$xml->addChild('PostPassword', htmlentities($this->
|
230 |
$xml->addChild('Amount', trim(sprintf("%9.2f", $this->getAmount())));
|
231 |
$xml->addChild('TxnType', $this->getPaymentAction());
|
232 |
$xml->addChild('MerchantReference', $this->_getOrderId());
|
@@ -251,8 +251,8 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpost extends Mage_Payment_Model_
|
|
251 |
//$xml->addChild('EnableAddBillCard', '');
|
252 |
$xml->addChild('InputCurrency', $this->_getCurrencyCode());
|
253 |
$xml->addChild('MerchantReference', $this->_getOrderId());
|
254 |
-
$xml->addChild('PostUsername', htmlentities($this->
|
255 |
-
$xml->addChild('PostPassword', htmlentities($this->
|
256 |
$xml->addChild('TxnType', $this->getPaymentAction());
|
257 |
//$xml->addChild('TxnData1', '');
|
258 |
//$xml->addChild('TxnData2', '');
|
@@ -271,8 +271,8 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpost extends Mage_Payment_Model_
|
|
271 |
//check if we have to send another Post to request the status of the transaction
|
272 |
if ((int)$responseXml->Transaction[0]->StatusRequired) {
|
273 |
$xml = new SimpleXMLElement('<Txn></Txn>');
|
274 |
-
$xml->addChild('PostUsername', htmlentities($this->
|
275 |
-
$xml->addChild('PostPassword', htmlentities($this->
|
276 |
$xml->addChild('TxnType', 'Status');
|
277 |
$xml->addChild('TxnId', $txnId);
|
278 |
$responseXml = $this->_requestResponse($client, $xml);
|
@@ -280,7 +280,12 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpost extends Mage_Payment_Model_
|
|
280 |
|
281 |
if ($this->_validateResponse($responseXml)) {
|
282 |
$this->unsError();
|
283 |
-
|
|
|
|
|
|
|
|
|
|
|
284 |
return true;
|
285 |
}
|
286 |
|
@@ -321,7 +326,7 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpost extends Mage_Payment_Model_
|
|
321 |
|
322 |
|
323 |
/**
|
324 |
-
* validate returned response
|
325 |
* checks: Success Response
|
326 |
* Authorized Response
|
327 |
* amount = base grand total
|
@@ -336,7 +341,7 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpost extends Mage_Payment_Model_
|
|
336 |
try {
|
337 |
if ((int)$resultXml->Transaction[0]->StatusRequired) {
|
338 |
Mage::log(
|
339 |
-
"Error in DPS Response Validation: No correct status even after retrying.",
|
340 |
null,
|
341 |
self::DPS_LOG_FILENAME
|
342 |
);
|
@@ -354,7 +359,7 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpost extends Mage_Payment_Model_
|
|
354 |
(".$resultXml->Transaction[0]['reco'].")", null, self::DPS_LOG_FILENAME
|
355 |
);
|
356 |
}
|
357 |
-
$this->setError(array('message' => $resultXml->HelpText));
|
358 |
return false;
|
359 |
}
|
360 |
$order = $this->_getOrder();
|
@@ -362,9 +367,12 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpost extends Mage_Payment_Model_
|
|
362 |
Mage::log("Error in DPS Response Validation: No Order", null, self::DPS_LOG_FILENAME);
|
363 |
return false;
|
364 |
}
|
365 |
-
if
|
366 |
-
|
367 |
-
|
|
|
|
|
|
|
368 |
}
|
369 |
if ((float)$resultXml->Transaction[0]->CurrencySettlement != $order->getBaseCurrencyCode()) {
|
370 |
Mage::log("Error in DPS Response Validation: Mismatched currencies", null, self::DPS_LOG_FILENAME);
|
@@ -423,6 +431,18 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpost extends Mage_Payment_Model_
|
|
423 |
|
424 |
}
|
425 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
426 |
/**
|
427 |
* Order increment ID getter (either real from order or a reserved from quote)
|
428 |
*
|
54 |
*
|
55 |
* @return string
|
56 |
*/
|
57 |
+
public function getPostUsername()
|
58 |
{
|
59 |
return Mage::helper('core')->decrypt(Mage::getStoreConfig('payment/'.$this->_code.'/postusername'));
|
60 |
}
|
64 |
*
|
65 |
* @return string
|
66 |
*/
|
67 |
+
public function getPostPassword()
|
68 |
{
|
69 |
return Mage::helper('core')->decrypt(Mage::getStoreConfig('payment/'.$this->_code.'/postpassword'));
|
70 |
}
|
86 |
break;
|
87 |
}
|
88 |
}
|
89 |
+
|
90 |
/**
|
91 |
* check if current currency code is allowed for this payment method
|
92 |
*
|
201 |
}
|
202 |
return $this;
|
203 |
}
|
204 |
+
|
205 |
/**
|
206 |
* create transaction object in xml and submit to server
|
207 |
*
|
211 |
{
|
212 |
|
213 |
$payment = $this->getPayment();
|
214 |
+
|
215 |
$client = new Zend_Http_Client();
|
216 |
$client->setUri(self::URL_PXPOST);
|
217 |
$client->setConfig(
|
225 |
if ($this->getPaymentAction() == MageBase_DpsPaymentExpress_Model_Method_Common::ACTION_COMPLETE ||
|
226 |
$this->getPaymentAction() == MageBase_DpsPaymentExpress_Model_Method_Common::ACTION_REFUND ) {
|
227 |
$xml = new SimpleXMLElement('<Txn></Txn>');
|
228 |
+
$xml->addChild('PostUsername', htmlentities($this->getPostUsername()));
|
229 |
+
$xml->addChild('PostPassword', htmlentities($this->getPostPassword()));
|
230 |
$xml->addChild('Amount', trim(sprintf("%9.2f", $this->getAmount())));
|
231 |
$xml->addChild('TxnType', $this->getPaymentAction());
|
232 |
$xml->addChild('MerchantReference', $this->_getOrderId());
|
251 |
//$xml->addChild('EnableAddBillCard', '');
|
252 |
$xml->addChild('InputCurrency', $this->_getCurrencyCode());
|
253 |
$xml->addChild('MerchantReference', $this->_getOrderId());
|
254 |
+
$xml->addChild('PostUsername', htmlentities($this->getPostUsername()));
|
255 |
+
$xml->addChild('PostPassword', htmlentities($this->getPostPassword()));
|
256 |
$xml->addChild('TxnType', $this->getPaymentAction());
|
257 |
//$xml->addChild('TxnData1', '');
|
258 |
//$xml->addChild('TxnData2', '');
|
271 |
//check if we have to send another Post to request the status of the transaction
|
272 |
if ((int)$responseXml->Transaction[0]->StatusRequired) {
|
273 |
$xml = new SimpleXMLElement('<Txn></Txn>');
|
274 |
+
$xml->addChild('PostUsername', htmlentities($this->getPostUsername()));
|
275 |
+
$xml->addChild('PostPassword', htmlentities($this->getPostPassword()));
|
276 |
$xml->addChild('TxnType', 'Status');
|
277 |
$xml->addChild('TxnId', $txnId);
|
278 |
$responseXml = $this->_requestResponse($client, $xml);
|
280 |
|
281 |
if ($this->_validateResponse($responseXml)) {
|
282 |
$this->unsError();
|
283 |
+
//update payment information with last transaction unless we are refunding or completing
|
284 |
+
if( !$this->getPaymentAction() == MageBase_DpsPaymentExpress_Model_Method_Common::ACTION_COMPLETE ||
|
285 |
+
!$this->getPaymentAction() == MageBase_DpsPaymentExpress_Model_Method_Common::ACTION_REFUND ){
|
286 |
+
$this->setAdditionalData($responseXml, $payment);
|
287 |
+
}
|
288 |
+
|
289 |
return true;
|
290 |
}
|
291 |
|
326 |
|
327 |
|
328 |
/**
|
329 |
+
* validate returned response
|
330 |
* checks: Success Response
|
331 |
* Authorized Response
|
332 |
* amount = base grand total
|
341 |
try {
|
342 |
if ((int)$resultXml->Transaction[0]->StatusRequired) {
|
343 |
Mage::log(
|
344 |
+
"Error in DPS Response Validation: No correct status even after retrying.",
|
345 |
null,
|
346 |
self::DPS_LOG_FILENAME
|
347 |
);
|
359 |
(".$resultXml->Transaction[0]['reco'].")", null, self::DPS_LOG_FILENAME
|
360 |
);
|
361 |
}
|
362 |
+
$this->setError(array('message' => $resultXml->HelpText));
|
363 |
return false;
|
364 |
}
|
365 |
$order = $this->_getOrder();
|
367 |
Mage::log("Error in DPS Response Validation: No Order", null, self::DPS_LOG_FILENAME);
|
368 |
return false;
|
369 |
}
|
370 |
+
if( !$this->getPaymentAction() == MageBase_DpsPaymentExpress_Model_Method_Common::ACTION_COMPLETE ||
|
371 |
+
!$this->getPaymentAction() == MageBase_DpsPaymentExpress_Model_Method_Common::ACTION_REFUND ){
|
372 |
+
if (abs((float)$resultXml->Transaction[0]->Amount - $order->getBaseGrandTotal()) >0.0005) {
|
373 |
+
Mage::log("Error in DPS Response Validation: Mismatched totals", null, self::DPS_LOG_FILENAME);
|
374 |
+
return false;
|
375 |
+
}
|
376 |
}
|
377 |
if ((float)$resultXml->Transaction[0]->CurrencySettlement != $order->getBaseCurrencyCode()) {
|
378 |
Mage::log("Error in DPS Response Validation: Mismatched currencies", null, self::DPS_LOG_FILENAME);
|
431 |
|
432 |
}
|
433 |
|
434 |
+
public function OtherCcType($type)
|
435 |
+
{
|
436 |
+
return $type=='OT' || $type == 'DIN';
|
437 |
+
}
|
438 |
+
|
439 |
+
public function getVerificationRegEx()
|
440 |
+
{
|
441 |
+
$verificationExpList = parent::getVerificationRegEx();
|
442 |
+
$verificationExpList['DIN'] = $verificationExpList ['OT'];
|
443 |
+
return $verificationExpList;
|
444 |
+
}
|
445 |
+
|
446 |
/**
|
447 |
* Order increment ID getter (either real from order or a reserved from quote)
|
448 |
*
|
app/code/community/MageBase/DpsPaymentExpress/controllers/PxpayController.php
CHANGED
@@ -25,6 +25,16 @@ class MageBase_DpsPaymentExpress_PxpayController extends Mage_Core_Controller_Fr
|
|
25 |
|
26 |
public function successAction()
|
27 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
if ($this->_validateUserId($this->getRequest()->getParam('userid'))) {
|
29 |
|
30 |
/* successAction is called twice
|
@@ -132,7 +142,8 @@ class MageBase_DpsPaymentExpress_PxpayController extends Mage_Core_Controller_Fr
|
|
132 |
}
|
133 |
$resultXml = $this->_processFailResponse($this->getRequest()->getParam('result'));
|
134 |
//reactivate quote
|
135 |
-
|
|
|
136 |
&& (int)$resultXml->TxnData2
|
137 |
&& (string)$resultXml->MerchantReference
|
138 |
&& $session->getLastRealOrderId() == (string)$resultXml->MerchantReference) {
|
@@ -144,22 +155,22 @@ class MageBase_DpsPaymentExpress_PxpayController extends Mage_Core_Controller_Fr
|
|
144 |
}
|
145 |
}
|
146 |
|
147 |
-
|
148 |
{
|
149 |
return Mage::getSingleton('magebasedps/method_pxpay')->getRealResponse($result);
|
150 |
}
|
151 |
|
152 |
-
|
153 |
{
|
154 |
return Mage::getSingleton('magebasedps/method_pxpay')->processSuccessResponse($result);
|
155 |
}
|
156 |
|
157 |
-
|
158 |
{
|
159 |
return Mage::getSingleton('magebasedps/method_pxpay')->processFailResponse($result);
|
160 |
}
|
161 |
|
162 |
-
|
163 |
{
|
164 |
return Mage::getSingleton('magebasedps/method_pxpay')->validateUserId($userId);
|
165 |
}
|
25 |
|
26 |
public function successAction()
|
27 |
{
|
28 |
+
Mage::log(
|
29 |
+
'MageBaseDps successAction userid '.$this->getRequest()->getParam('userid'),
|
30 |
+
null,
|
31 |
+
MageBase_DpsPaymentExpress_Model_Method_Pxpay::DPS_LOG_FILENAME
|
32 |
+
);
|
33 |
+
Mage::log(
|
34 |
+
'MageBaseDps successAction result '.$this->getRequest()->getParam('result'),
|
35 |
+
null,
|
36 |
+
MageBase_DpsPaymentExpress_Model_Method_Pxpay::DPS_LOG_FILENAME
|
37 |
+
);
|
38 |
if ($this->_validateUserId($this->getRequest()->getParam('userid'))) {
|
39 |
|
40 |
/* successAction is called twice
|
142 |
}
|
143 |
$resultXml = $this->_processFailResponse($this->getRequest()->getParam('result'));
|
144 |
//reactivate quote
|
145 |
+
$session = Mage::getSingleton('checkout/session');
|
146 |
+
if ( $session
|
147 |
&& (int)$resultXml->TxnData2
|
148 |
&& (string)$resultXml->MerchantReference
|
149 |
&& $session->getLastRealOrderId() == (string)$resultXml->MerchantReference) {
|
155 |
}
|
156 |
}
|
157 |
|
158 |
+
protected function _getRealResponse($result)
|
159 |
{
|
160 |
return Mage::getSingleton('magebasedps/method_pxpay')->getRealResponse($result);
|
161 |
}
|
162 |
|
163 |
+
protected function _processSuccessResponse($result)
|
164 |
{
|
165 |
return Mage::getSingleton('magebasedps/method_pxpay')->processSuccessResponse($result);
|
166 |
}
|
167 |
|
168 |
+
protected function _processFailResponse($result)
|
169 |
{
|
170 |
return Mage::getSingleton('magebasedps/method_pxpay')->processFailResponse($result);
|
171 |
}
|
172 |
|
173 |
+
protected function _validateUserId($userId)
|
174 |
{
|
175 |
return Mage::getSingleton('magebasedps/method_pxpay')->validateUserId($userId);
|
176 |
}
|
app/code/community/MageBase/DpsPaymentExpress/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<MageBase_DpsPaymentExpress>
|
5 |
-
<version>1.1.
|
6 |
</MageBase_DpsPaymentExpress>
|
7 |
</modules>
|
8 |
<global>
|
@@ -71,6 +71,17 @@
|
|
71 |
</states>
|
72 |
</order>
|
73 |
</sales>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
</global>
|
75 |
<frontend>
|
76 |
<routers>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<MageBase_DpsPaymentExpress>
|
5 |
+
<version>1.1.17</version>
|
6 |
</MageBase_DpsPaymentExpress>
|
7 |
</modules>
|
8 |
<global>
|
71 |
</states>
|
72 |
</order>
|
73 |
</sales>
|
74 |
+
<payment>
|
75 |
+
<cc>
|
76 |
+
<types>
|
77 |
+
<AE>
|
78 |
+
<code>DIN</code>
|
79 |
+
<name>Diners</name>
|
80 |
+
<order>80</order>
|
81 |
+
</AE>
|
82 |
+
</types>
|
83 |
+
</cc>
|
84 |
+
</payment>
|
85 |
</global>
|
86 |
<frontend>
|
87 |
<routers>
|
app/design/frontend/base/default/template/magebase/dps/pxpost/form.phtml
CHANGED
@@ -24,6 +24,7 @@
|
|
24 |
|
25 |
<?php $_code=$this->getMethodCode() ?>
|
26 |
<?php $_logos = $this->getLogosToDisplay();?>
|
|
|
27 |
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
|
28 |
<li>
|
29 |
<label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
|
@@ -34,7 +35,7 @@
|
|
34 |
<li>
|
35 |
<label for="<?php echo $_code ?>_cc_type" class="required"><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
|
36 |
<div class="input-box">
|
37 |
-
<select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" class="required-entry validate-cc-type-select">
|
38 |
<option value=""><?php echo $this->__('--Please Select--')?></option>
|
39 |
<?php $_ccType = $this->getInfoData('cc_type') ?>
|
40 |
<?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
|
@@ -80,6 +81,28 @@
|
|
80 |
</div>
|
81 |
<a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
|
82 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
</li>
|
84 |
<?php endif; ?>
|
85 |
|
@@ -115,71 +138,23 @@
|
|
115 |
</li>
|
116 |
<li class="adv-container"> </li>
|
117 |
</ul>
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
$('<?php echo $_code ?>_cc_type_cvv_div').show();
|
129 |
-
$('<?php echo $_code ?>_cc_type_exp_div').show();
|
130 |
-
}
|
131 |
-
};
|
132 |
-
|
133 |
-
Event.observe($('<?php echo $_code ?>_cc_type'), 'change', SSChecked<?php echo $_code ?>);
|
134 |
-
SSChecked<?php echo $_code ?>();
|
135 |
-
|
136 |
-
Validation.addAllThese([
|
137 |
-
['validate-cc-ukss', 'Please enter issue number or start date for switch/solo card type.', function(v,elm) {
|
138 |
-
var endposition;
|
139 |
-
|
140 |
-
if (elm.id.match(/(.)+_cc_issue$/)) {
|
141 |
-
endposition = elm.id.indexOf('_cc_issue');
|
142 |
-
} else if (elm.id.match(/(.)+_start_month$/)) {
|
143 |
-
endposition = elm.id.indexOf('_start_month');
|
144 |
-
} else {
|
145 |
-
endposition = elm.id.indexOf('_start_year');
|
146 |
-
}
|
147 |
-
|
148 |
-
var prefix = elm.id.substr(0,endposition);
|
149 |
-
|
150 |
-
var ccTypeContainer = $(prefix + '_cc_type');
|
151 |
-
|
152 |
-
if (!ccTypeContainer) {
|
153 |
-
return true;
|
154 |
-
}
|
155 |
-
var ccType = ccTypeContainer.value;
|
156 |
-
|
157 |
-
if(ccType!='SS'){
|
158 |
-
return true;
|
159 |
-
}
|
160 |
-
|
161 |
-
$(prefix + '_cc_issue').advaiceContainer
|
162 |
-
= $(prefix + '_start_month').advaiceContainer
|
163 |
-
= $(prefix + '_start_year').advaiceContainer
|
164 |
-
= $(prefix + '_cc_type_ss_div').down('ul li.adv-container');
|
165 |
-
|
166 |
-
var ccIssue = $(prefix + '_cc_issue').value;
|
167 |
-
var ccSMonth = $(prefix + '_start_month').value;
|
168 |
-
var ccSYear = $(prefix + '_start_year').value;
|
169 |
|
170 |
-
|
171 |
-
|
172 |
-
(!ccIssue && ccSMonth && !ccSYear)
|
173 |
-
){
|
174 |
-
return false;
|
175 |
-
}
|
176 |
|
177 |
-
|
178 |
|
179 |
-
|
180 |
-
]);
|
181 |
-
//]]>
|
182 |
-
</script>
|
183 |
</li>
|
184 |
<?php endif; ?>
|
185 |
<?php if (count($_logos) > 0): ?>
|
24 |
|
25 |
<?php $_code=$this->getMethodCode() ?>
|
26 |
<?php $_logos = $this->getLogosToDisplay();?>
|
27 |
+
<?php $_turnOffTypeValidation = in_array('DIN', $this->getCcAvailableTypes()); ?>
|
28 |
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
|
29 |
<li>
|
30 |
<label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
|
35 |
<li>
|
36 |
<label for="<?php echo $_code ?>_cc_type" class="required"><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
|
37 |
<div class="input-box">
|
38 |
+
<select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" class="required-entry <?php $_turnOffTypeValidation? '': 'validate-cc-type-select'?>">
|
39 |
<option value=""><?php echo $this->__('--Please Select--')?></option>
|
40 |
<?php $_ccType = $this->getInfoData('cc_type') ?>
|
41 |
<?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
|
81 |
</div>
|
82 |
<a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
|
83 |
</div>
|
84 |
+
<script type="text/javascript">
|
85 |
+
//<![CDATA[
|
86 |
+
var DINChecked<?php echo $_code ?> = function() {
|
87 |
+
var elm = $('<?php echo $_code ?>_cc_type');
|
88 |
+
if(elm){
|
89 |
+
if (elm.value=='DIN') {
|
90 |
+
$('<?php echo $_code ?>_cc_type').removeClassName('validate-cc-type-select');
|
91 |
+
$('<?php echo $_code ?>_cc_number').removeClassName('validate-cc-type');
|
92 |
+
$('<?php echo $_code ?>_cc_cid').removeClassName('validate-cc-cvn');
|
93 |
+
} else {
|
94 |
+
$('<?php echo $_code ?>_cc_type').addClassName('validate-cc-type-select');
|
95 |
+
$('<?php echo $_code ?>_cc_number').addClassName('validate-cc-type');
|
96 |
+
$('<?php echo $_code ?>_cc_cid').addClassName('validate-cc-cvn');
|
97 |
+
}
|
98 |
+
}
|
99 |
+
};
|
100 |
+
Event.observe($('<?php echo $_code ?>_cc_type'), 'change', DINChecked<?php echo $_code ?>);
|
101 |
+
DINChecked<?php echo $_code ?>();
|
102 |
+
|
103 |
+
//]]>
|
104 |
+
|
105 |
+
</script>
|
106 |
</li>
|
107 |
<?php endif; ?>
|
108 |
|
138 |
</li>
|
139 |
<li class="adv-container"> </li>
|
140 |
</ul>
|
141 |
+
<script type="text/javascript">
|
142 |
+
//<![CDATA[
|
143 |
+
var SSChecked<?php echo $_code ?> = function() {
|
144 |
+
var elm = $('<?php echo $_code ?>_cc_type');
|
145 |
+
if (['SS','SM','SO'].indexOf(elm.value) != -1) {
|
146 |
+
$('<?php echo $_code ?>_cc_type_ss_div').show();
|
147 |
+
} else {
|
148 |
+
$('<?php echo $_code ?>_cc_type_ss_div').hide();
|
149 |
+
}
|
150 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
|
152 |
+
Event.observe($('<?php echo $_code ?>_cc_type'), 'change', SSChecked<?php echo $_code ?>);
|
153 |
+
SSChecked<?php echo $_code ?>();
|
|
|
|
|
|
|
|
|
154 |
|
155 |
+
//]]>
|
156 |
|
157 |
+
</script>
|
|
|
|
|
|
|
158 |
</li>
|
159 |
<?php endif; ?>
|
160 |
<?php if (count($_logos) > 0): ?>
|
package.xml
CHANGED
@@ -1,20 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>MageBase_DpsPaymentExpress</name>
|
4 |
-
<version>1.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Accept credit card payments via Payment Express from DPS - this extension supports PxPay and PxPost.</summary>
|
10 |
<description>Accept credit card payments via Payment Express from DPS - this extension supports PxPay and PxPost.</description>
|
11 |
-
<notes>
|
12 |
-
|
13 |
-
update dps branding</notes>
|
14 |
<authors><author><name>Kristof Ringleff</name><user>auto-converted</user><email>info@magebase.com</email></author></authors>
|
15 |
-
<date>
|
16 |
-
<time>
|
17 |
-
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="magebase"><dir name="dps"><dir name="pxpay"><dir name="pdf"><file name="pxpay.phtml" hash="30691a7b7eddbf52217c2d8194fe3f52"/></dir><file name="form.phtml" hash="1b6d58c3bde68990b743c93a9be529aa"/><file name="info.phtml" hash="8a032b2e8b31234a30121289c64ad175"/></dir><dir name="pxpost"><dir name="pdf"><file name="pxpost.phtml" hash="81e5f3b568e748460a5ca61e42138f8e"/></dir><file name="form.phtml" hash="27bec2c3b982473d7c0c1a44762adac4"/><file name="info.phtml" hash="deaa639a34e9b35cbc41c4a793d4dede"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="magebase"><dir name="dps"><dir name="pxpay"><file name="form.phtml" hash="d1ec1d94031a875ba2819c5f799899c7"/><file name="info.phtml" hash="c53fb2bf0a1afdc81fac85afc15b35e3"/></dir><dir name="pxpost"><file name="form.phtml" hash="
|
18 |
<compatible/>
|
19 |
<dependencies/>
|
20 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>MageBase_DpsPaymentExpress</name>
|
4 |
+
<version>1.1.17</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>
|
8 |
<extends/>
|
9 |
<summary>Accept credit card payments via Payment Express from DPS - this extension supports PxPay and PxPost.</summary>
|
10 |
<description>Accept credit card payments via Payment Express from DPS - this extension supports PxPay and PxPost.</description>
|
11 |
+
<notes>add diners for pxpost
|
12 |
+
fix for cancelled payment</notes>
|
|
|
13 |
<authors><author><name>Kristof Ringleff</name><user>auto-converted</user><email>info@magebase.com</email></author></authors>
|
14 |
+
<date>2011-04-05</date>
|
15 |
+
<time>03:31:39</time>
|
16 |
+
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="magebase"><dir name="dps"><dir name="pxpay"><dir name="pdf"><file name="pxpay.phtml" hash="30691a7b7eddbf52217c2d8194fe3f52"/></dir><file name="form.phtml" hash="1b6d58c3bde68990b743c93a9be529aa"/><file name="info.phtml" hash="8a032b2e8b31234a30121289c64ad175"/></dir><dir name="pxpost"><dir name="pdf"><file name="pxpost.phtml" hash="81e5f3b568e748460a5ca61e42138f8e"/></dir><file name="form.phtml" hash="27bec2c3b982473d7c0c1a44762adac4"/><file name="info.phtml" hash="deaa639a34e9b35cbc41c4a793d4dede"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="magebase"><dir name="dps"><dir name="pxpay"><file name="form.phtml" hash="d1ec1d94031a875ba2819c5f799899c7"/><file name="info.phtml" hash="c53fb2bf0a1afdc81fac85afc15b35e3"/></dir><dir name="pxpost"><file name="form.phtml" hash="ef16ac590db5691a18e7581dbaac7849"/><file name="info.phtml" hash="d2fd0f5603342e235ae8cd6ce1346ce2"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="MageBase_DpsPaymentExpress.xml" hash="fae6ba260c006016d14d9a508d17cf14"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="magebase"><dir name="dps"><file name="AmexLogo.png" hash="775a3f26a4b5f7a6201b1331e4fe5579"/><file name="DinersLogo.png" hash="64500fdde86e960ac894f7cf0c44b2d8"/><file name="dpslogo.png" hash="a79b9df3fe45acb4b714cabed162ebda"/><file name="dpspxlogo.png" hash="31b1338586485c872a0f39a41813b248"/><file name="JCBLogo.png" hash="73f9e8b87c6c2dbf252bbb0de43591bc"/><file name="MasterCardLogo.png" hash="801014f81e405cec951076f4080b04f5"/><file name="MCSecureCodeLogo.png" hash="9f31e5ccadd98dc15d0110d0e3b450f7"/><file name="VisaLogo.png" hash="17173fb8723d34cea61a50c01c4845ed"/><file name="VisaVerifiedLogo.png" hash="af7f6a27a6449a50d1d623d925585c47"/></dir></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="MageBase"><dir name="DpsPaymentExpress"><dir name="Block"><dir name="Pxpay"><file name="Form.php" hash="0513bd45150f03dab2c2b08dc0456de8"/><file name="Info.php" hash="68328c0824a4666c618cf3742dd4baff"/></dir><dir name="Pxpost"><file name="Form.php" hash="48cda517e5c97bf8b031d195b79d76f9"/><file name="Info.php" hash="498c831213c26a78c12e28203273e937"/></dir></dir><dir name="controllers"><file name="PxpayController.php" hash="70ce3b82f4f50c3724ce8915251e695c"/></dir><dir name="etc"><file name="config.xml" hash="988fdac32b43862c27c90ab44cb87f39"/><file name="system.xml" hash="87051f2d48e3720938b28142e7f37bb1"/></dir><dir name="Helper"><file name="Data.php" hash="0eea8b0b6d3c48e7e64666d4576d9a30"/></dir><dir name="Model"><dir name="Method"><file name="Common.php" hash="1261a0121dff3725f85d9a7c955ada7c"/><file name="Pxpay.php" hash="4b06d1ac374cef4780ff53550ca16bfb"/><file name="Pxpost.php" hash="318c797bedf13c56c00279ebc642b22c"/></dir><dir name="Mysql4"><dir name="Debug"><file name="Collection.php" hash="6ef2919222f3dcb32599349245e76214"/></dir><file name="Debug.php" hash="56eb2bc341b9cb4ba8d9ae239169766e"/><file name="Setup.php" hash="8a395090a44fda7530548abd2d87835e"/></dir><dir name="System"><file name="Logos.php" hash="bfca463fa7d292fbd2b69a33d332d55a"/><file name="PaymentAction.php" hash="0be4f9a5c602b2d2723203ec56f51a8c"/><file name="PendingOrder.php" hash="31d7bd6f5fad8e1fa4315d32d123be0f"/></dir><file name="Debug.php" hash="dadf96f68c9cf4d09aad73ff0bacab0e"/></dir><dir name="sql"><dir name="magebasedps_setup"><file name="mysql4-install-0.5.0.php" hash="c512ded8c0dd63b1dcd8e8cbfb5893e8"/><file name="mysql4-upgrade-0.5.0-1.0.0.php" hash="6dbc67541449a0f2d43460acb9b6bbff"/></dir></dir></dir></dir></target></contents>
|
17 |
<compatible/>
|
18 |
<dependencies/>
|
19 |
</package>
|