Version Notes
Fixes compatibility issues with older PHP versions
Download this release
Release Info
Developer | Heartland Payment Systems |
Extension | Hps_Securesubmit |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.2
- app/code/community/Hps/.DS_Store +0 -0
- app/code/community/Hps/Securesubmit/Model/Payment.php +2 -2
- app/code/community/Hps/Securesubmit/etc/system.xml +2 -2
- app/design/adminhtml/default/default/layout/securesubmit.xml +13 -0
- app/design/frontend/base/default/template/securesubmit/form.phtml +1 -1
- js/securesubmit/admin-checkout.js +51 -0
- lib/SecureSubmit/infrastructure/HpsException.php +1 -1
- package.xml +7 -7
app/code/community/Hps/.DS_Store
DELETED
Binary file
|
app/code/community/Hps/Securesubmit/Model/Payment.php
CHANGED
@@ -80,8 +80,8 @@ class Hps_Securesubmit_Model_Payment extends Mage_Payment_Model_Method_Cc
|
|
80 |
$cardType = null;
|
81 |
$additionalData = new Varien_Object($payment->getAdditionalData() ? unserialize($payment->getAdditionalData()) : null);
|
82 |
$secureToken = $additionalData->getSecuresubmitToken() ? $additionalData->getSecuresubmitToken() : null;
|
83 |
-
$saveCreditCard = !! $additionalData->getCcSaveFuture();
|
84 |
-
$useCreditCard = !! $additionalData->getUseCreditCard();
|
85 |
|
86 |
if ($saveCreditCard && ! $useCreditCard) {
|
87 |
$multiToken = true;
|
80 |
$cardType = null;
|
81 |
$additionalData = new Varien_Object($payment->getAdditionalData() ? unserialize($payment->getAdditionalData()) : null);
|
82 |
$secureToken = $additionalData->getSecuresubmitToken() ? $additionalData->getSecuresubmitToken() : null;
|
83 |
+
$saveCreditCard = !! (bool)$additionalData->getCcSaveFuture();
|
84 |
+
$useCreditCard = !! (bool)$additionalData->getUseCreditCard();
|
85 |
|
86 |
if ($saveCreditCard && ! $useCreditCard) {
|
87 |
$multiToken = true;
|
app/code/community/Hps/Securesubmit/etc/system.xml
CHANGED
@@ -41,7 +41,7 @@
|
|
41 |
<publicapikey translate="label">
|
42 |
<label>Public Api Key</label>
|
43 |
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
44 |
-
<sort_order>
|
45 |
<show_in_default>1</show_in_default>
|
46 |
<show_in_website>1</show_in_website>
|
47 |
<show_in_store>1</show_in_store>
|
@@ -50,7 +50,7 @@
|
|
50 |
<label>Secret Api Key</label>
|
51 |
<frontend_type>obscure</frontend_type>
|
52 |
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
53 |
-
<sort_order>
|
54 |
<show_in_default>1</show_in_default>
|
55 |
<show_in_website>1</show_in_website>
|
56 |
<show_in_store>1</show_in_store>
|
41 |
<publicapikey translate="label">
|
42 |
<label>Public Api Key</label>
|
43 |
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
44 |
+
<sort_order>30</sort_order>
|
45 |
<show_in_default>1</show_in_default>
|
46 |
<show_in_website>1</show_in_website>
|
47 |
<show_in_store>1</show_in_store>
|
50 |
<label>Secret Api Key</label>
|
51 |
<frontend_type>obscure</frontend_type>
|
52 |
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
53 |
+
<sort_order>40</sort_order>
|
54 |
<show_in_default>1</show_in_default>
|
55 |
<show_in_website>1</show_in_website>
|
56 |
<show_in_store>1</show_in_store>
|
app/design/adminhtml/default/default/layout/securesubmit.xml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<adminhtml_sales_order_create_index>
|
4 |
+
<reference name="head">
|
5 |
+
<action method="addJs">
|
6 |
+
<file>securesubmit/secure.submit-1.0.1.js</file>
|
7 |
+
</action>
|
8 |
+
<action method="addJs">
|
9 |
+
<file>securesubmit/admin-checkout.js</file>
|
10 |
+
</action>
|
11 |
+
</reference>
|
12 |
+
</adminhtml_sales_order_create_index>
|
13 |
+
</layout>
|
app/design/frontend/base/default/template/securesubmit/form.phtml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php /* @var $this Hps_Securesubmit_Block_Form */
|
2 |
$_code = $this->getMethodCode();
|
3 |
$public_key = Mage::getModel('hps_securesubmit/payment')->getConfigData('publicapikey');
|
4 |
-
$allow_card_saving = Mage::getModel('hps_securesubmit/payment')->getConfigData('allow_card_saving');
|
5 |
$_loggedIn = Mage::getSingleton('customer/session')->isLoggedIn();
|
6 |
if ($_loggedIn && $allow_card_saving) {
|
7 |
$customerStoredCards = Mage::helper('hps_securesubmit')->getStoredCards( Mage::getSingleton('customer/session')->getCustomerId());
|
1 |
<?php /* @var $this Hps_Securesubmit_Block_Form */
|
2 |
$_code = $this->getMethodCode();
|
3 |
$public_key = Mage::getModel('hps_securesubmit/payment')->getConfigData('publicapikey');
|
4 |
+
$allow_card_saving = (bool)Mage::getModel('hps_securesubmit/payment')->getConfigData('allow_card_saving');
|
5 |
$_loggedIn = Mage::getSingleton('customer/session')->isLoggedIn();
|
6 |
if ($_loggedIn && $allow_card_saving) {
|
7 |
$customerStoredCards = Mage::helper('hps_securesubmit')->getStoredCards( Mage::getSingleton('customer/session')->getCustomerId());
|
js/securesubmit/admin-checkout.js
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
AdminOrder.prototype.__secureSubmitOldSubmit = AdminOrder.prototype.submit;
|
2 |
+
Object.extend(AdminOrder.prototype, {
|
3 |
+
submit: function() {
|
4 |
+
if (this.paymentMethod != 'hps_securesubmit') {
|
5 |
+
this._secureSubmitOldSubmit();
|
6 |
+
return;
|
7 |
+
}
|
8 |
+
hps.tokenize({
|
9 |
+
data: {
|
10 |
+
public_key: this.secureSubmitPublicKey,
|
11 |
+
number: $('hps_securesubmit_cc_number').value,
|
12 |
+
cvc: $('hps_securesubmit_cc_cid').value,
|
13 |
+
exp_month: $('hps_securesubmit_expiration').value,
|
14 |
+
exp_year: $('hps_securesubmit_expiration_yr').value
|
15 |
+
},
|
16 |
+
success: this.secureSubmitResponseHandler.bind(this),
|
17 |
+
error: this.secureSubmitResponseHandler.bind(this)
|
18 |
+
});
|
19 |
+
},
|
20 |
+
secureSubmitResponseHandler: function (response) {
|
21 |
+
var tokenField = $('hps_securesubmit_token'),
|
22 |
+
lastFourField = $('hps_securesubmit_cc_last_four');
|
23 |
+
tokenField.value = lastFourField.value = null;
|
24 |
+
|
25 |
+
if (response && response.error) {
|
26 |
+
if (response.message) {
|
27 |
+
alert(response.message);
|
28 |
+
}
|
29 |
+
checkout.setLoadWaiting(false);
|
30 |
+
} else if (response && response.token_value) {
|
31 |
+
tokenField.value = response.token_value;
|
32 |
+
lastFourField.value = response.card.number.substr(-4);
|
33 |
+
|
34 |
+
if (this.orderItemChanged) {
|
35 |
+
if (confirm('You have item changes')) {
|
36 |
+
if (editForm.submit()) {
|
37 |
+
disableElements('save');
|
38 |
+
}
|
39 |
+
} else {
|
40 |
+
this.itemsUpdate();
|
41 |
+
}
|
42 |
+
} else {
|
43 |
+
if (editForm.submit()) {
|
44 |
+
disableElements('save');
|
45 |
+
}
|
46 |
+
}
|
47 |
+
} else {
|
48 |
+
alert('Unexpected error.')
|
49 |
+
}
|
50 |
+
}
|
51 |
+
});
|
lib/SecureSubmit/infrastructure/HpsException.php
CHANGED
@@ -8,7 +8,7 @@ class HpsException extends Exception{
|
|
8 |
public function __construct($message, $code, $innerException = null){
|
9 |
$this->code = $code;
|
10 |
$this->innerException = $innerException;
|
11 |
-
parent::__construct($message, 0
|
12 |
}
|
13 |
|
14 |
public function code(){
|
8 |
public function __construct($message, $code, $innerException = null){
|
9 |
$this->code = $code;
|
10 |
$this->innerException = $innerException;
|
11 |
+
parent::__construct($message, 0);
|
12 |
}
|
13 |
|
14 |
public function code(){
|
package.xml
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Hps_Securesubmit</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
-
<license uri="https://github.com/SecureSubmit/magento-extension/blob/master/LICENSE">Custom</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Take credit card payments and store cards in a PCI friendly way.</summary>
|
10 |
<description>Use Heartland Payment Systems SecureSubmit platform to charge, authorize, void, refund and partial refund credit cards.
|
11 |
-

|
12 |
Allow customers to store their cards for reduced friction at next checkout using our multi-use card tokenization process which helps reduce PCI scope.</description>
|
13 |
-
<notes>
|
14 |
<authors><author><name>Heartland Payment Systems</name><user>markhagan</user><email>EntApp_DevPortal@e-hps.com</email></author></authors>
|
15 |
-
<date>
|
16 |
-
<time>
|
17 |
-
<contents><target name="magecommunity"><dir name="Hps"><dir name="Securesubmit"><dir name="Block"><file name="Form.php" hash="a2e7bd1c2457cc7f12cb114b6957fefb"/><file name="Info.php" hash="3fa6b51d26f335e5ca52ee58a4399a3c"/></dir><dir name="Helper"><file name="Data.php" hash="04aeff6f94f56a49cf7527518c6212a1"/></dir><dir name="Model"><file name="Payment.php" hash="
|
18 |
<compatible/>
|
19 |
<dependencies><required><php><min>5.2.0</min><max>5.5.15</max></php></required></dependencies>
|
20 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Hps_Securesubmit</name>
|
4 |
+
<version>1.0.2</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license uri="https://github.com/SecureSubmit/heartland-magento-extension/blob/master/LICENSE">Custom</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Take credit card payments and store cards in a PCI friendly way.</summary>
|
10 |
<description>Use Heartland Payment Systems SecureSubmit platform to charge, authorize, void, refund and partial refund credit cards.
|
11 |
+

|
12 |
Allow customers to store their cards for reduced friction at next checkout using our multi-use card tokenization process which helps reduce PCI scope.</description>
|
13 |
+
<notes>Fixes compatibility issues with older PHP versions</notes>
|
14 |
<authors><author><name>Heartland Payment Systems</name><user>markhagan</user><email>EntApp_DevPortal@e-hps.com</email></author></authors>
|
15 |
+
<date>2015-02-23</date>
|
16 |
+
<time>16:40:49</time>
|
17 |
+
<contents><target name="magecommunity"><dir name="Hps"><dir name="Securesubmit"><dir name="Block"><file name="Form.php" hash="a2e7bd1c2457cc7f12cb114b6957fefb"/><file name="Info.php" hash="3fa6b51d26f335e5ca52ee58a4399a3c"/></dir><dir name="Helper"><file name="Data.php" hash="04aeff6f94f56a49cf7527518c6212a1"/></dir><dir name="Model"><file name="Payment.php" hash="4b864227eb114e7994b011ab8f5bef1b"/><dir name="Resource"><file name="Setup.php" hash="f568cb09a6a06fc3d52f145684997416"/><dir name="Storedcard"><file name="Collection.php" hash="021134d46837197e800f54a4b90b0048"/></dir><file name="Storedcard.php" hash="f2a993c8e4236bc03b1273a33a03b5d0"/></dir><dir name="Source"><file name="Cctype.php" hash="b5f75e4a3284f79b2cfab926b193c98b"/><file name="PaymentAction.php" hash="9fc55ebaaeaccba6c40597d25a1cf9d3"/></dir><file name="Storedcard.php" hash="82c7228d2182a0cba979dc4c66a2321c"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Proxy.php" hash="97028069630bddf2b94cb1b5b0886076"/></dir></dir></dir></dir><dir name="controllers"><file name="StoredcardController.php" hash="cb9e5f7de4f52fd7a764a87f0f4699a8"/></dir><dir name="etc"><file name="config.xml" hash="b3fde0de1a10e823ce680317738fd802"/><file name="system.xml" hash="be8a2c1d74b72b45bd14eed62cc5a5e7"/></dir><dir name="sql"><dir name="hps_securesubmit_setup"><file name="install-1.0.0.php" hash="57917d8b3b29830eb1a219466df4555b"/></dir></dir><file name=".DS_Store" hash="4a6d92e7f95a9f9208c420e97eb1d4ea"/></dir></dir></target><target name="mageweb"><dir name="js"><dir name="securesubmit"><file name="admin-checkout.js" hash="1493f7f32243bad6d4facd577a375198"/><file name="secure.submit-1.0.1.js" hash="a149dc8efcfa3b507d6b2b3c784d9db3"/></dir></dir></target><target name="magelib"><dir name="SecureSubmit"><file name="Hps.php" hash="8855d261c2df0de3fe7ad8e6e59668ad"/><dir name="entities"><file name="HpsAccountVerify.php" hash="a910342548320ba07ebc4c9cda2f7c96"/><file name="HpsAddress.php" hash="2e4554c509e1de8e8cb6b0d1f599d657"/><file name="HpsAuthorization.php" hash="c46f0ad9033d3197e641c1b63bd90c7e"/><file name="HpsBatch.php" hash="46ee0321f3c9f3824fdb930736c8df7e"/><file name="HpsCardHolder.php" hash="f74938b2f53d703c777def01adde5e91"/><file name="HpsCharge.php" hash="5e94b3094db8e4f231a456cedce40985"/><file name="HpsChargeExceptions.php" hash="927b346fdac882cf97fd46b5e740e363"/><file name="HpsCreditCard.php" hash="9394bb9cd123d572d2f3376f3ce52594"/><file name="HpsItemChoiceTypePosResponseVer10Transaction.php" hash="3516bf8acb77af8d4a36d02ed991d09e"/><file name="HpsRefund.php" hash="05a8dae7c7e0faf1e67ae628eca75ea2"/><file name="HpsReportTransactionDetails.php" hash="ad0221581bf4ee24410c1ed4aac4d305"/><file name="HpsReportTransactionSummary.php" hash="1d46cce9a3274f25c092171e034479bc"/><file name="HpsReversal.php" hash="1ffd02ea88816b9a7ef5579d6219d6b8"/><file name="HpsTokenData.php" hash="bfc42e3ed9ff078598d694565d7fd3be"/><file name="HpsTransaction.php" hash="fd2bb80e28f9143bb25a3df1508fb927"/><file name="HpsTransactionDetails.php" hash="ded777de86d2b93882b2779283247b64"/><file name="HpsTransactionHeader.php" hash="114de2d7b3648143d0ef16588dfbc1af"/><file name="HpsTransactionType.php" hash="58a73f5915ff2d3f9d89935232e90796"/><file name="HpsVoid.php" hash="09902616437fd001ec17cde2b6dd9780"/></dir><dir name="infrastructure"><file name="AVSResponseCodeHandler.php" hash="b376458f6bbf14907fd96b6b17566861"/><file name="ApiConnectionException.php" hash="8b6e2d5e4d7e3368adb34e1ab20412b0"/><file name="AuthenticationException.php" hash="4685a4fa0209ed56ef0ee38868f52840"/><file name="CardException.php" hash="09bf8965e0e101dcaf560c0927812306"/><file name="Exceptions.json" hash="8f7cbcb2b18963603ee3a62d6888c36d"/><file name="HpsConfiguration.php" hash="48ed3ba9eed035d5e57d245f5174b5bc"/><file name="HpsException.php" hash="ad9fbec07d00343bb53f71a835874ea4"/><file name="HpsExceptionMapper.php" hash="5f81eacdaea3ccb756a89b04ec4c20d6"/><file name="HpsSdkCodes.php" hash="b827c7268a5743a5fd45e992eeab2450"/><file name="InvalidRequestException.php" hash="a01ca17d036ce2e6410647aa1bd25491"/></dir><dir name="services"><file name="HpsBatchService.php" hash="8e46d58de558258c8af585c0a646b9ea"/><file name="HpsChargeService.php" hash="e1474cade11a45ccf450e182094e0e35"/><file name="HpsService.php" hash="52aefe6d72b1e4118fdd8ec04b75e28c"/><file name="HpsTokenService.php" hash="bfdee5e18ebdc2133f3512040e0da766"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="securesubmit.xml" hash="cc04e952cc17ea3462931a9e7a655316"/></dir><dir name="template"><dir name="securesubmit"><file name="form.phtml" hash="b6329408b11e9e979494a923e639f6cf"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="securesubmit.xml" hash="8aca5736bbba6ec8341cf9510c0ea5ab"/></dir><dir name="template"><dir name="securesubmit"><file name="form.phtml" hash="ae6221e7f9961b673470c265cdbb6927"/><file name="storedcards.phtml" hash="3412f0560d4ba696dc9bc3ed996e0577"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Hps_Securesubmit.xml" hash="d5aed3f48a45f8e611b68d1e6f34c959"/></dir></target></contents>
|
18 |
<compatible/>
|
19 |
<dependencies><required><php><min>5.2.0</min><max>5.5.15</max></php></required></dependencies>
|
20 |
</package>
|