Version Notes
Added ability to always save cards.
Download this release
Release Info
| Developer | Brian McGowan |
| Extension | Cardpay_Payeezy |
| Version | 1.0.7 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.6 to 1.0.7
- app/code/community/Cardpay/Payeezy/Block/Form.php +1 -1
- app/code/community/Cardpay/Payeezy/Model/Paymentmethod.php +2 -2
- app/code/community/Cardpay/Payeezy/Model/Source/Ccstore.php +48 -0
- app/code/community/Cardpay/Payeezy/etc/config.xml +2 -2
- app/code/community/Cardpay/Payeezy/etc/system.xml +14 -14
- app/design/frontend/base/default/template/payeezy/form.phtml +0 -1
- package.xml +5 -5
app/code/community/Cardpay/Payeezy/Block/Form.php
CHANGED
|
@@ -39,7 +39,7 @@ class Cardpay_Payeezy_Block_Form extends Mage_Payment_Block_Form_Cc
|
|
| 39 |
*
|
| 40 |
* @return bool if can save
|
| 41 |
*/
|
| 42 |
-
|
| 43 |
{
|
| 44 |
$methodRegister = Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER;
|
| 45 |
if (Mage::getModel('payeezy/paymentmethod')->getConfigData('use_vault')
|
| 39 |
*
|
| 40 |
* @return bool if can save
|
| 41 |
*/
|
| 42 |
+
public function canSaveCard()
|
| 43 |
{
|
| 44 |
$methodRegister = Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER;
|
| 45 |
if (Mage::getModel('payeezy/paymentmethod')->getConfigData('use_vault')
|
app/code/community/Cardpay/Payeezy/Model/Paymentmethod.php
CHANGED
|
@@ -80,7 +80,7 @@ class Cardpay_Payeezy_Model_PaymentMethod extends Mage_Payment_Model_Method_Cc
|
|
| 80 |
->setParentTransactionId(null)
|
| 81 |
->setCcAvsStatus(Mage::helper('payeezy')->getAvsResponse($response->avs))
|
| 82 |
->setCcCidStatus(Mage::helper('payeezy')->getCvvResponse($response->cvv2));
|
| 83 |
-
if (isset($post['payment']['save_card'])) {
|
| 84 |
$this->saveCard($payment, $response->token->token_data->value);
|
| 85 |
}
|
| 86 |
return $this;
|
|
@@ -154,7 +154,7 @@ class Cardpay_Payeezy_Model_PaymentMethod extends Mage_Payment_Model_Method_Cc
|
|
| 154 |
->setParentTransactionId(null)
|
| 155 |
->setCcAvsStatus(Mage::helper('payeezy')->getAvsResponse($response->avs))
|
| 156 |
->setCcCidStatus(Mage::helper('payeezy')->getCvvResponse($response->cvv2));
|
| 157 |
-
if (isset($post['payment']['save_card'])) {
|
| 158 |
$this->saveCard($payment, $response->token->token_data->value);
|
| 159 |
}
|
| 160 |
return $this;
|
| 80 |
->setParentTransactionId(null)
|
| 81 |
->setCcAvsStatus(Mage::helper('payeezy')->getAvsResponse($response->avs))
|
| 82 |
->setCcCidStatus(Mage::helper('payeezy')->getCvvResponse($response->cvv2));
|
| 83 |
+
if (isset($post['payment']['save_card']) || ($this->getConfigData('use_vault') == 2 && empty($post['payment']['token']))) {
|
| 84 |
$this->saveCard($payment, $response->token->token_data->value);
|
| 85 |
}
|
| 86 |
return $this;
|
| 154 |
->setParentTransactionId(null)
|
| 155 |
->setCcAvsStatus(Mage::helper('payeezy')->getAvsResponse($response->avs))
|
| 156 |
->setCcCidStatus(Mage::helper('payeezy')->getCvvResponse($response->cvv2));
|
| 157 |
+
if (isset($post['payment']['save_card']) || ($this->getConfigData('use_vault') == 2 && empty($post['payment']['token']))) {
|
| 158 |
$this->saveCard($payment, $response->token->token_data->value);
|
| 159 |
}
|
| 160 |
return $this;
|
app/code/community/Cardpay/Payeezy/Model/Source/Ccstore.php
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Cardpay Solutions, Inc.
|
| 4 |
+
*
|
| 5 |
+
* NOTICE OF LICENSE
|
| 6 |
+
*
|
| 7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
+
* that is available through the world-wide-web at this URL:
|
| 9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 10 |
+
*
|
| 11 |
+
* PHP version 5
|
| 12 |
+
*
|
| 13 |
+
* @category Cardpay
|
| 14 |
+
* @package Cardpay_Payeezy
|
| 15 |
+
* @copyright Copyright (c) 2015 Cardpay Solutions, Inc. (http://www.cardpaysolutions.com)
|
| 16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 17 |
+
*/
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
* First Data Payeezy credit card store source model.
|
| 21 |
+
*
|
| 22 |
+
* @category Cardpay
|
| 23 |
+
* @package Cardpay_Payeezy
|
| 24 |
+
* @author Cardpay Solutions, Inc. <sales@cardpaysolutions.com>
|
| 25 |
+
*/
|
| 26 |
+
class Cardpay_Payeezy_Model_Source_Ccstore
|
| 27 |
+
{
|
| 28 |
+
/**
|
| 29 |
+
* Allowed credit cards to be stored
|
| 30 |
+
*/
|
| 31 |
+
public function toOptionArray()
|
| 32 |
+
{
|
| 33 |
+
return array(
|
| 34 |
+
array(
|
| 35 |
+
'value' => false,
|
| 36 |
+
'label' => 'Disabled'
|
| 37 |
+
),
|
| 38 |
+
array(
|
| 39 |
+
'value' => 1,
|
| 40 |
+
'label' => 'Ask the customer'
|
| 41 |
+
),
|
| 42 |
+
array(
|
| 43 |
+
'value' => 2,
|
| 44 |
+
'label' => 'Save without asking'
|
| 45 |
+
),
|
| 46 |
+
);
|
| 47 |
+
}
|
| 48 |
+
}
|
app/code/community/Cardpay/Payeezy/etc/config.xml
CHANGED
|
@@ -20,7 +20,7 @@
|
|
| 20 |
<congig>
|
| 21 |
<modules>
|
| 22 |
<Cardpay_Payeezy>
|
| 23 |
-
<version>1.0.
|
| 24 |
</Cardpay_Payeezy>
|
| 25 |
</modules>
|
| 26 |
<global>
|
|
@@ -81,7 +81,7 @@
|
|
| 81 |
<allowspecific>0</allowspecific>
|
| 82 |
<currency>USD</currency>
|
| 83 |
<useccv>1</useccv>
|
| 84 |
-
<use_vault>
|
| 85 |
</payeezy>
|
| 86 |
</payment>
|
| 87 |
</default>
|
| 20 |
<congig>
|
| 21 |
<modules>
|
| 22 |
<Cardpay_Payeezy>
|
| 23 |
+
<version>1.0.7</version>
|
| 24 |
</Cardpay_Payeezy>
|
| 25 |
</modules>
|
| 26 |
<global>
|
| 81 |
<allowspecific>0</allowspecific>
|
| 82 |
<currency>USD</currency>
|
| 83 |
<useccv>1</useccv>
|
| 84 |
+
<use_vault>0</use_vault>
|
| 85 |
</payeezy>
|
| 86 |
</payment>
|
| 87 |
</default>
|
app/code/community/Cardpay/Payeezy/etc/system.xml
CHANGED
|
@@ -36,7 +36,7 @@
|
|
| 36 |
<sort_order>1</sort_order>
|
| 37 |
<show_in_default>1</show_in_default>
|
| 38 |
<show_in_website>1</show_in_website>
|
| 39 |
-
<show_in_store>
|
| 40 |
</active>
|
| 41 |
<title translate="label">
|
| 42 |
<label>Title</label>
|
|
@@ -54,7 +54,7 @@
|
|
| 54 |
<sort_order>3</sort_order>
|
| 55 |
<show_in_default>1</show_in_default>
|
| 56 |
<show_in_website>1</show_in_website>
|
| 57 |
-
<show_in_store>
|
| 58 |
</test_mode>
|
| 59 |
<merchant_token translate="label">
|
| 60 |
<label>Merchant Token</label>
|
|
@@ -63,7 +63,7 @@
|
|
| 63 |
<sort_order>4</sort_order>
|
| 64 |
<show_in_default>1</show_in_default>
|
| 65 |
<show_in_website>1</show_in_website>
|
| 66 |
-
<show_in_store>
|
| 67 |
</merchant_token>
|
| 68 |
<order_status translate="label">
|
| 69 |
<label>New order status</label>
|
|
@@ -73,7 +73,7 @@
|
|
| 73 |
<sort_order>5</sort_order>
|
| 74 |
<show_in_default>1</show_in_default>
|
| 75 |
<show_in_website>1</show_in_website>
|
| 76 |
-
<show_in_store>
|
| 77 |
</order_status>
|
| 78 |
<payment_action translate="label">
|
| 79 |
<label>Payment Action</label>
|
|
@@ -82,7 +82,7 @@
|
|
| 82 |
<sort_order>6</sort_order>
|
| 83 |
<show_in_default>1</show_in_default>
|
| 84 |
<show_in_website>1</show_in_website>
|
| 85 |
-
<show_in_store>
|
| 86 |
</payment_action>
|
| 87 |
<currency translate="label">
|
| 88 |
<label>Accepted Currency</label>
|
|
@@ -92,7 +92,7 @@
|
|
| 92 |
<sort_order>7</sort_order>
|
| 93 |
<show_in_default>1</show_in_default>
|
| 94 |
<show_in_website>1</show_in_website>
|
| 95 |
-
<show_in_store>
|
| 96 |
</currency>
|
| 97 |
<cctypes translate="label">
|
| 98 |
<label>Credit Card Types</label>
|
|
@@ -102,7 +102,7 @@
|
|
| 102 |
<sort_order>8</sort_order>
|
| 103 |
<show_in_default>1</show_in_default>
|
| 104 |
<show_in_website>1</show_in_website>
|
| 105 |
-
<show_in_store>
|
| 106 |
</cctypes>
|
| 107 |
<useccv translate="label">
|
| 108 |
<label>Credit Card Verification</label>
|
|
@@ -112,17 +112,17 @@
|
|
| 112 |
<sort_order>9</sort_order>
|
| 113 |
<show_in_default>1</show_in_default>
|
| 114 |
<show_in_website>1</show_in_website>
|
| 115 |
-
<show_in_store>
|
| 116 |
</useccv>
|
| 117 |
<use_vault translate="label">
|
| 118 |
<label>Allow Stored Cards</label>
|
| 119 |
<comment><![CDATA[Allow a logged in customer to save credit cards for future use. PCI Compliant TransArmor Tokenization.]]></comment>
|
| 120 |
<frontend_type>select</frontend_type>
|
| 121 |
-
<source_model>
|
| 122 |
<sort_order>10</sort_order>
|
| 123 |
<show_in_default>1</show_in_default>
|
| 124 |
<show_in_website>1</show_in_website>
|
| 125 |
-
<show_in_store>
|
| 126 |
</use_vault>
|
| 127 |
<ta_token translate="label">
|
| 128 |
<label>TransArmor Token</label>
|
|
@@ -131,7 +131,7 @@
|
|
| 131 |
<sort_order>11</sort_order>
|
| 132 |
<show_in_default>1</show_in_default>
|
| 133 |
<show_in_website>1</show_in_website>
|
| 134 |
-
<show_in_store>
|
| 135 |
</ta_token>
|
| 136 |
<allowspecific translate="label">
|
| 137 |
<label><![CDATA[Payment from applicable countries:]]></label>
|
|
@@ -141,7 +141,7 @@
|
|
| 141 |
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
| 142 |
<show_in_default>1</show_in_default>
|
| 143 |
<show_in_website>1</show_in_website>
|
| 144 |
-
<show_in_store>
|
| 145 |
</allowspecific>
|
| 146 |
<specificcountry translate="label">
|
| 147 |
<label><![CDATA[Payment from Specific countries:]]></label>
|
|
@@ -151,7 +151,7 @@
|
|
| 151 |
<source_model>adminhtml/system_config_source_country</source_model>
|
| 152 |
<show_in_default>1</show_in_default>
|
| 153 |
<show_in_website>1</show_in_website>
|
| 154 |
-
<show_in_store>
|
| 155 |
</specificcountry>
|
| 156 |
<sort_order translate="label">
|
| 157 |
<label>Sort Order</label>
|
|
@@ -160,7 +160,7 @@
|
|
| 160 |
<sort_order>14</sort_order>
|
| 161 |
<show_in_default>1</show_in_default>
|
| 162 |
<show_in_website>1</show_in_website>
|
| 163 |
-
<show_in_store>
|
| 164 |
<frontend_class>validate-number</frontend_class>
|
| 165 |
</sort_order>
|
| 166 |
</fields>
|
| 36 |
<sort_order>1</sort_order>
|
| 37 |
<show_in_default>1</show_in_default>
|
| 38 |
<show_in_website>1</show_in_website>
|
| 39 |
+
<show_in_store>1</show_in_store>
|
| 40 |
</active>
|
| 41 |
<title translate="label">
|
| 42 |
<label>Title</label>
|
| 54 |
<sort_order>3</sort_order>
|
| 55 |
<show_in_default>1</show_in_default>
|
| 56 |
<show_in_website>1</show_in_website>
|
| 57 |
+
<show_in_store>1</show_in_store>
|
| 58 |
</test_mode>
|
| 59 |
<merchant_token translate="label">
|
| 60 |
<label>Merchant Token</label>
|
| 63 |
<sort_order>4</sort_order>
|
| 64 |
<show_in_default>1</show_in_default>
|
| 65 |
<show_in_website>1</show_in_website>
|
| 66 |
+
<show_in_store>1</show_in_store>
|
| 67 |
</merchant_token>
|
| 68 |
<order_status translate="label">
|
| 69 |
<label>New order status</label>
|
| 73 |
<sort_order>5</sort_order>
|
| 74 |
<show_in_default>1</show_in_default>
|
| 75 |
<show_in_website>1</show_in_website>
|
| 76 |
+
<show_in_store>1</show_in_store>
|
| 77 |
</order_status>
|
| 78 |
<payment_action translate="label">
|
| 79 |
<label>Payment Action</label>
|
| 82 |
<sort_order>6</sort_order>
|
| 83 |
<show_in_default>1</show_in_default>
|
| 84 |
<show_in_website>1</show_in_website>
|
| 85 |
+
<show_in_store>1</show_in_store>
|
| 86 |
</payment_action>
|
| 87 |
<currency translate="label">
|
| 88 |
<label>Accepted Currency</label>
|
| 92 |
<sort_order>7</sort_order>
|
| 93 |
<show_in_default>1</show_in_default>
|
| 94 |
<show_in_website>1</show_in_website>
|
| 95 |
+
<show_in_store>1</show_in_store>
|
| 96 |
</currency>
|
| 97 |
<cctypes translate="label">
|
| 98 |
<label>Credit Card Types</label>
|
| 102 |
<sort_order>8</sort_order>
|
| 103 |
<show_in_default>1</show_in_default>
|
| 104 |
<show_in_website>1</show_in_website>
|
| 105 |
+
<show_in_store>1</show_in_store>
|
| 106 |
</cctypes>
|
| 107 |
<useccv translate="label">
|
| 108 |
<label>Credit Card Verification</label>
|
| 112 |
<sort_order>9</sort_order>
|
| 113 |
<show_in_default>1</show_in_default>
|
| 114 |
<show_in_website>1</show_in_website>
|
| 115 |
+
<show_in_store>1</show_in_store>
|
| 116 |
</useccv>
|
| 117 |
<use_vault translate="label">
|
| 118 |
<label>Allow Stored Cards</label>
|
| 119 |
<comment><![CDATA[Allow a logged in customer to save credit cards for future use. PCI Compliant TransArmor Tokenization.]]></comment>
|
| 120 |
<frontend_type>select</frontend_type>
|
| 121 |
+
<source_model>payeezy/source_ccstore</source_model>
|
| 122 |
<sort_order>10</sort_order>
|
| 123 |
<show_in_default>1</show_in_default>
|
| 124 |
<show_in_website>1</show_in_website>
|
| 125 |
+
<show_in_store>1</show_in_store>
|
| 126 |
</use_vault>
|
| 127 |
<ta_token translate="label">
|
| 128 |
<label>TransArmor Token</label>
|
| 131 |
<sort_order>11</sort_order>
|
| 132 |
<show_in_default>1</show_in_default>
|
| 133 |
<show_in_website>1</show_in_website>
|
| 134 |
+
<show_in_store>1</show_in_store>
|
| 135 |
</ta_token>
|
| 136 |
<allowspecific translate="label">
|
| 137 |
<label><![CDATA[Payment from applicable countries:]]></label>
|
| 141 |
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
| 142 |
<show_in_default>1</show_in_default>
|
| 143 |
<show_in_website>1</show_in_website>
|
| 144 |
+
<show_in_store>1</show_in_store>
|
| 145 |
</allowspecific>
|
| 146 |
<specificcountry translate="label">
|
| 147 |
<label><![CDATA[Payment from Specific countries:]]></label>
|
| 151 |
<source_model>adminhtml/system_config_source_country</source_model>
|
| 152 |
<show_in_default>1</show_in_default>
|
| 153 |
<show_in_website>1</show_in_website>
|
| 154 |
+
<show_in_store>1</show_in_store>
|
| 155 |
</specificcountry>
|
| 156 |
<sort_order translate="label">
|
| 157 |
<label>Sort Order</label>
|
| 160 |
<sort_order>14</sort_order>
|
| 161 |
<show_in_default>1</show_in_default>
|
| 162 |
<show_in_website>1</show_in_website>
|
| 163 |
+
<show_in_store>1</show_in_store>
|
| 164 |
<frontend_class>validate-number</frontend_class>
|
| 165 |
</sort_order>
|
| 166 |
</fields>
|
app/design/frontend/base/default/template/payeezy/form.phtml
CHANGED
|
@@ -97,7 +97,6 @@ $_useVault = $_loggedIn && $_model->useVault() && count($_savedCards);
|
|
| 97 |
</li>
|
| 98 |
<?php endif; ?>
|
| 99 |
</ul>
|
| 100 |
-
|
| 101 |
<script type="text/javascript">
|
| 102 |
//<