=== AG Tyl By NatWest - WooCommerce Gateway === Contributors: We are AG, freemius Requires at least: 6.0 Tested up to: 6.8.3 Stable tag: 6.2 == Description == This plugin will allow you to process orders using the Tyl By NatWest system on a WooCommerce enabled website. == Installation == Setting up this plugin should only take 30 minutes to complete, follow the steps over at the plugin documentation page [here] (https://weareag.co.uk/docs/tyl-by-natwest/) == Frequently Asked Questions == = Does this plugin work with newest WP and WooCommerce versions? = Yes, this plugin works really well with the latest versions! We test regularly to make sure all plugins work with up-and-coming versions. = I have a problem with the plugin, it's not working = Ok not a problem, lets see if you can fix it by following these steps. 1. Enable the plugins debug mode in the settings page. 2. Process a test transaction using the gateway. 3. Check the plugin error logs to see if any errors have been logged, if they have, follow the steps to fix. 4. Issue is still not fixed? Check the Tyl error log in the back office. 5. Follow the steps in the troubleshooting section of the documentation to fix. 6. Still having issues? Send us a support ticket detailing the issue you have, we may ask for screenshots of the Tyl back office. == Upgrade Notice == Automatic updates should work like a charm; as always though, update on a staging site before pushing to a live site, failing that ensure you back up your site just in case. == Changelog == = v.1.7.10 - 24/11/25 = * New - New filter for changing 3D secure challenge. "ag_three_ds_challenge_indicator" * Change - Changed note classes used in admin dashboard (settings pages). * Change - Bump tested WooCommerce (10.3.5). * Update - Freemius SDK updated. = v.1.7.9 - 01/10/25 = * New - New V2.0 plugin settings page, including setup guide, tests cards, videos and AG Hub (replacing AG plugins in the dashboard menu). * New - New logic to stop wallet payments being shown multiple times in the same hook on checkout page. * Improvement - Replaced the inline form-based redirect with a dedicated redirect handler page for Tyl. This prevents duplicate forms/buttons, reduces JavaScript conflicts on merchant websites, and improves overall reliability of the payment hand-off. * Dev - Removed old welcome page and setup wizard. * Dev - Implemented data redaction for sensitive information within the ag_log() & stored meta data function. * Change - Bump tested WooCommerce (10.2.2). * Change - Removed some of the debug logging for TLS, these are no longer needed. * Update - Freemius SDK updated. = v.1.7.8 - 29/08/25 = * New - New TLS (Traffic light system) 2.0 update, more information, easier to understand what is going on with orders. * Change - Changed webhook processing logic for failed to paid orders. * Change - Bump tested WooCommerce (10.1.2). = v.1.7.7 - 30/07/25 = * New - New redirect UI design for Tyl, cleaner and easier for customers to understand what is going on. * Dev - Added is_test_mode() function to display if plugin is in test mode when viewing all gateways. * Change - Bump tested WooCommerce (10.0.4). * Update - Freemius SDK updated. = v.1.7.6 - 20/05/25 = * Change - Bump tested WooCommerce (9.8.5). * New - Implemented full support for WooCommerce’s new payment settings pages. * Fix - Resolved an issue where customer shipping names containing apostrophes (e.g., O'Brien). * Update - Freemius SDK updated. = v.1.7.5.1 - 28/01/25 = * Change - Bump tested WooCommerce (9.6.0). * Update - Freemius SDK updated. = v.1.7.4 - 20/01/25 = * New - Enforced a PHP minimum version requirement of 8.1 * Change - Updated the clean_phone_number() function default value to "11111111111" instead of "NA" for improved compatibility and processing. * Update - Freemius SDK updated. = v.1.7.3 - 04/11/24 = * New - Introduced an option to display both Google Pay and Apple Pay icons alongside other card brand logos. * Update - Freemius SDK updated. = v.1.7.2 - 07/10/24 = * Fix - Resolved an issue where customer names containing apostrophes (e.g., O'Brien) caused an error when attempting to place an order on WooCommerce. * Change - Bump tested WooCommerce (9.3.3). * Update - Freemius SDK updated. = v.1.7.1 - 09/09/24 = * Fix - Fixed issue of missing multi-account process. If the `ag_multi_account` filter is not set, the system will now default to the store's name and shared secret settings. = v.1.7.0 - 28/08/24 = * New - Enhanced support for WooCommerce Bookings by introducing the update_booking_status() function, utilised within the STATUS switch case for each status update to ensure accurate booking status management. * New - Transitioned to HMAC SHA512 from SHA256 as the hashing algorithm to bolster security. * New - Added notifications for failed payments on the WooCommerce failed payment page. If Tyl provides a specific message regarding the issue, this message is also displayed to the customer. * Dev - Implemented sanitization of address fields to guarantee the integrity and cleanliness of input data. * Dev - Generated an HMAC SHA512 signature to enhance the security of transaction data. * Dev - Developed a function to construct arguments for HMAC SHA512, preparing data for encryption. * Dev - Created a payload function for HMAC SHA512 to effectively structure transaction data. * Dev - Better support for when merchants use WooCommerce Sequential Order Numbers Pro (Non prefix). * Change - Bump tested WooCommerce (9.2.3). * Update - Freemius SDK updated. = v.1.6.17 - 05/07/24 = * Fix - Resolved an issue with HPOS related to the Traffic light system activating before an order has been created. * Change - Updated the setup video presentation from an embedded format to a clickable YouTube link. * Change - Revised the handling of JavaScript for wallet payments to improve functionality. = v.1.6.16 - 01/07/24 = * New - Introduced a documentation tab in the plugin settings, featuring a setup video and links to basic documentation. * New - Introduced a way for merchants to change URL customers are sent to when they cancel transaction. * Dev - Redesigned webhooks to incorporate transient lock, enhancing the reliability of webhook notification delivery. * Dev - Added a new helper function to check if an order includes a WooCommerce Booking product. * Dev - If a Booking product is detected and the customer cancels the payment, the status of the order will be changed to pending payment. * Change - Removed the function that empties the cart following failed transactions. * Change - Bump tested WooCommerce (9.0.2). = v.1.6.15 - 15/05/24 = * Fix - Fixed issue where Store ID type notice would show when no store ID is entered. * Change - Bump tested WooCommerce (8.9.0). = v.1.6.14 - 13/05/24 = * Dev - Updated the approach for managing checkout page CSS including block check. * Dev - Refined the way admin CSS is handled. * Dev - Enhanced handling of TLS CSS for better support of both HPOS and non-HPOS sites. * Change - Plugin settings pages have been revamped and cleaned up. * Change - Added new WooCommerce dependencies header. * Change - Bump tested WooCommerce (8.8.3). * Update - Freemius SDK updated. = v.1.6.13.1 - 14/03/24 = * Dev - Added PHP constant to force a delay for webhook code 'ag_webhook_delay'. * Dev - Setup wizard copy has been updated to include information on where Store ID and Shared Secret comes from (Tyl by NatWest). * Dev - Set up wizard now uses the account_type_checker() function to set the plugin operation mode to match Store ID entered (Live / Test). * Dev - Introduced Tyl order status to the traffic light system. * Dev - Introduced 3D secure response message to order notes, rather than showing a code, we now display text information. * Fix - Fixed issue where fail reason would continue to show when order is finally paid. Customer failed multiple times, then was able to pay without an issue. * Fix - Added logic to catch if Store ID is empty within account_type_checker(). * Change - Stopped set up wizard showing when plugin is updated or activated if Store ID is already set. * Change - Bump tested WooCommerce (8.6.1). = v.1.6.12 - 16/02/24 = * Enhancement - Implemented a bypass mechanism for store ID processing based on the presence of the 'storename_bypass' PHP constant or the store ID falling within a specific numeric range set by Tyl. = v.1.6.11 - 16/02/24 = * Dev - Completely re-engineered the function responsible for detecting whether merchants have configured their Store ID for either test or live environments. This rebuild ensures more accurate detection and seamless operation between different modes. * Dev - Introduced a new warning mechanism that activates when merchants attempt to use a live Store ID in test mode. The checkout process is halted, and clear warnings are displayed, advising the merchant to either change their Store ID or switch the plugin to live mode to prevent incorrect transaction processing. * Dev - Enhanced the clarity and visibility of notices within the settings page through more precise language and additional styling. These improvements aim to make important information more noticeable and understandable to users. * Dev - Upon entering a Store ID, the system now explicitly indicates whether it is configured for test or live mode next to the input field. This feature provides immediate feedback to merchants, helping to prevent configuration errors and streamline the setup process. * Change - Bump tested WooCommerce (8.6). = v.1.6.10 - 01/02/24 = * Fix - Fixed issue where TLS would show for non Tyl orders on the main order page. * Fix - Fixed issue where TLS would not show on stores with HPOS enabled. = v.1.6.9 - 24/01/24 = * Dev - Added a conditional check in the approval code processing. If transaction failed and the 3D Secure code equals '1' (pass), the system returns a message: "Authenticated, but transaction failed". This ensures better handling of failed transactions even when authentication is successful. * Dev - Implemented a new feature to display a failure message if the 'fail_reason' variable is returned. This enhances the system's response to errors, providing clear and specific insights into the reasons why a transaction might have failed. * Dev - Resolved PHP 8.1 compatibility issue related to handling NULL values in add_submenu_page() function for the setup wizard. * Dev - Addressed deprecated warnings in the ag_Tyl_checkout class by fixing the creation of dynamic properties. * Update - Freemius SDK updated. * Change - Bump tested WooCommerce (8.5). = v.1.6.8 - 11/12/23 = * Dev - CSS fix for traffic light system, third party plugin changing style of TLS. * Dev - Page Builder (Divi & WP Bakery) Fix because they love to duplicate woocommerce_receipt_(orderpayment_method). * Dev - Removed delay from webhook. * Change - Changed URL for feature request on welcome page. * Update - Freemius SDK updated. * Change - Bump tested WooCommerce (8.3). = v.1.6.7 - 08/11/23 = * Dev - Support when WooCommerce tax rounding is enabled. * Dev - Better support when a custom fee is added to orders. * Fix - Fixed when WooCommerce tax option "prices entered with tax" was set to yes, some merchants had issues with subtotal pram sent over to Tyl. * Fix - Fixed issue with set up wizard showing as a blank menu item under Dashboard. = v.1.6.6 - 03/11/23 = * Dev - New define "ag_strip_psp_order_totals" to strip tax, shipping and subtotal on Tyl's payment page. * Dev - Added support for add_fee() to be added to subtotal value. * Fix - Fixed issue when discount code is used. * Update - Freemius SDK updated. * Change - Bump tested WooCommerce (8.2). = v.1.6.5.1 - 05/10/23 = * Dev - New filter "ag_custom_order_statuses_filter" to allow merchants to change order status for logic to catch if order has been paid. * Fix - Fixed issue when discount code is used. = v.1.6.4 - 27/09/23 = * Dev - Token payments not supported by Tyl. * Update - Freemius SDK updated. * Change - Bump tested WooCommerce (8.1). = v.1.6.3 - 25/07/23 = * New - New filter to pass over comments to Tyl platform ag_custom_comments. * Fix - Fixed issue with webhook when using multiple Tyl accounts. * Change - Bump tested WooCommerce (7.9). = v.1.6.2 - 05/07/23 = * Update - Freemius SDK updated. = v.1.6.1 - 20/06/23 = * New - New logic to catch if users are using Woo version < 7.0 and display message in debug log to update WooCommerce. = v.1.6.0 - 19/06/23 = * New - Support for WooCommerce HPOS - Coming in Woo 8.0. * Dev - Refactored process_payment() to handle wallet payments better. * Dev - New helper function to clear old logs. * Dev - Shipping pram forced to two decimal points (some shipping plugins set to higher). * Update - Freemius SDK updated. = v.1.5.14 - 24/04/23 = * Dev - Fixed issue with approval_code sent back from Tyl when containing backslash characters as part of the string. * Change - Bump tested WooCommerce (7.7). = v.1.5.13 - 28/04/23 = * Dev - New filter to allow merchants to use multiple Tyl accounts on a single website. * Update - Freemius SDK updated. = v.1.5.12 - 20/04/23 = * Dev - Added notice for live store ID to account_type_checker() in settings page. * Update - Freemius SDK updated. = v.1.5.11 - 21/03/23 = * Dev - New logic to catch issue with some page builders duplicating payment button. * Change - Bump tested WooCommerce (7.6). = v.1.5.10 - 21/02/23 = * New - New filter for moto user role. * Change - Renamed "Order Check" to "AG Traffic Light System". * Change - Improvements to MOTO and Status Check Ajax scripts. * Change - Improvements to shipping data in receipt_page(). * Change - Improvements to update_order_notes() & update_order_meta_data(). * Change - Bump tested WooCommerce (7.5). * Dev - Added useragent storage to help with debugging. * Update - Freemius SDK updated. = v.1.5.9 - 13/12/22 = * Change - Location of Welcome page CSS changed. * Update - Freemius SDK updated. = v.1.5.8 - 15/11/22 = * Change - Wizard Update. * Change - Change to wallet payment hidden field location prepend. * Change - Bump tested WooCommerce (7.1). * Update - Freemius SDK updated. = v.1.5.7.1 - 03/11/22 = * Change - Added support to card selected in settings to show in new Woo checkout blocks * Fix - Fixed issue with webhooks for PHP 8.0 * Dev - Disabled card token payments, not supported on Tyl platform. = v.1.5.7 - 31/10/22 = * Improvement - WooCommerce checkout blocks. = v.1.5.6 - 18/10/22 = * Improvement - Fraud Check UI. * Fix - Wizard Optimizing Steps. * Fix - AG Path fix. * Fix - Update test Card. * Fix - Fixed issue with WooCommerce checkout blocks. = v.1.5.5 - 20/09/22 = * Fix - Fixed issue with setup wizard on newer versions of WooCommerce. = v.1.5.4 - 15/09/22 = * Dev - New webhook class to help with notification URL. * Change - Bump tested WooCommerce (6.9). * Change - Removed upsell and blog posts in welcome page (help speed up page). * Change - Billing name sent to Tyl payment page. = v.1.5.3 - 01/09/22 = * Fix - Fixed Text Domain. * Fix - Fix to debug log wrapping notification delay. = v.1.5.2 - 17/08/22 = * Dev - Added delay to webhook notification. = v.1.5.1 - 11/08/22 = * Fix - Improvement to how fraud check feature gets data. * Change - Bump tested WooCommerce (6.8). * Update - Freemius SDK updated. = v.1.5.0.2 - 26/07/22 = * Fix - Fixed issue in fraud check feature. = v.1.5.0 - 26/07/22 = * New - Fraud Check new Feature for Orders. * Dev - Changed responseFailURL parameter to use check_response(). * Dev - Pass shipping and Vat over to Tyl to be displayed on payment page. * Dev - Fix for when using MOTO payment in test mode. * Dev - Changed logic in get_icon() function. * Change - Google Pay icon file URL changed. * Change - Tweaks to set up wizard codebase for better performance. * Change - Changed doc URLs in set up wizard. * Update - Freemius SDK update. = v.1.4.0.1 - 08/07/22 = * Change - Tokenization setting doc URL changed. = v.1.4.0 - 07/07/22 = * New - New feature Support for credit card tokenization. Customers can use a saved card at checkout! * New - Add Notice for Store ID (Test/Live) Accounts. * New - New helper function account_type_checker() to check account type for Store ID (Test/Live) = v1.3.8 - 15/06/22 = * Change - Bump tested WooCommerce (6.6.0) and WordPress (6.0) versions. * Change - Change to authenticateTransaction parameter to support MOTO payments. = v1.3.7 - 13/06/22 = * Dev - Rebuild of Tyl callback function. = v1.3.6 - 27/05/22 = * Change - New code added to force txndatetime to match selected timezone time stamp. * Change - Change to abort warning message. * Fix - Fixed issue with transaction notification not running for some merchants (fixes "The Tyl hash sent back didn't match what the website had" debug message). = v1.3.5 - 24/05/22 = * Fix - Fixed issue with wallet payments, if customer selects wallet payment, then customer returned back to website to try and pay via card payment instead of wallet payment. = v1.3.4 - 20/05/22 = * Change - Added transactionNotificationURL to payment request. = v1.3.3 - 30/03/22 = * Change - New logic to catch WordPress default timezone (UTC+0) and change to Europe/London. * Change - Changed URL for doc link when test mode is active on checkout page. = v1.3.2 - 03/03/22 = * Update - Freemius SDK update. = v1.3.1 - 05/01/22 = * Fix - Replaced plugin icon image with updated version. = v1.3.0 - 05/01/22 = * New - New feature - Apple and Google pay support. * New - New feature - MOTO payments (Pay over the phone). * New - Added both invoicenumber and POnumber parameters that are passed over to Tyl. * New - Two new filters to pass over custom data to invoicenumber and POnumber. * New - Added new deeper debugging, Tyl / We are AG support sometimes need a data dump to debug any issues. * Dev - New logic gate to catch fail reason: WRONG TRANSACTION STATE - Customer clicking back and processing order again on Tyl. * Dev - Changes to doc URLs, we have a new website. * Dev - Changes to the start here links, pulled right from doc site. * Dev - Minimised plugin CSS files. * Dev - New welcome screen design. * Dev - New dynamic upsell inside welcome screen. * Dev - Small delay added to Tyl callback, help stop callback firing before customer is sent back to website. * Dev - Extra error handling for callback. * Change - Some security and performance improvements to the codebase. * Change - Change to timezone parameter to support WP options. * Change - Popup shown when store status changed in settings page. = v1.2.3 - 25/11/21 = * Dev - Added second check for callback duplicate order notes * Fix - Fixed order has_status() statement. * Change - Changed plugin doc URL (We have a new website). * Change - Set troubleshooting URL in Welcome page = v1.2.2 - 29/06/21 = * Change - Removed PHP version warnings from debug log. * Dev - Removed the ag_show_wizard() function and replaced with FS redirect. * Change - Change to subtotal parameter to fix issue with PDF Product Voucher plugin. * Change - Some minor security improvements. = v1.2.1 - 02/06/21 = * Change - Change to setup wizard step three. = v1.2.0 - 26/05/21 = * Change - Change to ag_Tyl_country_code() function, debug notice changed to give more information on custom currencies. * Change - Put back the customers shipping address passed to Tyl. * New - New logic added to callback request. * Update - FS SDK update. = v1.1.1 - 31/03/21 = * Fix - Fix on form submit. * Fix - Fix to auto redirect to wizard on first setup. = v1.1.0 - 25/03/21 = * New - Support for WooCommerce Checkout Blocks (Gutenberg). * New - New warning notice if plugin settings has an issue and gateway is unable to process. * Fix - Fixed issue with double order notes. * Fix - Fixed issue with API callback. * Fix - Fixed step three text in setup wizard. * Fix - Fixed issue with some shared secret in wizard. * Fix - Fixed border issue in setup wizard welcome screen. * Fix - Fixed admin URLs in the welcome screen. * Support - Support for Sequential Order Number plugins. * Change - Replaced AG_Tyl_extra::AG_escape() in ag_show_wizard() function as was causing issues for small number of new installs. * Change - Moved img folder inside assets folder. * Change - Storing transaction ID for use in other plugins. * Change - Removed customers shipping address from being passed to Tyl. * Update - FS SDK update. = v1.0.3 - 17/12/20 = * Fix - Catch error of AG_Tyl_extra class when plugin first installed. * Update - Updated FS SDK. = v1.0.2 - 02/11/20 = * Fix - New define to bypass logic if user gets stuck in wizard redirect loop ('AG_redirect_bypass'). = v1.0.1 - 05/10/20 = * Fix - Fixed plugin rename issue. = v1.0 - 29/09/20 = * Genesis - first release