├── .gitignore ├── assets └── images │ ├── payway.png │ ├── payway-logo.png │ └── banner-1544x500.png ├── languages ├── tcom-payway-wc-hr.mo ├── tcom-payway-wc.pot └── tcom-payway-wc-hr.po ├── .github ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md └── workflows │ └── wordpress-plugin-check.yml ├── classes ├── admin │ ├── class-payway-wp-list-table.php │ └── class-paywaydata-list-table.php └── class-wc-tpayway.php ├── LICENSE ├── CHANGELOG.md ├── tcom-payway-woocommerce.php ├── README.md └── CODE_OF_CONDUCT.md /.gitignore: -------------------------------------------------------------------------------- 1 | modules.xml 2 | php.xml 3 | vcs.xml 4 | woocommerce-tcom-payway.iml 5 | .idea 6 | -------------------------------------------------------------------------------- /assets/images/payway.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marinsagovac/woocommerce-tcom-payway/HEAD/assets/images/payway.png -------------------------------------------------------------------------------- /assets/images/payway-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marinsagovac/woocommerce-tcom-payway/HEAD/assets/images/payway-logo.png -------------------------------------------------------------------------------- /languages/tcom-payway-wc-hr.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marinsagovac/woocommerce-tcom-payway/HEAD/languages/tcom-payway-wc-hr.mo -------------------------------------------------------------------------------- /assets/images/banner-1544x500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marinsagovac/woocommerce-tcom-payway/HEAD/assets/images/banner-1544x500.png -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the solution you'd like** 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | 12 | 13 | **To Reproduce** 14 | 15 | 16 | **Version** 17 | 18 | 19 | **Expected behavior** 20 | 21 | 22 | **Additional context** 23 | -------------------------------------------------------------------------------- /.github/workflows/wordpress-plugin-check.yml: -------------------------------------------------------------------------------- 1 | name: 'build-test' 2 | on: # rebuild any PRs and main branch changes 3 | pull_request: 4 | push: 5 | branches: 6 | - master 7 | - 'releases/*' 8 | - '40-fix-build-from-github-actions' 9 | 10 | jobs: 11 | test: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v3 16 | 17 | - name: Run plugin check 18 | uses: wordpress/plugin-check-action@v1 19 | -------------------------------------------------------------------------------- /classes/admin/class-payway-wp-list-table.php: -------------------------------------------------------------------------------- 1 | prepare_items(); 16 | ?> 17 |
18 |

PayWay Data Lists

19 | display(); ?> 20 |
21 | get_columns(); 16 | $hidden = $this->get_hidden_columns(); 17 | $sortable = $this->get_sortable_columns(); 18 | 19 | $data = $this->table_data(); 20 | usort( $data, array( &$this, 'sort_data' ) ); 21 | 22 | $per_page = 20; 23 | $current_page = $this->get_pagenum(); 24 | $total_items = count( $data ); 25 | 26 | $this->set_pagination_args( 27 | array( 28 | 'total_items' => $total_items, 29 | 'per_page' => $per_page, 30 | ) 31 | ); 32 | 33 | $data = array_slice( $data, ( ( $current_page - 1 ) * $per_page ), $per_page ); 34 | 35 | $this->_column_headers = array( $columns, $hidden, $sortable ); 36 | $this->items = $data; 37 | } 38 | 39 | /** 40 | * Override the parent columns method. Defines the columns to use in your listing table 41 | * 42 | * @return Array 43 | */ 44 | public function get_columns() { 45 | $columns = array( 46 | 'id' => 'ID', 47 | 'transaction_id' => 'Transaction ID', 48 | 'response_code' => 'Response Code', 49 | 'response_code_desc' => 'Response Code Description', 50 | 'amount' => 'Amount', 51 | 'or_date' => 'Date', 52 | 'status' => 'Status', 53 | ); 54 | 55 | return $columns; 56 | } 57 | 58 | /** 59 | * Define which columns are hidden 60 | * 61 | * @return Array 62 | */ 63 | public function get_hidden_columns() { 64 | return array(); 65 | } 66 | 67 | /** 68 | * Define the sortable columns 69 | * 70 | * @return Array 71 | */ 72 | public function get_sortable_columns() { 73 | return array( 'title' => array( 'title', false ) ); 74 | } 75 | 76 | /** 77 | * Get the table data 78 | * 79 | * @return Array 80 | */ 81 | private function table_data() { 82 | global $wpdb; 83 | 84 | $res = array(); 85 | 86 | $table_name = $wpdb->prefix . 'tpayway_ipg'; 87 | 88 | $res = $wpdb->get_results( 'SELECT * FROM ' . $table_name, ARRAY_A ); 89 | 90 | return $res; 91 | } 92 | 93 | /** 94 | * Define what data to show on each column of the table 95 | * 96 | * @param Array $item Data 97 | * @param String $column_name - Current column name 98 | * 99 | * @return Mixed 100 | */ 101 | public function column_default( $item, $column_name ) { 102 | switch ( $column_name ) { 103 | case 'id': 104 | case 'transaction_id': 105 | case 'response_code': 106 | case 'response_code_desc': 107 | case 'amount': 108 | case 'or_date': 109 | case 'status': 110 | return $item[ $column_name ]; 111 | 112 | default: 113 | return print_r( $item, true ); 114 | } 115 | } 116 | 117 | /** 118 | * Allows you to sort the data by the variables set in the $_GET 119 | * 120 | * @return Mixed 121 | */ 122 | private function sort_data( $a, $b ) { 123 | // Set defaults 124 | $orderby = 'transaction_id'; 125 | $order = 'desc'; 126 | 127 | // If orderby is set, use this as the sort column 128 | if ( ! empty( $_GET['orderby'] ) ) { 129 | $orderby = $_GET['orderby']; 130 | } 131 | 132 | // If order is set use this as the order 133 | if ( ! empty( $_GET['order'] ) ) { 134 | $order = $_GET['order']; 135 | } 136 | 137 | $result = strnatcmp( $a[ $orderby ], $b[ $orderby ] ); 138 | 139 | if ( 'asc' === $order ) { 140 | return $result; 141 | } 142 | 143 | return -$result; 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | ## Info 4 | 5 | Most recent latest changes is defined on every major, minor and bug fixes. 6 | 7 | ## Versions 8 | 9 | ### 1.8.6 10 | 11 | * bugfixing on undefined $_SERVER request method REQUEST_METHOD to clear logs 12 | * simply determine language code determine_language() function 13 | 14 | ### 1.8.5 15 | 16 | * fix redirection of t-com payway 17 | 18 | ### 1.8.3 19 | 20 | * Cleanup a code 21 | * Support for PHP 8.2/8.3 22 | * Added property missing in class 23 | 24 | ### 1.8.2 25 | 26 | * Fix isset issue when value is 0 or is not Amount 27 | 28 | ### 1.7.2 29 | 30 | * Hotfix on on cancelling order will not empty cart 31 | 32 | ### 1.7.1 33 | 34 | * Change HNB URL tecajna to v3 35 | 36 | ### 1.7 37 | 38 | Use since 01.01.2023 as EUR mandatory currency: 39 | 40 | * EUR as main currency set 1.1.2022., removed unnecessary codes for conversion from HRK to EUR 41 | * Added Currency code 978 and sent mandatory as `CurrencyCode` property [ISO 4217 HR](https://www.six-group.com/en/products-services/financial-information/data-standards.html) 42 | * IntCurrency/IntAmount set as HRK currency for informative calculation 43 | 44 | > Na svim Vašim shopID-evima će se sa 01.01.2023 od strane PayWay-a automatski postaviti EUR valuta, a na platnoj formi će i dalje biti dvojni prikaz cijena, no sa EUR valutom kao osnovnom i informativnim iznosom u HRK. 45 | 46 | ### 1.6.1 47 | 48 | * Curl module load checks 49 | 50 | ### 1.6 51 | 52 | * IntlCurrency and IntAmount added 53 | * API 2.0 Support 54 | * Production and testing API 55 | * Removed T-Com brand names 56 | * Added other languages support 57 | * Removed Woo Multi Currency Support 58 | * HNB auto conversion support 59 | * added gitignore file 60 | * removed old readme file 61 | * Replace banner image of PayWay on checkout with smaller 250px width 62 | 63 | ### 1.3.3 64 | 65 | * fixing minor bugs 66 | * changelog added and linked 67 | 68 | ### 1.3.2 69 | 70 | * Signatures typo issues fixed 71 | * Resolved description settings that is not shown 72 | 73 | ### 1.3 74 | 75 | * Complete code review and files reorganisation 76 | * Added textdomain and translations 77 | * Applied WP Coding Standards 78 | * Fixed deprecated WC Order methods 79 | 80 | ### 1.2 81 | 82 | * Added WPML support to supply the currency rate 83 | * Keep support for Woo Multi Currency 84 | 85 | ### 1.1 86 | 87 | * Fix receipment class 88 | * Added wiki documenatation 89 | 90 | ### 1.0 91 | 92 | * Fix pgw result code 93 | * Fix response code, parsing $id variable 94 | * Clean unneeded codes 95 | * Timeout 3 seconds so that user can read notice on redirecting page 96 | * Pending status after successful payment 97 | * Order note with code status when is status code 3, returning to cart and empty cart (cancelled status) 98 | * User already receive email notifications for successful transactions, translated to Croatian 99 | 100 | ### 0.9b 101 | 102 | * Removed unused code, added include plugin, fix name class 103 | 104 | ### 0.9a 105 | 106 | * Fix 3D Secure with response code 4 as success with pending status 107 | 108 | ### 0.9 109 | 110 | * Added data list table to show PayWay transaction status on administration page [Example](https://github.com/marinsagovac/woocommerce-tcom-payway/blob/master/docs/DataList.jpg) 111 | 112 | ### 0.8a 113 | 114 | * Fixed Woocommerce declined, successfull or failed status to Order status 115 | * Support with Woo Multi Currency plugin to handle multi currency with PayWay (default is deactivated) 116 | * Added reason code and reason response text received from PayWay, showing to client status message 117 | * Fix unused codes, rebuild database table to persist response code 118 | * Remove and cleanup code 119 | 120 | ### 0.7 121 | 122 | * Added locale language on PayWay based on language in Wordpress locale 123 | 124 | ### 0.6 125 | 126 | * Fix currency by billing Country (not language localization URI) 127 | * Remove unused code 128 | * Cleaning up 129 | -------------------------------------------------------------------------------- /tcom-payway-woocommerce.php: -------------------------------------------------------------------------------- 1 | prefix . 'tpayway_ipg'; 74 | $charset_collate = ''; 75 | 76 | if (! empty($wpdb->charset)) { 77 | $charset_collate = "DEFAULT CHARACTER SET {$wpdb->charset}"; 78 | } 79 | 80 | if (! empty($wpdb->collate)) { 81 | $charset_collate .= " COLLATE {$wpdb->collate}"; 82 | } 83 | 84 | $sql = "CREATE TABLE IF NOT EXISTS $table_name ( 85 | id int(9) NOT NULL AUTO_INCREMENT, 86 | transaction_id int(9) NOT NULL, 87 | response_code int(6) NOT NULL, 88 | response_code_desc VARCHAR(20) NOT NULL, 89 | reason_code VARCHAR(20) NOT NULL, 90 | amount VARCHAR(20) NOT NULL, 91 | or_date DATE NOT NULL, 92 | status int(6) NOT NULL, 93 | UNIQUE KEY id (id) 94 | ) $charset_collate;"; 95 | 96 | require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 97 | dbDelta($sql); 98 | 99 | add_option('jal_db_version', $jal_db_version); 100 | } 101 | register_activation_hook(__FILE__, 'jal_install_tpayway'); 102 | 103 | function jal_install_data_tpayway() 104 | { 105 | global $wpdb; 106 | 107 | $welcome_name = 'PayWay Hrvatski Telekom'; 108 | $welcome_text = 'Congratulations, you just completed the installation!'; 109 | 110 | $table_name = $wpdb->prefix . 'tpayway_ipg'; 111 | } 112 | register_activation_hook(__FILE__, 'jal_install_data_tpayway'); 113 | 114 | add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'jal_add_plugin_page_settings_link'); 115 | function jal_add_plugin_page_settings_link($links) 116 | { 117 | $links[] = '' . __('Settings', 'tcom-payway-wc') . ''; 120 | return $links; 121 | } 122 | 123 | if (is_admin()) { 124 | require_once TCOM_PAYWAY_DIR . 'classes/admin/class-payway-wp-list-table.php'; 125 | new Payway_Wp_List_Table(); 126 | } 127 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Woocommerce HT PayWay 2 | 3 | [![build-test](https://github.com/marinsagovac/woocommerce-tcom-payway/actions/workflows/wordpress-plugin-check.yml/badge.svg?branch=master)](https://github.com/marinsagovac/woocommerce-tcom-payway/actions/workflows/wordpress-plugin-check.yml) 4 | 5 | ![Woo](assets/images/banner-1544x500.png) 6 | 7 | --- 8 | **Wordpress Woocommerce plugin** (payment gateway for Croatia) 9 | 10 | Support payment gateway for PayWay HT payment gateway. 11 | 12 | ![PayWay](https://raw.githubusercontent.com/marinsagovac/woocommerce-tcom-payway/master/assets/images/payway-logo.png) 13 | 14 | ## API 15 | 16 | API 2.x.x support updated to latest IntlCurrency and IntAmount 17 | 18 | Official Croatia Hrvatski Telekom [PayWay](https://www.hrvatskitelekom.hr/poslovni/ict/poslovna-rjesenja/web-shop#payway). 19 | 20 | PayWayForm Documentation revision supported: 7.1.10 21 | 22 | ## FEATURES 23 | 24 | Features 25 | * EUR mandatory currency, HRK set as IntAmount from 1.1.2023. 26 | * Added Currency code 978 and sent mandatory as `CurrencyCode` property [ISO 4217 HR](https://www.six-group.com/en/products-services/financial-information/data-standards.html) 27 | * IntlCurrency and IntAmount added 28 | * API 2.0 Support 29 | * Production and testing API 30 | * Added other languages with automation language switching on PayWay form 31 | * PayWay transaction admin page lists 32 | * WPML support conversion rate 33 | * Locale support based on WP locale settings (EN/HR) 34 | * Multilanguage support using po/mo translation 35 | * Replace banner image of PayWay on checkout with smaller 250px width 36 | * Not needle IntAmount and IntCurrency from 1.1.2024. 37 | * Support PHP 8.x 38 | 39 | Removed 40 | * Removed woo-multi-currency support and integration 41 | * Removed T-Com names 42 | * Removed HRK to EUR conversion 43 | 44 | ## RELEASES 45 | 46 | ### OFFICIAL RELEASES 47 | 48 | Latest version: 49 | 50 | * Version [1.8.6](https://github.com/marinsagovac/woocommerce-tcom-payway/releases/tag/1.8.6) December/2024 51 | 52 | API 2.x.x: 53 | 54 | * Version [1.8.6](https://github.com/marinsagovac/woocommerce-tcom-payway/releases/tag/1.8.6) December/2024 55 | * Version [1.8.5](https://github.com/marinsagovac/woocommerce-tcom-payway/releases/tag/1.8.5) November/2024 56 | * Version [1.8.3](https://github.com/marinsagovac/woocommerce-tcom-payway/releases/tag/1.8.3) November/2024 57 | * Version [1.8.1](https://github.com/marinsagovac/woocommerce-tcom-payway/releases/tag/1.8.1) February/2024 58 | * Version [1.7.3](https://github.com/marinsagovac/woocommerce-tcom-payway/archive/refs/tags/1.7.3.zip) January/2023 59 | 60 | Old releases (deprecated): 61 | 62 | * Version [1.7.1](https://github.com/marinsagovac/woocommerce-tcom-payway/archive/refs/tags/1.7.1.zip) January/2023 63 | * Version [1.7](https://github.com/marinsagovac/woocommerce-tcom-payway/archive/refs/tags/1.7.zip) December/2022 64 | * Version [1.6.1](https://github.com/marinsagovac/woocommerce-tcom-payway/archive/refs/tags/1.6.1.zip) September/2022 65 | * Version [1.5](https://github.com/marinsagovac/woocommerce-tcom-payway/releases/tags/1.5.zip) November/2021 66 | * Version [1.4](https://github.com/marinsagovac/woocommerce-tcom-payway/releases/tags/1.4.zip) June/2021 67 | * Version [1.3.3](https://github.com/marinsagovac/woocommerce-tcom-payway/releases/tag/1.3.3) January/2021 68 | * Version [1.3](https://github.com/marinsagovac/woocommerce-tcom-payway/releases/tag/1.3) December/2019 69 | * Release [1.2](https://github.com/marinsagovac/woocommerce-tcom-payway/releases/tag/1.2) 70 | * Release [1.1](https://github.com/marinsagovac/woocommerce-tcom-payway/releases/tag/1.1) 71 | 72 | ## INSTALLATION 73 | 74 | Download ZIP archive, upload via plugin page and apply package. Activate plugin. Change settings under Woocomerce settings page on the checkout page. 75 | 76 | ## CHANGELOG 77 | 78 | Changelog is now moved [here](https://github.com/marinsagovac/woocommerce-tcom-payway/blob/master/CHANGELOG.md). 79 | 80 | ## HELP 81 | 82 | Click here to go to [WIKI Help page](https://github.com/marinsagovac/woocommerce-tcom-payway/wiki/Common-issues-and-helps) for more common mistakes and helps. 83 | 84 | ## CONTRIBUTING 85 | 86 | Thank you for considering contributing and developing features on our repository. 87 | We're continuing to improving, upgrading and fixing our repository using open source directive so specially thanks to contributors. 88 | 89 | ## LICENSE 90 | 91 | A source code is an open-sourced and is under [MIT license](http://opensource.org/licenses/MIT) and is possible to change or improve code. 92 | 93 | ![Security](assets/images/payway.png) 94 | 95 | ## DEPRECATED DOCUMENTATIONS 96 | 97 | Under wiki are screenshots of settings and admin preview of payments: [here](https://github.com/marinsagovac/woocommerce-tcom-payway/wiki/Deprecated-docs) 98 | `docs` folder has been removed from 1.8.7 version. 99 | 100 | ## TIP 101 | 102 | You can buy me a coffe https://ko-fi.com/msagovac. 103 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | email. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /languages/tcom-payway-wc.pot: -------------------------------------------------------------------------------- 1 | #, fuzzy 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: WooCommerce PayWay Hrvatski Telekom\n" 5 | "Report-Msgid-Bugs-To: \n" 6 | "POT-Creation-Date: 2019-11-27 20:52+0000\n" 7 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 | "Last-Translator: FULL NAME \n" 9 | "Language-Team: \n" 10 | "Language: \n" 11 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 12 | "MIME-Version: 1.0\n" 13 | "Content-Type: text/plain; charset=UTF-8\n" 14 | "Content-Transfer-Encoding: 8bit\n" 15 | "X-Generator: Loco https://localise.biz/\n" 16 | "X-Loco-Version: 2.3.1; wp-5.3" 17 | 18 | #: classes/class-wc-tpayway.php:44 classes/class-wc-tpayway.php:51 19 | msgid "Use Woo Multi Currency conversion" 20 | msgstr "" 21 | 22 | #: classes/class-wc-tpayway.php:46 classes/class-wc-tpayway.php:54 23 | msgid "" 24 | "Enable currency auto conversion for Woo Multi Currency plugin. Make sure " 26 | "that is checked \"Allow Multi Currency\" in plugin page." 27 | msgstr "" 28 | 29 | #: classes/class-wc-tpayway.php:61 30 | msgid "Enable/Disable" 31 | msgstr "" 32 | 33 | #: classes/class-wc-tpayway.php:63 34 | msgid "Enable PayWay Hrvatski Telekom Module." 35 | msgstr "" 36 | 37 | #: classes/class-wc-tpayway.php:67 38 | msgid "Title:" 39 | msgstr "" 40 | 41 | #: classes/class-wc-tpayway.php:69 42 | msgid "This controls the title which the user sees during checkout." 43 | msgstr "" 44 | 45 | #: classes/class-wc-tpayway.php:70 46 | msgid "PayWay Hrvatski Telekom" 47 | msgstr "" 48 | 49 | #: classes/class-wc-tpayway.php:73 50 | msgid "Description:" 51 | msgstr "" 52 | 53 | #: classes/class-wc-tpayway.php:75 54 | msgid "This controls the description which the user sees during checkout." 55 | msgstr "" 56 | 57 | #: classes/class-wc-tpayway.php:76 58 | msgid "" 59 | "Payway Hrvatski Telekom is secure payment gateway in Croatia and you can pay using this " 60 | "payment in other currency." 61 | msgstr "" 62 | 63 | #: classes/class-wc-tpayway.php:79 64 | msgid "Authorize URL:" 65 | msgstr "" 66 | 67 | #: classes/class-wc-tpayway.php:81 68 | msgid "PayWay Hrvatski Telekom data submitting to this URL. Use Prod Mode to live set." 69 | msgstr "" 70 | 71 | #: classes/class-wc-tpayway.php:82 72 | msgid "https://pgw.ht.hr/services/payment/api/authorize-form" 73 | msgstr "" 74 | 75 | #: classes/class-wc-tpayway.php:85 76 | msgid "Shop ID:" 77 | msgstr "" 78 | 79 | #: classes/class-wc-tpayway.php:87 80 | msgid "Unique id for the merchant acc, given by bank." 81 | msgstr "" 82 | 83 | #: classes/class-wc-tpayway.php:91 84 | msgid "Secret Key:" 85 | msgstr "" 86 | 87 | #: classes/class-wc-tpayway.php:97 88 | msgid "Response URL success" 89 | msgstr "" 90 | 91 | #: classes/class-wc-tpayway.php:103 92 | msgid "Response URL fail:" 93 | msgstr "" 94 | 95 | #: classes/class-wc-tpayway.php:109 96 | msgid "Message redirect:" 97 | msgstr "" 98 | 99 | #: classes/class-wc-tpayway.php:111 100 | msgid "Message to client when redirecting to PayWay page" 101 | msgstr "" 102 | 103 | #. Description of the plugin 104 | #: classes/class-wc-tpayway.php:119 105 | msgid "PayWay Hrvatski Telekom payment gateway" 106 | msgstr "" 107 | 108 | #: classes/class-wc-tpayway.php:120 109 | msgid "" 110 | "PayWay Hrvatski Telekom is " 111 | "payment gateway from telecom Hrvatski Telekom who provides payment gateway services as " 112 | "dedicated services to clients in Croatia." 113 | msgstr "" 114 | 115 | #: classes/class-wc-tpayway.php:318 116 | msgid "Pay via PayWay" 117 | msgstr "" 118 | 119 | #: classes/class-wc-tpayway.php:319 120 | msgid "Cancel order & restore cart" 121 | msgstr "" 122 | 123 | #: classes/class-wc-tpayway.php:340 124 | msgid "Action successful" 125 | msgstr "" 126 | 127 | #: classes/class-wc-tpayway.php:341 128 | msgid "Action unsuccessful" 129 | msgstr "" 130 | 131 | #: classes/class-wc-tpayway.php:342 132 | msgid "Error processing" 133 | msgstr "" 134 | 135 | #: classes/class-wc-tpayway.php:343 136 | msgid "Action cancelled" 137 | msgstr "" 138 | 139 | #: classes/class-wc-tpayway.php:344 140 | msgid "Action unsuccessful (3D Secure MPI)" 141 | msgstr "" 142 | 143 | #: classes/class-wc-tpayway.php:345 144 | msgid "Incorrect signature (pwg_signature)" 145 | msgstr "" 146 | 147 | #: classes/class-wc-tpayway.php:346 148 | msgid "Incorrect store ID (pgw_shop_id)" 149 | msgstr "" 150 | 151 | #: classes/class-wc-tpayway.php:347 152 | msgid "Incorrect transaction ID (pgw_transaction_id)" 153 | msgstr "" 154 | 155 | #: classes/class-wc-tpayway.php:348 156 | msgid "Incorrect amount (pgw_amount)" 157 | msgstr "" 158 | 159 | #: classes/class-wc-tpayway.php:349 160 | msgid "Incorrect authorization_type (pgw_authorization_type)" 161 | msgstr "" 162 | 163 | #: classes/class-wc-tpayway.php:350 164 | msgid "Incorrect announcement duration (pgw_announcement_duration)" 165 | msgstr "" 166 | 167 | #: classes/class-wc-tpayway.php:351 168 | msgid "Incorrect installments number (pgw_installments)" 169 | msgstr "" 170 | 171 | #: classes/class-wc-tpayway.php:352 172 | msgid "Incorrect language (pgw_language)" 173 | msgstr "" 174 | 175 | #: classes/class-wc-tpayway.php:353 176 | msgid "Incorrect authorization token (pgw_authorization_token)" 177 | msgstr "" 178 | 179 | #: classes/class-wc-tpayway.php:354 180 | msgid "Incorrect card number (pgw_card_number)" 181 | msgstr "" 182 | 183 | #: classes/class-wc-tpayway.php:355 184 | msgid "Incorrect card expiration date (pgw_card_expiration_date)" 185 | msgstr "" 186 | 187 | #: classes/class-wc-tpayway.php:356 188 | msgid "Incorrect card verification data (pgw_card_verification_data)" 189 | msgstr "" 190 | 191 | #: classes/class-wc-tpayway.php:357 192 | msgid "Incorrect order ID (pgw_order_id)" 193 | msgstr "" 194 | 195 | #: classes/class-wc-tpayway.php:358 196 | msgid "Incorrect order info (pgw_order_info)" 197 | msgstr "" 198 | 199 | #: classes/class-wc-tpayway.php:359 200 | msgid "Incorrect order items (pgw_order_items)" 201 | msgstr "" 202 | 203 | #: classes/class-wc-tpayway.php:360 204 | msgid "Incorrect return method (pgw_return_method)" 205 | msgstr "" 206 | 207 | #: classes/class-wc-tpayway.php:361 208 | msgid "Incorrect success store url (pgw_success_url)" 209 | msgstr "" 210 | 211 | #: classes/class-wc-tpayway.php:362 212 | msgid "Incorrect error store url (pgw_failure_url)" 213 | msgstr "" 214 | 215 | #: classes/class-wc-tpayway.php:363 216 | msgid "Incorrect merchant data (pgw_merchant_data)" 217 | msgstr "" 218 | 219 | #: classes/class-wc-tpayway.php:364 220 | msgid "Incorrect buyer's name (pgw_first_name)" 221 | msgstr "" 222 | 223 | #: classes/class-wc-tpayway.php:365 224 | msgid "Incorrect buyer's last name (pgw_last_name)" 225 | msgstr "" 226 | 227 | #: classes/class-wc-tpayway.php:366 228 | msgid "Incorrect address (pgw_street)" 229 | msgstr "" 230 | 231 | #: classes/class-wc-tpayway.php:367 232 | msgid "Incorrect city (pgw_city)" 233 | msgstr "" 234 | 235 | #: classes/class-wc-tpayway.php:368 236 | msgid "Incorrect ZIP code (pgw_post_code)" 237 | msgstr "" 238 | 239 | #: classes/class-wc-tpayway.php:369 240 | msgid "Incorrect country (pgw_country)" 241 | msgstr "" 242 | 243 | #: classes/class-wc-tpayway.php:370 244 | msgid "Incorrect contact phone (pgw_telephone)" 245 | msgstr "" 246 | 247 | #: classes/class-wc-tpayway.php:371 248 | msgid "Incorrect contact e-mail address (pgw_email)" 249 | msgstr "" 250 | 251 | #: classes/class-wc-tpayway.php:404 252 | msgid "PayWay Hrvatski Telekom payment successful. Unique Id: " 253 | msgstr "" 254 | 255 | #: classes/class-wc-tpayway.php:409 256 | msgid "Awaiting payment" 257 | msgstr "" 258 | 259 | #: classes/class-wc-tpayway.php:416 260 | msgid "Payment successful" 261 | msgstr "" 262 | 263 | #: classes/class-wc-tpayway.php:418 264 | msgid "" 265 | "Payment on PayWay Hrvatski Telekom is successfully completeted and order status is " 266 | "processed." 267 | msgstr "" 268 | 269 | #: classes/class-wc-tpayway.php:425 270 | #, php-format 271 | msgid "Payment for order no. %s was sucessful." 272 | msgstr "" 273 | 274 | #: classes/class-wc-tpayway.php:466 275 | msgid "A payment was not successfull or declined" 276 | msgstr "" 277 | 278 | #: classes/class-wc-tpayway.php:467 279 | msgid "Reason: " 280 | msgstr "" 281 | 282 | #: classes/class-wc-tpayway.php:469 283 | msgid "Order Id: " 284 | msgstr "" 285 | 286 | #: classes/class-wc-tpayway.php:471 287 | msgid "Redirecting..." 288 | msgstr "" 289 | 290 | #. Name of the plugin 291 | msgid "WooCommerce PayWay Hrvatski Telekom" 292 | msgstr "" 293 | 294 | #. URI of the plugin 295 | msgid "https://github.com/marinsagovac/woocommerce-tcom-payway" 296 | msgstr "" 297 | 298 | #. Author of the plugin 299 | msgid "Marin Sagovac (Marin Šagovac)" 300 | msgstr "" 301 | -------------------------------------------------------------------------------- /languages/tcom-payway-wc-hr.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: WooCommerce Hrvatski Telekom PayWay\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2019-11-27 20:52+0000\n" 6 | "PO-Revision-Date: 2019-11-27 21:17+0000\n" 7 | "Last-Translator: Haddad.hr Admin \n" 8 | "Language-Team: Hrvatski\n" 9 | "Language: hr\n" 10 | "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10 >= 2 && " 11 | "n%10<=4 &&(n%100<10||n%100 >= 20)? 1 : 2;\n" 12 | "MIME-Version: 1.0\n" 13 | "Content-Type: text/plain; charset=UTF-8\n" 14 | "Content-Transfer-Encoding: 8bit\n" 15 | "X-Generator: Loco https://localise.biz/\n" 16 | "X-Loco-Version: 2.3.1; wp-5.3" 17 | 18 | #: classes/class-wc-tpayway.php:44 classes/class-wc-tpayway.php:51 19 | msgid "Use Woo Multi Currency conversion" 20 | msgstr "Koristi Woo Multi Currency konverziju " 21 | 22 | #: classes/class-wc-tpayway.php:46 classes/class-wc-tpayway.php:54 23 | msgid "" 24 | "Enable currency auto conversion for Woo Multi Currency plugin. Make sure " 26 | "that is checked \"Allow Multi Currency\" in plugin page." 27 | msgstr "" 28 | "Omogućiti autokonverziju za dodatak \"Woo Multi Currency\". Provjerite je " 30 | "li \"Dozvoliti viševalutnost\" označena na stranici dodatka" 31 | 32 | #: classes/class-wc-tpayway.php:61 33 | msgid "Enable/Disable" 34 | msgstr "Omogući/Onemogući" 35 | 36 | #: classes/class-wc-tpayway.php:63 37 | msgid "Enable Hrvatski Telekom PayWay Module." 38 | msgstr "Omogući Hrvatski Telekom PayWay modul." 39 | 40 | #: classes/class-wc-tpayway.php:67 41 | msgid "Title:" 42 | msgstr "Naslov:" 43 | 44 | #: classes/class-wc-tpayway.php:69 45 | msgid "This controls the title which the user sees during checkout." 46 | msgstr "Ovo kontrolira naslov koji će kupac koristi prilikom procesa naplate." 47 | 48 | #: classes/class-wc-tpayway.php:70 49 | msgid "Hrvatski Telekom PayWay" 50 | msgstr "Hrvatski Telekom PayWay" 51 | 52 | #: classes/class-wc-tpayway.php:73 53 | msgid "Description:" 54 | msgstr "Opis:" 55 | 56 | #: classes/class-wc-tpayway.php:75 57 | msgid "This controls the description which the user sees during checkout." 58 | msgstr "Ovo kontrolira opis koji će kupac koristiti prilikom procesa naplate." 59 | 60 | #: classes/class-wc-tpayway.php:76 61 | msgid "" 62 | "Payway Hrvatski Telekom is secure payment gateway in Croatia and you can pay using this " 63 | "payment in other currency." 64 | msgstr "" 65 | "PayWay Hrvatski Telekom je siguran pristupnik plaćanja u Hrvatskoj u kojem se može " 66 | "izvršiti plaćanja i u drugim valutama." 67 | 68 | #: classes/class-wc-tpayway.php:79 69 | msgid "Authorize URL:" 70 | msgstr "URL adresa autorizacije" 71 | 72 | #: classes/class-wc-tpayway.php:81 73 | msgid "PayWay Hrvatski Telekom data submiting to this URL" 74 | msgstr "Podaci PayWay Hrvatski Telekom poslani na ovaj URL" 75 | 76 | #: classes/class-wc-tpayway.php:82 77 | msgid "https://pgw.ht.hr/services/payment/api/authorize-form" 78 | msgstr "https://pgw.ht.hr/services/payment/api/authorize-form" 79 | 80 | #: classes/class-wc-tpayway.php:85 81 | msgid "Shop ID:" 82 | msgstr "ID broj trgovine:" 83 | 84 | #: classes/class-wc-tpayway.php:87 85 | msgid "Unique id for the merchant acc, given by bank." 86 | msgstr "Jedinstveni ID za račun trgovca koji omogućava banka." 87 | 88 | #: classes/class-wc-tpayway.php:91 89 | msgid "Secret Key:" 90 | msgstr "Tajni ključ:" 91 | 92 | #: classes/class-wc-tpayway.php:97 93 | msgid "Response URL success" 94 | msgstr "URL adresa za uspješnu transakciju" 95 | 96 | #: classes/class-wc-tpayway.php:103 97 | msgid "Response URL fail:" 98 | msgstr "URL adresa za neuspješnu transakciju" 99 | 100 | #: classes/class-wc-tpayway.php:109 101 | msgid "Message redirect:" 102 | msgstr "Poruka za redirekciju:" 103 | 104 | #: classes/class-wc-tpayway.php:111 105 | msgid "Message to client when redirecting to PayWay page" 106 | msgstr "Poruka kupcu kod redirekcije na stranicu PayWay" 107 | 108 | #. Description of the plugin 109 | #: classes/class-wc-tpayway.php:119 110 | msgid "PayWay Hrvatski Telekom payment gateway" 111 | msgstr "PayWay Hrvatski Telekom pristupnik plaćanja" 112 | 113 | #: classes/class-wc-tpayway.php:120 114 | msgid "" 115 | "PayWay Hrvatski Telekom is " 116 | "payment gateway from telecom Hrvatski Telekom who provides payment gateway services as " 117 | "dedicated services to clients in Croatia." 118 | msgstr "" 119 | "PayWay Hrvatski Telekom je " 120 | "pristupnik plaćanja Hrvatski Telekom koji omogućava usluge proces naplate kao " 121 | "dedicated usluge klijentima u Hrvatskoj." 122 | 123 | #: classes/class-wc-tpayway.php:318 124 | msgid "Pay via PayWay" 125 | msgstr "Plati putem PayWaya" 126 | 127 | #: classes/class-wc-tpayway.php:319 128 | msgid "Cancel order & restore cart" 129 | msgstr "Otkazivanje narudžbe i vraćanje na košaricu" 130 | 131 | #: classes/class-wc-tpayway.php:340 132 | msgid "Action successful" 133 | msgstr "Akcija uspješna" 134 | 135 | #: classes/class-wc-tpayway.php:341 136 | msgid "Action unsuccessful" 137 | msgstr "Akcija neuspješna" 138 | 139 | #: classes/class-wc-tpayway.php:342 140 | msgid "Error processing" 141 | msgstr "Greška u procesiranju" 142 | 143 | #: classes/class-wc-tpayway.php:343 144 | msgid "Action cancelled" 145 | msgstr "Akcija je otkazana" 146 | 147 | #: classes/class-wc-tpayway.php:344 148 | msgid "Action unsuccessful (3D Secure MPI)" 149 | msgstr "Akcija neuspješna (3D Secure MPI)" 150 | 151 | #: classes/class-wc-tpayway.php:345 152 | msgid "Incorrect signature (pwg_signature)" 153 | msgstr "Neispravan potpis (pwg_signature)" 154 | 155 | #: classes/class-wc-tpayway.php:346 156 | msgid "Incorrect store ID (pgw_shop_id)" 157 | msgstr "Neispravan ID trgovine (pgw_shop_id)" 158 | 159 | #: classes/class-wc-tpayway.php:347 160 | msgid "Incorrect transaction ID (pgw_transaction_id)" 161 | msgstr "Neispravan ID transakcije (pgw_transaction_id)" 162 | 163 | #: classes/class-wc-tpayway.php:348 164 | msgid "Incorrect amount (pgw_amount)" 165 | msgstr "Neispavan iznos (pgw_amount)" 166 | 167 | #: classes/class-wc-tpayway.php:349 168 | msgid "Incorrect authorization_type (pgw_authorization_type)" 169 | msgstr "Neispravna vrsta autorizacije (pgw_authorization_type)" 170 | 171 | #: classes/class-wc-tpayway.php:350 172 | msgid "Incorrect announcement duration (pgw_announcement_duration)" 173 | msgstr "Neispravno trajanje najave (pgw_announcement_duration)" 174 | 175 | #: classes/class-wc-tpayway.php:351 176 | msgid "Incorrect installments number (pgw_installments)" 177 | msgstr "Neispravan broj rata (pgw_installments)" 178 | 179 | #: classes/class-wc-tpayway.php:352 180 | msgid "Incorrect language (pgw_language)" 181 | msgstr "Neispravan jezik (pgw_language)" 182 | 183 | #: classes/class-wc-tpayway.php:353 184 | msgid "Incorrect authorization token (pgw_authorization_token)" 185 | msgstr "Neispravan autorizacijski kod (pgw_authorization_token)" 186 | 187 | #: classes/class-wc-tpayway.php:354 188 | msgid "Incorrect card number (pgw_card_number)" 189 | msgstr "Neispravan broj kartice (pgw_card_number)" 190 | 191 | #: classes/class-wc-tpayway.php:355 192 | msgid "Incorrect card expiration date (pgw_card_expiration_date)" 193 | msgstr "Neispravan datum isteka kartice (pgw_card_expiration_date)" 194 | 195 | #: classes/class-wc-tpayway.php:356 196 | msgid "Incorrect card verification data (pgw_card_verification_data)" 197 | msgstr "Neispravni podaci verifikacije kartice (pgw_card_verification_data)" 198 | 199 | #: classes/class-wc-tpayway.php:357 200 | msgid "Incorrect order ID (pgw_order_id)" 201 | msgstr "Neispravan broj narudžbe (pgw_order_id)" 202 | 203 | #: classes/class-wc-tpayway.php:358 204 | msgid "Incorrect order info (pgw_order_info)" 205 | msgstr "Neispravan info narudžbe (pgw_order_info)" 206 | 207 | #: classes/class-wc-tpayway.php:359 208 | msgid "Incorrect order items (pgw_order_items)" 209 | msgstr "Neispravni artikli narudžbe (pgw_order_items)" 210 | 211 | #: classes/class-wc-tpayway.php:360 212 | msgid "Incorrect return method (pgw_return_method)" 213 | msgstr "Neispravna povratna metoda (pgw_return_method)" 214 | 215 | #: classes/class-wc-tpayway.php:361 216 | msgid "Incorrect success store url (pgw_success_url)" 217 | msgstr "Neispravna URL adresa povratka na trgovinu (pgw_success_url)" 218 | 219 | #: classes/class-wc-tpayway.php:362 220 | msgid "Incorrect error store url (pgw_failure_url)" 221 | msgstr "Neispravna URL adresa trgovine za grešku (pgw_failure_url)" 222 | 223 | #: classes/class-wc-tpayway.php:363 224 | msgid "Incorrect merchant data (pgw_merchant_data)" 225 | msgstr "Neispravni podaci trgovca (pgw_merchant_data)" 226 | 227 | #: classes/class-wc-tpayway.php:364 228 | msgid "Incorrect buyer's name (pgw_first_name)" 229 | msgstr "Neispravno ime kupca (pgw_first_name)" 230 | 231 | #: classes/class-wc-tpayway.php:365 232 | msgid "Incorrect buyer's last name (pgw_last_name)" 233 | msgstr "Neispravno prezime (pgw_last_name)" 234 | 235 | #: classes/class-wc-tpayway.php:366 236 | msgid "Incorrect address (pgw_street)" 237 | msgstr "Neispravna adresa (pgw_street)" 238 | 239 | #: classes/class-wc-tpayway.php:367 240 | msgid "Incorrect city (pgw_city)" 241 | msgstr "Neispravan grad (pgw_city)" 242 | 243 | #: classes/class-wc-tpayway.php:368 244 | msgid "Incorrect ZIP code (pgw_post_code)" 245 | msgstr "Neispravan poštanski broj (pgw_post_code)" 246 | 247 | #: classes/class-wc-tpayway.php:369 248 | msgid "Incorrect country (pgw_country)" 249 | msgstr "Neispravna zemlja (pgw_country)" 250 | 251 | #: classes/class-wc-tpayway.php:370 252 | msgid "Incorrect contact phone (pgw_telephone)" 253 | msgstr "Neispravni kontakt telefon (pgw_telephone)" 254 | 255 | #: classes/class-wc-tpayway.php:371 256 | msgid "Incorrect contact e-mail address (pgw_email)" 257 | msgstr "Neispravna e-mail adresa (pgw_email)" 258 | 259 | #: classes/class-wc-tpayway.php:404 260 | msgid "PayWay Hrvatski Telekom payment successful. Unique Id: " 261 | msgstr "PayWay Hrvatski Telekom plaćanje uspješno. Jedinstveni ID:" 262 | 263 | #: classes/class-wc-tpayway.php:409 264 | msgid "Awaiting payment" 265 | msgstr "Čekanje plaćanja" 266 | 267 | #: classes/class-wc-tpayway.php:416 268 | msgid "Payment successful" 269 | msgstr "Plaćanje uspješno" 270 | 271 | #: classes/class-wc-tpayway.php:418 272 | msgid "" 273 | "Payment on PayWay Hrvatski Telekom is successfully completeted and order status is " 274 | "processed." 275 | msgstr "" 276 | "Plaćanje na PayWayu Hrvatski Telekom je uspješno završeno i status narudžbe je " 277 | "procesiran." 278 | 279 | #: classes/class-wc-tpayway.php:425 280 | #, php-format 281 | msgid "Payment for order no. %s was sucessful." 282 | msgstr "Plaćanje za narudžbu broj %s je bilo uspješno." 283 | 284 | #: classes/class-wc-tpayway.php:466 285 | msgid "A payment was not successfull or declined" 286 | msgstr "Plaćanje nije uspjelo ili je odbijeno" 287 | 288 | #: classes/class-wc-tpayway.php:467 289 | msgid "Reason: " 290 | msgstr "Razlog:" 291 | 292 | #: classes/class-wc-tpayway.php:469 293 | msgid "Order Id: " 294 | msgstr "Broj narudžbe:" 295 | 296 | #: classes/class-wc-tpayway.php:471 297 | msgid "Redirecting..." 298 | msgstr "Preusmjeravanje ..." 299 | 300 | #. Name of the plugin 301 | msgid "WooCommerce PayWay Hrvatski Telekom" 302 | msgstr "WooCommerce PayWay Hrvatski Telekom" 303 | 304 | #. URI of the plugin 305 | msgid "https://github.com/marinsagovac/woocommerce-tcom-payway" 306 | msgstr "https://github.com/marinsagovac/woocommerce-tcom-payway" 307 | 308 | #. Author of the plugin 309 | msgid "Marin Sagovac (Marin Šagovac)" 310 | msgstr "Marin Sagovac (Marin Šagovac)" 311 | -------------------------------------------------------------------------------- /classes/class-wc-tpayway.php: -------------------------------------------------------------------------------- 1 | id = 'WC_TPAYWAY'; 36 | $this->domain = 'tcom-payway-wc'; 37 | $this->icon = apply_filters('woocommerce_payway_icon', TCOM_PAYWAY_URL . 'assets/images/payway.png'); 38 | $this->method_title = 'PayWay Hrvatski Telekom Woocommerce Payment Gateway'; 39 | $this->has_fields = false; 40 | 41 | $this->curlExtension = extension_loaded('curl'); 42 | 43 | $this->ratehrkfixed = 7.53450; 44 | $this->tecajnaHnbApi = "https://api.hnb.hr/tecajn-eur/v3"; 45 | 46 | $this->api_version = '2.0'; 47 | 48 | $this->init_form_fields(); 49 | $this->init_settings(); 50 | 51 | $settings = $this->settings; 52 | 53 | $this->title = isset($settings['title']) ? $settings['title'] : ''; 54 | $this->shop_id = isset($settings['mer_id']) ? $settings['mer_id'] : ''; 55 | $this->acq_id = isset($settings['acq_id']) ? $settings['acq_id'] : ''; 56 | $this->pg_domain = $this->get_option('pg_domain'); 57 | $this->checkout_msg = isset($settings['checkout_msg']) ? $settings['checkout_msg'] : ''; 58 | $this->description = isset($settings['description']) ? $settings['description'] : ''; 59 | 60 | $this->msg['message'] = ''; 61 | $this->msg['class'] = ''; 62 | 63 | add_action('init', array(&$this, 'check_tcompayway_response')); 64 | 65 | // Hook to load textdomain during 'init' 66 | add_action('init', array($this, 'load_textdomain')); 67 | 68 | if (version_compare(WOOCOMMERCE_VERSION, '2.0.0', '>=')) { 69 | add_action('woocommerce_update_options_payment_gateways_' . $this->id, array(&$this, 'process_admin_options')); 70 | } else { 71 | add_action('woocommerce_update_options_payment_gateways', array(&$this, 'process_admin_options')); 72 | } 73 | add_action('woocommerce_receipt_WC_TPAYWAY', array(&$this, 'receipt_page')); 74 | 75 | $this->update_hnb_currency(); 76 | } 77 | 78 | /** 79 | * Load plugin textdomain. 80 | */ 81 | public function load_textdomain() 82 | { 83 | load_plugin_textdomain( 84 | 'tcom-payway-wc', // Textdomain 85 | false, // Deprecated argument, set to false 86 | dirname(plugin_basename(__FILE__)) . '/languages/' // Path to language files 87 | ); 88 | } 89 | 90 | 91 | function init_form_fields() 92 | { 93 | include_once(ABSPATH . 'wp-admin/includes/plugin.php'); 94 | 95 | $this->form_fields = array( 96 | 'enabled' => array( 97 | 'title' => __('Enable/Disable', $this->domain), 98 | 'type' => 'checkbox', 99 | 'label' => __('Enable PayWay Hrvatski Telekom Module.', 'tcom-payway-wc'), 100 | 'default' => 'no', 101 | ), 102 | 'title' => array( 103 | 'title' => __('Title:', $this->domain), 104 | 'type' => 'text', 105 | 'description' => __('This controls the title which the user sees during checkout.', 'tcom-payway-wc'), 106 | 'default' => __('PayWay Hrvatski Telekom', 'tcom-payway-wc'), 107 | ), 108 | 'description' => array( 109 | 'title' => __('Description:', $this->domain), 110 | 'type' => 'textarea', 111 | 'description' => __('This controls the description which the user sees during checkout.', 'tcom-payway-wc'), 112 | 'default' => __('Payway Hrvatski Telekom is a secure payment gateway in Croatia and you can pay using this payment in other currencies.', 'tcom-payway-wc'), 113 | ), 114 | 'pg_domain' => array( 115 | 'title' => __('Authorize URL', $this->domain), 116 | 'type' => 'select', 117 | 'class' => 'wc-enhanced-select', 118 | 'description' => __('PayWay Hrvatski Telekom data submitting to this URL. Use Prod Mode to live set.', $this->domain), 119 | 'default' => 'prod', 120 | 'desc_tip' => true, 121 | 'options' => array( 122 | 'test' => __('Test Mode', 'woocommerce'), 123 | 'prod' => __('Prod Mode', 'woocommerce'), 124 | ), 125 | ), 126 | 'mer_id' => array( 127 | 'title' => __('Shop ID:', $this->domain), 128 | 'type' => 'text', 129 | 'description' => __('ShopID represents a unique identification of the web shop. ShopID is received from PayWay after signing the request for using PayWay service.', 'tcom-payway-wc'), 130 | 'default' => '', 131 | ), 132 | 'acq_id' => array( 133 | 'title' => __('Secret Key:', $this->domain), 134 | 'type' => 'password', 135 | 'description' => '', 136 | 'default' => '', 137 | ), 138 | 'checkout_msg' => array( 139 | 'title' => __('Message redirect:', $this->domain), 140 | 'type' => 'textarea', 141 | 'description' => __('Message to client when redirecting to PayWay page', 'tcom-payway-wc'), 142 | 'default' => 'Nakon potvrde biti ćete preusmjereni na plaćanje.', 143 | ), 144 | ); 145 | } 146 | 147 | 148 | public function admin_options() 149 | { 150 | $hnbRatesUri = "tecajnaHnbApi) . "\">HNB rates"; 151 | 152 | echo '

' . __('PayWay Hrvatski Telekom payment gateway', 'tcom-payway-wc') . '

'; 153 | echo '

' . __('PayWay Hrvatski Telekom is a payment gateway from Hrvatski Telekom that provides payment gateway services as dedicated services to clients in Croatia.', 'tcom-payway-wc') . '

'; 154 | echo ''; 155 | $this->generate_settings_html(); 156 | echo '
'; 157 | echo '

'; 158 | echo '

' . __('HNB rates fetched: ', 'tcom-payway-wc') . $this->get_last_modified_hnb_file() . '

'; 159 | echo '

' . esc_html__( 'Preferred currency will be EUR. Make sure that the default currency on your webshop is set to EUR.', 'tcom-payway-wc' ) . '

'; 160 | echo '

' . __('Other currencies will be automatically calculated and sent to PayWay using HNB rates: USD (WordPress) to HRK (PayWay) using ', 'tcom-payway-wc') . $hnbRatesUri . '

'; 161 | echo '

'; 162 | } 163 | 164 | function payment_fields() 165 | { 166 | if ($this->description) { 167 | echo wpautop(wptexturize($this->description)); 168 | } 169 | } 170 | 171 | function receipt_page($order) 172 | { 173 | echo $this->generate_ipg_form($order); 174 | echo '
' . esc_html($this->checkout_msg) . ''; 175 | } 176 | 177 | private function get_hnb_currency() 178 | { 179 | if (!$this->curlExtension) { 180 | return "CURL extension is missing. Conversion is disabled."; 181 | } 182 | 183 | $ch = curl_init(); 184 | 185 | curl_setopt($ch, CURLOPT_URL, $this->tecajnaHnbApi); 186 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 187 | curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0'); 188 | 189 | $content = curl_exec($ch); 190 | if (curl_errno($ch)) { 191 | // Handle error if necessary 192 | } 193 | curl_close($ch); 194 | 195 | return $content; 196 | } 197 | 198 | /** 199 | * 200 | * Store HNB JSON locally 201 | * 202 | * Save HNB currency JSON not older than 7 days 203 | * 204 | * @return void 205 | */ 206 | private function update_hnb_currency() 207 | { 208 | $file = __DIR__ . '/tecajnv2.json'; 209 | 210 | if (!file_exists($file)) { 211 | file_put_contents($file, $this->get_hnb_currency()); 212 | } else { 213 | clearstatcache(); 214 | if (filesize($file)) { 215 | // If file is older than a day 216 | if (time() - filemtime($file) > (24 * 3600)) { 217 | file_put_contents($file, $this->get_hnb_currency()); 218 | } 219 | } 220 | } 221 | } 222 | 223 | private function get_last_modified_hnb_file() 224 | { 225 | $file = __DIR__ . '/tecajnv2.json'; 226 | 227 | if (!$this->curlExtension) { 228 | return "HNB conversion is disabled due to missing CURL extension."; 229 | } 230 | 231 | if (file_exists($file)) { 232 | return date("d.m.Y H:i:s", filemtime($file)); 233 | } 234 | 235 | return "HNB rates are not fetched from server."; 236 | } 237 | 238 | /** 239 | * Retrieve by currency conversion rate 240 | * 241 | * @return float|string 242 | */ 243 | private function fetch_hnb_currency($currency) 244 | { 245 | $file = __DIR__ . '/tecajnv2.json'; 246 | $filecontents = file_get_contents($file); 247 | 248 | $jsonFile = json_decode($filecontents, true); 249 | 250 | foreach ($jsonFile as $val) { 251 | if ($val['valuta'] === $currency) { 252 | return floatval(str_replace(",", ".", $val['srednji_tecaj'])); 253 | } 254 | } 255 | 256 | return 1; 257 | } 258 | 259 | public function generate_ipg_form($order_id) 260 | { 261 | global $wpdb; 262 | 263 | $order = wc_get_order($order_id); 264 | // $productinfo = "Order $order_id"; 265 | 266 | $currency_symbol = get_woocommerce_currency(); 267 | $order_total = $order->get_total(); 268 | 269 | $table_name = $wpdb->prefix . 'tpayway_ipg'; 270 | $check_order = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $table_name WHERE transaction_id = %s", $order_id)); 271 | if ($check_order > 0) { 272 | $wpdb->update( 273 | $table_name, 274 | array( 275 | 'response_code' => '', 276 | 'response_code_desc' => '', 277 | 'reason_code' => '', 278 | 'amount' => $order_total, 279 | 'or_date' => date('Y-m-d'), 280 | 'status' => 0, 281 | ), 282 | array('transaction_id' => $order_id), 283 | array('%s', '%s'), 284 | array('%s') 285 | ); 286 | } else { 287 | $wpdb->insert( 288 | $table_name, 289 | array( 290 | 'transaction_id' => $order_id, 291 | 'response_code' => '', 292 | 'response_code_desc' => '', 293 | 'reason_code' => '', 294 | 'amount' => $order_total, 295 | 'or_date' => date('Y-m-d'), 296 | 'status' => '', 297 | ), 298 | array('%s', '%s', '%s', '%s', '%f', '%s', '%s') 299 | ); 300 | } 301 | 302 | // Determine language based on customer country 303 | $pgw_language = $this->determine_language($order->get_billing_country()); 304 | $pgw_language = strtoupper($pgw_language); 305 | 306 | // Handle currency conversion if necessary 307 | $wcml_settings = get_option('_wcml_settings'); // WooCommerce Multilingual - Multi Currency (WPML plugin) 308 | 309 | if (!$wcml_settings) { 310 | if ($currency_symbol === "EUR") { 311 | $order_total = $order->get_total(); 312 | } else { 313 | if ($this->curlExtension) { 314 | $order_total = $order->get_total() * $this->fetch_hnb_currency($currency_symbol); 315 | } 316 | } 317 | } else { 318 | $order_total = $order->get_total(); 319 | } 320 | 321 | $order_format_value = str_pad(($order_total * 100), 12, '0', STR_PAD_LEFT); 322 | $total_amount = number_format($order_total, 2, '', ''); 323 | $total_amount_request = number_format($order_total, 2, ',', ''); 324 | 325 | $secret_key = $this->acq_id; // Secret key 326 | $pgw_shop_id = $this->shop_id; 327 | $pgw_order_id = $order_id; 328 | $pgw_amount = $total_amount; 329 | 330 | $pgw_first_name = $order->get_billing_first_name(); 331 | $pgw_last_name = $order->get_billing_last_name(); 332 | $pgw_street = $order->get_billing_address_1() . ', ' . $order->get_billing_address_2(); 333 | $pgw_city = $order->get_billing_city(); 334 | $pgw_post_code = $order->get_billing_postcode(); 335 | $pgw_country = $order->get_billing_country(); 336 | $pgw_telephone = $order->get_billing_phone(); 337 | $pgw_email = $order->get_billing_email(); 338 | 339 | $pgw_signature = hash('sha512', $pgw_shop_id . $secret_key . $pgw_order_id . $secret_key . $pgw_amount . $secret_key); 340 | 341 | $form_args = array( 342 | // Mandatory fields 343 | 'ShopID' => $pgw_shop_id, 344 | 'ShoppingCartID' => $pgw_order_id, 345 | 'Version' => $this->api_version, 346 | 'TotalAmount' => $total_amount_request, 347 | 'ReturnURL' => $this->get_return_url($order), 348 | 'ReturnErrorURL' => $order->get_cancel_order_url(), 349 | 'CancelURL' => $order->get_cancel_order_url(), 350 | 'Signature' => $pgw_signature, 351 | 352 | // Optional fields 353 | 'Lang' => $pgw_language, 354 | 355 | 'CustomerFirstName' => substr($pgw_first_name, 0, 50), 356 | 'CustomerLastName' => substr($pgw_last_name, 0, 50), 357 | 'CustomerAddress' => substr($pgw_street, 0, 100), 358 | 'CustomerCity' => substr($pgw_city, 0, 50), 359 | 'CustomerZIP' => substr($pgw_post_code, 0, 20), 360 | 'CustomerCountry' => $pgw_country, 361 | 'CustomerEmail' => substr($pgw_email, 0, 254), 362 | 'CustomerPhone' => substr($pgw_telephone, 0, 20), 363 | 'ReturnMethod' => 'POST', 364 | 365 | 'acq_id' => $this->acq_id, // Secret key 366 | 'PurchaseAmt' => $order_format_value, 367 | 368 | // ISO 4217 369 | 'CurrencyCode' => 978 370 | ); 371 | 372 | $form_args_array = array(); 373 | foreach ($form_args as $key => $value) { 374 | $form_args_array[] = ""; 375 | } 376 | 377 | $pgDomain = 'https://form.payway.com.hr/authorization.aspx'; 378 | if ($this->pg_domain === 'test') { 379 | $pgDomain = 'https://formtest.payway.com.hr/authorization.aspx'; 380 | } 381 | 382 | return '

383 |

Total amount will be ' . esc_html(number_format($order_total, 2)) . ' ' . esc_html($currency_symbol) . '

384 | 385 |
386 | ' . implode('', $form_args_array) . ' 387 | 388 | ' . esc_html__('Cancel order & restore cart', 'tcom-payway-wc') . ' 389 |
390 | 391 | 394 | '; 395 | } 396 | 397 | private function determine_language($country_code) 398 | { 399 | $languages = array( 400 | 'HR', 'SR', 'SL', 'BS', 'CG', 'DE', 'IT', 'FR', 'NL', 'HU', 401 | 'RU', 'SK', 'CZ', 'PL', 'PT', 'ES', 'BG', 'RO', 'EL', 402 | ); 403 | 404 | return in_array($country_code, $languages) ? strtolower($country_code) : 'en'; 405 | } 406 | 407 | public function process_payment($order_id) 408 | { 409 | $order = wc_get_order($order_id); 410 | 411 | return array( 412 | 'result' => 'success', 413 | 'redirect' => $order->get_checkout_payment_url(true), 414 | ); 415 | } 416 | 417 | function get_response_codes($id) 418 | { 419 | $id = (int)$id; 420 | 421 | $res = array( 422 | 0 => __('Action successful', 'tcom-payway-wc'), 423 | 15 => __('User cancelled the transaction by himself', 'tcom-payway-wc'), 424 | 16 => __('Transaction cancelled due to timeout', 'tcom-payway-wc'), 425 | 426 | // Deprecated, refactoring 427 | 1 => __('Action unsuccessful', 'tcom-payway-wc'), 428 | 2 => __('Error processing', 'tcom-payway-wc'), 429 | 3 => __('Action cancelled', 'tcom-payway-wc'), 430 | 4 => __('Action unsuccessful (3D Secure MPI)', 'tcom-payway-wc'), 431 | 1000 => __('Incorrect signature (pgw_signature)', 'tcom-payway-wc'), 432 | 1001 => __('Incorrect store ID (pgw_shop_id)', 'tcom-payway-wc'), 433 | 1002 => __('Incorrect transaction ID (pgw_transaction_id)', 'tcom-payway-wc'), 434 | 1003 => __('Incorrect amount (pgw_amount)', 'tcom-payway-wc'), 435 | 1004 => __('Incorrect authorization_type (pgw_authorization_type)', 'tcom-payway-wc'), 436 | 1005 => __('Incorrect announcement duration (pgw_announcement_duration)', 'tcom-payway-wc'), 437 | 1006 => __('Incorrect installments number (pgw_installments)', 'tcom-payway-wc'), 438 | 1007 => __('Incorrect language (pgw_language)', 'tcom-payway-wc'), 439 | 1008 => __('Incorrect authorization token (pgw_authorization_token)', 'tcom-payway-wc'), 440 | 1100 => __('Incorrect card number (pgw_card_number)', 'tcom-payway-wc'), 441 | 1101 => __('Incorrect card expiration date (pgw_card_expiration_date)', 'tcom-payway-wc'), 442 | 1102 => __('Incorrect card verification data (pgw_card_verification_data)', 'tcom-payway-wc'), 443 | 1200 => __('Incorrect order ID (pgw_order_id)', 'tcom-payway-wc'), 444 | 1201 => __('Incorrect order info (pgw_order_info)', 'tcom-payway-wc'), 445 | 1202 => __('Incorrect order items (pgw_order_items)', 'tcom-payway-wc'), 446 | 1300 => __('Incorrect return method (pgw_return_method)', 'tcom-payway-wc'), 447 | 1301 => __('Incorrect success store url (pgw_success_url)', 'tcom-payway-wc'), 448 | 1302 => __('Incorrect error store url (pgw_failure_url)', 'tcom-payway-wc'), 449 | 1304 => __('Incorrect merchant data (pgw_merchant_data)', 'tcom-payway-wc'), 450 | 1400 => __('Incorrect buyer\'s name (pgw_first_name)', 'tcom-payway-wc'), 451 | 1401 => __('Incorrect buyer\'s last name (pgw_last_name)', 'tcom-payway-wc'), 452 | 1402 => __('Incorrect address (pgw_street)', 'tcom-payway-wc'), 453 | 1403 => __('Incorrect city (pgw_city)', 'tcom-payway-wc'), 454 | 1404 => __('Incorrect ZIP code (pgw_post_code)', 'tcom-payway-wc'), 455 | 1405 => __('Incorrect country (pgw_country)', 'tcom-payway-wc'), 456 | 1406 => __('Incorrect contact phone (pgw_telephone)', 'tcom-payway-wc'), 457 | 1407 => __('Incorrect contact e-mail address (pgw_email)', 'tcom-payway-wc'), 458 | ); 459 | 460 | return isset($res[$id]) ? $res[$id] : __('Unknown response code', 'tcom-payway-wc'); 461 | } 462 | 463 | function check_tcompayway_response() 464 | { 465 | if (isset($_SERVER['REQUEST_METHOD'])) { 466 | if ($_SERVER['REQUEST_METHOD'] !== 'POST') { 467 | return; 468 | } 469 | } 470 | 471 | if (!isset($_POST['ShoppingCartID'])) { 472 | return; 473 | } 474 | 475 | $order_id = sanitize_text_field($_POST['ShoppingCartID']); 476 | $order = wc_get_order($order_id); 477 | $amount = $this->sanitize('Amount'); 478 | $status = isset($_POST['Success']) ? (int)$_POST['Success'] : 0; 479 | $reasonCode = isset($_POST['ApprovalCode']) ? (int)$_POST['ApprovalCode'] : 0; 480 | 481 | // Return URL 482 | if (!empty($_POST['ApprovalCode']) && isset($_POST['Success']) && isset($_POST['Signature'])) { 483 | if ((int)$_POST['Success'] === 1) { 484 | global $wpdb; 485 | $table_name = $wpdb->prefix . 'tpayway_ipg'; 486 | $wpdb->update( 487 | $table_name, 488 | array( 489 | 'response_code' => $status, 490 | 'response_code_desc' => $this->get_response_codes(0), 491 | 'reason_code' => $reasonCode, 492 | 'status' => 1, 493 | ), 494 | array('transaction_id' => $order_id), 495 | array('%d', '%s', '%d', '%d'), 496 | array('%s') 497 | ); 498 | 499 | $order_note = __('PayWay Hrvatski Telekom payment successful. Unique Id: ', 'tcom-payway-wc') . $order_id; 500 | $order->add_order_note(esc_html($order_note)); 501 | WC()->cart->empty_cart(); 502 | 503 | // Mark as on-hold (we're awaiting the payment). 504 | $order->update_status('pending', __('Awaiting payment', 'tcom-payway-wc')); 505 | 506 | $mailer = WC()->mailer(); 507 | $admin_email = get_option('admin_email', ''); 508 | 509 | $message = $mailer->wrap_message( 510 | __('Payment successful', 'tcom-payway-wc'), 511 | sprintf( 512 | __('Payment on PayWay Hrvatski Telekom is successfully completed and order status is processed.', 'tcom-payway-wc'), 513 | $order->get_order_number() 514 | ) 515 | ); 516 | $mailer->send( 517 | $admin_email, 518 | sprintf( 519 | __('Payment for order no. %s was successful.', 'tcom-payway-wc'), 520 | $order->get_order_number() 521 | ), 522 | $message 523 | ); 524 | 525 | $order->payment_complete(); 526 | 527 | wp_redirect($this->get_return_url($order)); 528 | exit; 529 | } 530 | } 531 | 532 | if (isset($_POST['Success'])) { 533 | if (isset($_POST['ResponseCode'])) { 534 | $responseCode = (int)$_POST['ResponseCode']; 535 | if ($responseCode === 15 || $responseCode === 16) { 536 | 537 | $order->add_order_note($this->get_response_codes($responseCode) . " (Code $responseCode)"); 538 | $order->update_status('cancelled'); 539 | WC()->cart->empty_cart(); 540 | 541 | global $wpdb; 542 | $table_name = $wpdb->prefix . 'tpayway_ipg'; 543 | $wpdb->update( 544 | $table_name, 545 | array( 546 | 'response_code' => $responseCode, 547 | 'response_code_desc' => $this->get_response_codes($responseCode), 548 | 'reason_code' => 0, 549 | 'status' => 0, 550 | ), 551 | array('transaction_id' => $order_id), 552 | array('%d', '%s', '%d', '%d'), 553 | array('%s') 554 | ); 555 | 556 | $text = '
'; 557 | $text .= esc_html__('A payment was not cancelled', 'tcom-payway-wc') . '
'; 558 | $text .= esc_html__('Reason: ', 'tcom-payway-wc') . esc_html($this->get_response_codes($responseCode)) . '
'; 559 | $text .= esc_html__('Order Id: ', 'tcom-payway-wc') . esc_html($order_id) . '
'; 560 | $text .= esc_html__('Redirecting...', 'tcom-payway-wc'); 561 | $text .= '
'; 562 | 563 | echo $text; 564 | 565 | exit; 566 | } 567 | } 568 | 569 | if ($_POST['Success'] === "0") { 570 | $errorCodes = isset($_POST['ErrorCodes']) ? sanitize_text_field(json_encode($_POST['ErrorCodes'])) : ''; 571 | 572 | $order->update_status('failed'); 573 | $order->add_order_note($this->get_response_codes($reasonCode) . " (Code $reasonCode)"); 574 | WC()->cart->empty_cart(); 575 | 576 | global $wpdb; 577 | $table_name = $wpdb->prefix . 'tpayway_ipg'; 578 | $wpdb->update( 579 | $table_name, 580 | array( 581 | 'response_code' => 0, 582 | 'response_code_desc' => $errorCodes, 583 | 'reason_code' => 0, 584 | 'status' => 0, 585 | ), 586 | array('transaction_id' => $order_id), 587 | array('%d', '%s', '%d', '%d'), 588 | array('%s') 589 | ); 590 | 591 | $text = '
'; 592 | $text .= esc_html__('A payment was not successful or declined', 'tcom-payway-wc') . '
'; 593 | $text .= esc_html__('Reason: ', 'tcom-payway-wc') . esc_html($errorCodes) . '
'; 594 | $text .= esc_html__('Order Id: ', 'tcom-payway-wc') . esc_html($order_id) . '
'; 595 | $text .= esc_html__('Redirecting...', 'tcom-payway-wc'); 596 | $text .= '
'; 597 | 598 | echo $text; 599 | 600 | exit; 601 | } 602 | } 603 | } 604 | 605 | function get_pages($title = false, $indent = true) 606 | { 607 | $wp_pages = get_pages('sort_column=menu_order'); 608 | $page_list = array(); 609 | if ($title) { 610 | $page_list[] = $title; 611 | } 612 | foreach ($wp_pages as $page) { 613 | $prefix = ''; 614 | if ($indent) { 615 | $has_parent = $page->post_parent; 616 | while ($has_parent) { 617 | $prefix .= ' - '; 618 | $next_page = get_page($has_parent); 619 | $has_parent = $next_page->post_parent; 620 | } 621 | } 622 | $page_list[$page->ID] = $prefix . $page->post_title; 623 | } 624 | return $page_list; 625 | } 626 | 627 | public function sanitize(string $data): string 628 | { 629 | return strip_tags( 630 | stripslashes( 631 | sanitize_text_field( 632 | filter_input(INPUT_POST, $data) 633 | ) 634 | ) 635 | ); 636 | } 637 | } 638 | --------------------------------------------------------------------------------