From 5e85b530f17cbbbc04931406d1bc68e3cf8a32fa Mon Sep 17 00:00:00 2001 From: Chris Brown Date: Wed, 22 Feb 2017 15:58:14 -0500 Subject: [PATCH] Updates to Level III support (added option to enable it if wanted) --- README.md | 35 +++++++++++++++------- includes/modules/payment/firstdata_hco.php | 17 ++++++++--- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 8957b7c..e223687 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,6 @@ There are 9 pages of settings available. The following are the ones that you nee `1`. General - Page Title - Whatever you want this page to be named. This will be the title shown on the payment page. - "Return to your Store" URL - the URL to your store. - - Enable Level 3 Processing if you want lower rates. Check with your account rep to see if you qualify. - -`4`. Receipt Page - - Return Link Method: This setting is auto-determined by the HCO module. But if you want to make a choice, choose **REDI** or **AUTO-POST** or **LINK** - - "Receipt Link URL" **needs to point to your store's checkout_process page**, which is at: - - `https://your_domain.com/index.php?main_page=checkout_process` `8`. Appearance - Header Logo: Upload a Logo if you wish to brand your payment page @@ -46,11 +39,33 @@ There are 9 pages of settings available. The following are the ones that you nee Finally, click `Save Changes` to save all the settings you've altered. +-- +### Optional +`4`. Receipt Page + - Return Link Method: This is set to AUTO-POST inside all transactions sent by this module, regardless of this setting. + + + - "Receipt Link URL" - This module automatically sends the correct URL with each transaction. It will be set to your store's checkout_process page, which is at: + + `https://your_domain.com/index.php?main_page=checkout_process` + + [NOTE: The module sets this URL inside each transaction, so technically you can leave this blank.] + + + +## Level 3 Processing Support +Level 3 Processing is usually only necessary if you are processing Government credit cards. + +Zen Cart already passes all the Level 3 data, but if you want to benefit from it, you need to enable Level 3 data support in 3 places: + +1. In your First Data Terminal. (Login to the GlobalGateway account, click on Home, then Terminals, then your business name, then the terminal (if more than one, choose the one for ECOMM / ecommerce). Then enable the Level 3 feature, and save.) + +2. In your Hosted Checkout Page settings: Go to your Payment Pages screen, click on the page ID. Then on the General tab, check the box for Enable Level 3 Processing, and click Save. + +3. In this payment module. Go to your Zen Cart Admin->Modules->Payment screen, click on Hosted Checkout Pages, Edit, and set "Enable Level 3 Processing" to 'Yes'. -### Level 3 Processing Support -Level 3 support can help reduce your interchange rates/fees. -Zen Cart already passes all the Level 3 data, but if you want to benefit from it, you need to have your account rep enable Level 2 and Level 3 data support in your HCO Terminal. Contact them for assistance. +NOTE: MasterCard Level 1 (Consumer) cards won't allow Level 3 data for settlement, so might be rejected AFTER the transaction is initially approved. If this happens to you regularly, then you may need to turn OFF all Level 3 support in the module. The downside is you may pay higher interchange rates for those Level 3 transactions as a result. This is a limitation by MasterCard. diff --git a/includes/modules/payment/firstdata_hco.php b/includes/modules/payment/firstdata_hco.php index adee3d6..c6d97e7 100644 --- a/includes/modules/payment/firstdata_hco.php +++ b/includes/modules/payment/firstdata_hco.php @@ -21,7 +21,7 @@ class firstdata_hco extends base { /** * $moduleVersion is the plugin version number */ - var $moduleVersion = '1.01'; + var $moduleVersion = '1.02'; /** * $title is the displayed name for this payment method @@ -199,7 +199,6 @@ function process_button() { 'x_currency_code' => $_SESSION['currency'], 'x_type' => MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_AUTHORIZATION_TYPE == 'Authorize' ? 'AUTH_ONLY': 'AUTH_CAPTURE', 'x_email_customer' => ((MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_EMAIL_CUSTOMER == 'True') ? 'TRUE': 'FALSE'), - 'enable_level3_processing' => 'TRUE', 'x_cust_id' => $_SESSION['customer_id'], 'x_company' => $order->billing['company'], 'x_first_name' => $order->billing['firstname'], @@ -228,6 +227,10 @@ function process_button() { // 'x_ga_tracking_id' => '', // Enter Google Analytics Tracking ID if you want this payment page included in your funnel ); + if (MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_ENABLE_LEVEL3 == 'Yes') { + $submit_data_core['enable_level3_processing'] = 'TRUE'; + } + // lookup shipping and discount amounts if (sizeof($order_totals)) { for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { @@ -264,11 +267,11 @@ function process_button() { // Add line-item data to transaction + $items = ''; + $item_log = array(); if (sizeof($order->products) < 100) { - $items = ''; $delim = '<|>'; $product_code = $commodity_code = ''; // not submitted - $item_log = array(); for ($i=0; $iproducts); $i++) { $p = $order->products[$i]; // Item ID<|>Item Title<|>Item Description<|>Quantity<|>Unit Price<|>Taxable (Y or N)<|>Product Code<|>Commodity Code<|>Unit of Measure<|>Tax Rate<|>Tax Type<|>Tax Amount<|>Discount Indicator<|>Discount Amount<|>Line Item Total @@ -396,6 +399,10 @@ function after_process() { */ function check() { global $db; + // install newer switches, if relevant + if (defined('MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_STATUS') && !defined('MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_ENABLE_LEVEL3')) { + $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Level 3 Support', 'MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_ENABLE_LEVEL3', 'No', 'Should transactions be sent with Level 3 Processing enabled? (This is usually only to support Government cards) (You must enable Level 3 processing in your account Terminal and Hosted Page settings, else this will result in errors and reversals.)', '6', '0', 'zen_cfg_select_option(array(\'Yes\', \'No\'), ', now())"); + } if (!isset($this->_check)) { $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_STATUS'"); $this->_check = $check_query->RecordCount(); @@ -426,6 +433,7 @@ function install() { $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Debug Mode', 'MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_DEBUGGING', 'Alerts Only', 'Would you like to enable debug mode? A detailed log of failed transactions may be emailed to the store owner.', '6', '0', 'zen_cfg_select_option(array(\'Off\', \'Alerts Only\', \'Log File\', \'Log and Email\'), ', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Currency Supported', 'MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_CURRENCY', 'USD', 'Which currency is your First Data Payment Page Account configured to accept?
(Purchases in any other currency will be pre-converted to this currency before submission using the exchange rates in your store admin.)', '6', '0', 'zen_cfg_select_option(array(\'USD\', \'CAD\', \'GBP\', \'EUR\', \'AUD\', \'NZD\'), ', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('HMAC Calculation', 'MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_HMAC_MODE', 'MD5', 'The HMAC Encryption Type (from Payment Page Settings, under 9:Security)', '6', '0', 'zen_cfg_select_option(array(\'MD5\'), ', now())"); + $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Level 3 Support', 'MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_ENABLE_LEVEL3', 'No', 'Should transactions be sent with Level 3 Processing enabled? (This is usually only to support Government cards) (You must enable Level 3 processing in your account Terminal and Hosted Page settings, else this will result in errors and reversals.)', '6', '0', 'zen_cfg_select_option(array(\'Yes\', \'No\'), ', now())"); } /** * Remove the module and all its settings @@ -452,6 +460,7 @@ function keys() { 'MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_CURRENCY', 'MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_AUTHORIZATION_TYPE', 'MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_EMAIL_CUSTOMER', + 'MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_ENABLE_LEVEL3', 'MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_HMAC_MODE', 'MODULE_PAYMENT_FIRSTDATA_PAYMENTPAGES_DEBUGGING'); }