' : ''
262 | );
263 |
264 | }
265 |
266 | public function setting_payment_form_callback($args) {
267 |
268 | printf(
269 | __( 'For email notification settings, %sclick here to senting.%s', 'woocommerce-confirm-payment' ),
270 | '',
271 | ''
272 | );
273 |
274 | }
275 |
276 | public function setting_notification_callback($args) {
277 |
278 | printf(
279 | __( 'For email notification settings, %sclick here to senting.%s', 'woocommerce-confirm-payment' ),
280 | '',
281 | ''
282 | );
283 |
284 | }
285 |
286 | /**
287 | * Sanitize each setting field as needed
288 | *
289 | * @param array $input Contains all settings fields as array keys
290 | */
291 | public function save_option( $input ) {
292 |
293 | $accounts = array();
294 |
295 | if ( isset( $_POST['bank_logo'] ) && isset( $_POST['bank_name'] ) && isset( $_POST['account_name'] ) && isset( $_POST['account_number'] ) ) {
296 |
297 | $bank_logos = wc_clean( wp_unslash( $_POST['bank_logo'] ) );
298 | $bank_names = wc_clean( wp_unslash( $_POST['bank_name'] ) );
299 | $account_names = wc_clean( wp_unslash( $_POST['account_name'] ) );
300 | $account_numbers = wc_clean( wp_unslash( $_POST['account_number'] ) );
301 |
302 | foreach ( $account_names as $i => $name ) {
303 | if ( ! isset( $account_names[ $i ] ) ) {
304 | continue;
305 | }
306 |
307 | $accounts[] = array(
308 | 'bank_logo' => $bank_logos[ $i ],
309 | 'bank_name' => $bank_names[ $i ],
310 | 'account_number' => $account_numbers[ $i ],
311 | 'account_name' => $account_names[ $i ],
312 | );
313 | }
314 | }
315 |
316 | update_option( 'wcp_bank_accounts', $accounts );
317 |
318 | return $input;
319 |
320 | }
321 |
322 | public function add_woocommerce_email_actions( $actions ){
323 |
324 | $actions[] = 'woocommerce_order_status_on-hold_to_checking_payment';
325 | $actions[] = 'woocommerce_order_status_checking_payment_to_processing';
326 | $actions[] = 'woocommerce_order_status_checking_payment_to_on-hold';
327 |
328 | return $actions;
329 |
330 | }
331 |
332 | }
--------------------------------------------------------------------------------
/includes/class-woocommerce-confirm-payment.php:
--------------------------------------------------------------------------------
1 |
29 | */
30 | class Woocommerce_Confirm_Payment {
31 |
32 | /**
33 | * The loader that's responsible for maintaining and registering all hooks that power
34 | * the plugin.
35 | *
36 | * @since 0.9.0
37 | * @access protected
38 | * @var Woocommerce_Confirm_Payment_Loader $loader Maintains and registers all hooks for the plugin.
39 | */
40 | protected $loader;
41 |
42 | /**
43 | * The unique identifier of this plugin.
44 | *
45 | * @since 0.9.0
46 | * @access protected
47 | * @var string $plugin_name The string used to uniquely identify this plugin.
48 | */
49 | protected $plugin_name;
50 |
51 | /**
52 | * The current version of the plugin.
53 | *
54 | * @since 0.9.0
55 | * @access protected
56 | * @var string $version The current version of the plugin.
57 | */
58 | protected $version;
59 |
60 | /**
61 | * Define the core functionality of the plugin.
62 | *
63 | * Set the plugin name and the plugin version that can be used throughout the plugin.
64 | * Load the dependencies, define the locale, and set the hooks for the admin area and
65 | * the public-facing side of the site.
66 | *
67 | * @since 0.9.0
68 | */
69 | public function __construct() {
70 | if ( defined( 'PLUGIN_WCP_VERSION' ) ) {
71 | $this->version = PLUGIN_WCP_VERSION;
72 | } else {
73 | $this->version = '1.0.0';
74 | }
75 | $this->plugin_name = 'woocommerce-confirm-payment';
76 |
77 | $this->load_dependencies();
78 | $this->set_locale();
79 | $this->define_admin_hooks();
80 | $this->define_public_hooks();
81 |
82 | }
83 |
84 | /**
85 | * Load the required dependencies for this plugin.
86 | *
87 | * Include the following files that make up the plugin:
88 | *
89 | * - Woocommerce_Confirm_Payment_Loader. Orchestrates the hooks of the plugin.
90 | * - Woocommerce_Confirm_Payment_i18n. Defines internationalization functionality.
91 | * - Woocommerce_Confirm_Payment_Admin. Defines all hooks for the admin area.
92 | * - Woocommerce_Confirm_Payment_Public. Defines all hooks for the public side of the site.
93 | *
94 | * Create an instance of the loader which will be used to register the hooks
95 | * with WordPress.
96 | *
97 | * @since 0.9.0
98 | * @access private
99 | */
100 | private function load_dependencies() {
101 |
102 | /**
103 | * The class responsible for orchestrating the actions and filters of the
104 | * core plugin.
105 | */
106 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-woocommerce-confirm-payment-loader.php';
107 |
108 | /**
109 | * The class responsible for defining internationalization functionality
110 | * of the plugin.
111 | */
112 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-woocommerce-confirm-payment-i18n.php';
113 |
114 | /**
115 | * The class responsible for defining all actions that occur in the admin area.
116 | */
117 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-woocommerce-confirm-payment-admin.php';
118 |
119 | /**
120 | * The class responsible for defining all actions that occur in the public-facing
121 | * side of the site.
122 | */
123 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-woocommerce-confirm-payment-public.php';
124 |
125 | $this->loader = new Woocommerce_Confirm_Payment_Loader();
126 |
127 | }
128 |
129 | /**
130 | * Define the locale for this plugin for internationalization.
131 | *
132 | * Uses the Woocommerce_Confirm_Payment_i18n class in order to set the domain and to register the hook
133 | * with WordPress.
134 | *
135 | * @since 0.9.0
136 | * @access private
137 | */
138 | private function set_locale() {
139 |
140 | $plugin_i18n = new Woocommerce_Confirm_Payment_i18n();
141 |
142 | $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
143 |
144 | }
145 |
146 | /**
147 | * Register all of the hooks related to the admin area functionality
148 | * of the plugin.
149 | *
150 | * @since 0.9.0
151 | * @access private
152 | */
153 | private function define_admin_hooks() {
154 |
155 | $plugin_admin = new Woocommerce_Confirm_Payment_Admin( $this->get_plugin_name(), $this->get_version() );
156 | $plugin_settings = new Woocommerce_Confirm_Payment_Admin_Setting( $this->get_plugin_name(), $this->get_version() );
157 | $email = new Woocommerce_Confirm_Payment_Email( $this->get_plugin_name(), $this->get_version() );
158 |
159 | $this->loader->add_action( 'admin_menu', $plugin_settings, 'add_plugin_page' );
160 | $this->loader->add_action( 'admin_init', $plugin_settings, 'page_init' );
161 | $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
162 | $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
163 | $this->loader->add_action( 'init', $plugin_admin, 'register_post_type' );
164 | $this->loader->add_filter( 'manage_wcp_confirm_payment_posts_columns', $plugin_admin, 'columns' );
165 | $this->loader->add_action( 'manage_wcp_confirm_payment_posts_custom_column', $plugin_admin, 'columns_display', 10, 2 );
166 | $this->loader->add_action( 'init', $plugin_admin, 'flush_rewrite_rules' );
167 | $this->loader->add_action( 'display_post_states', $plugin_admin, 'post_states', 10, 2 );
168 | $this->loader->add_action( 'init', $plugin_admin, 'register_order_status' );
169 | $this->loader->add_filter( 'wc_order_statuses', $plugin_admin, 'add_order_statuses' );
170 | $this->loader->add_filter( 'post_date_column_status', $plugin_admin, 'post_date_column_status' );
171 | $this->loader->add_action( 'wp_ajax_wcp_mark_payment_status', $plugin_admin, 'mark_payment_status' );
172 | $this->loader->add_action( 'admin_head', $plugin_admin, 'menu_payment_count' );
173 | $this->loader->add_filter( 'wc_order_statuses', $plugin_admin, 'add_order_statuses' );
174 | $this->loader->add_action( 'restrict_manage_posts', $plugin_admin, 'filter_payment_field' );
175 | $this->loader->add_action( 'pre_get_posts', $plugin_admin, 'filter_payment' );
176 | $this->loader->add_filter( 'post_row_actions', $plugin_admin, 'remove_row_actions', 10, 2 );
177 | $this->loader->add_filter( 'bulk_actions-edit-wcp_confirm_payment', $plugin_admin, 'remove_edit_bulk_actions', 10, 2 );
178 | $this->loader->add_action( 'woocommerce_order_status_checking_payment_to_processing', $plugin_admin, 'approve_payment' );
179 | $this->loader->add_action( 'woocommerce_order_status_checking_payment_to_on-hold', $plugin_admin, 'cancel_payment' );
180 | $this->loader->add_filter( 'woocommerce_admin_order_actions', $plugin_admin, 'woocommerce_admin_order_actions', 10, 2 );
181 | $this->loader->add_filter( 'woocommerce_email_classes', $email, 'register_email', 90, 1 );
182 | $this->loader->add_action( 'woocommerce_email_actions', $email, 'add_woocommerce_email_actions' );
183 | $this->loader->add_action( 'wcp_email_payment_details', $email, 'payment_details', 10, 4 );
184 |
185 | }
186 |
187 | /**
188 | * Register all of the hooks related to the public-facing functionality
189 | * of the plugin.
190 | *
191 | * @since 0.9.0
192 | * @access private
193 | */
194 | private function define_public_hooks() {
195 |
196 | $plugin_public = new Woocommerce_Confirm_Payment_Public( $this->get_plugin_name(), $this->get_version() );
197 | $payment_history = new Woocommerce_Confirm_Payment_History( $this->get_plugin_name(), $this->get_version() );
198 |
199 | $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
200 | $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
201 | $this->loader->add_action( 'init', $plugin_public, 'add_shortcode' );
202 |
203 | $this->loader->add_action( 'woocommerce_email_before_order_table', $plugin_public, 'email_instructions', 10, 3 );
204 | $this->loader->add_action( 'init', $plugin_public, 'remove_bank_original', 100 );
205 | $this->loader->add_action( 'woocommerce_thankyou_bacs', $plugin_public, 'thankyou_page' );
206 | $this->loader->add_action( 'woocommerce_gateway_description', $plugin_public, 'gateway_description', 10, 2 );
207 | $this->loader->add_action( 'template_redirect', $plugin_public, 'redirect_single_attachment' );
208 | $this->loader->add_action( 'wp_ajax_wcp_confirm_payment', $plugin_public, 'confirm_payment' );
209 | $this->loader->add_action( 'wp_ajax_nopriv_wcp_confirm_payment', $plugin_public, 'confirm_payment' );
210 | $this->loader->add_action( 'wp_ajax_wcp_check_order', $plugin_public, 'ajax_check_order' );
211 | $this->loader->add_action( 'wp_ajax_nopriv_wcp_check_order', $plugin_public, 'ajax_check_order' );
212 | $this->loader->add_filter( 'woocommerce_my_account_my_orders_actions', $plugin_public, 'woocommerce_my_account_my_orders_actions', 10, 2 );
213 | $this->loader->add_filter( 'query_vars', $plugin_public, 'add_query_vars' );
214 |
215 | $this->loader->add_filter( 'woocommerce_get_query_vars', $payment_history, 'woocommerce_get_query_vars' );
216 | $this->loader->add_filter( 'woocommerce_account_menu_items', $payment_history, 'woocommerce_menu_item', 40 );
217 | $this->loader->add_action( 'init', $payment_history, 'woocommerce_add_endpoints' );
218 | $this->loader->add_action( 'woocommerce_account_' . $this->plugin_name . '_endpoint', $payment_history, 'woocommerce_account_payment_history' );
219 | $this->loader->add_filter( 'woocommerce_endpoint_' . $this->plugin_name . '_title', $payment_history, 'woocommerce_endpoints_title', $this->plugin_name );
220 |
221 | }
222 |
223 | /**
224 | * Run the loader to execute all of the hooks with WordPress.
225 | *
226 | * @since 0.9.0
227 | */
228 | public function run() {
229 | $this->loader->run();
230 | }
231 |
232 | /**
233 | * The name of the plugin used to uniquely identify it within the context of
234 | * WordPress and to define internationalization functionality.
235 | *
236 | * @since 1.0.0
237 | * @return string The name of the plugin.
238 | */
239 | public function get_plugin_name() {
240 | return $this->plugin_name;
241 | }
242 |
243 | /**
244 | * The reference to the class that orchestrates the hooks with the plugin.
245 | *
246 | * @since 1.0.0
247 | * @return Woocommerce_Confirm_Payment_Loader Orchestrates the hooks of the plugin.
248 | */
249 | public function get_loader() {
250 | return $this->loader;
251 | }
252 |
253 | /**
254 | * Retrieve the version number of the plugin.
255 | *
256 | * @since 1.0.0
257 | * @return string The version number of the plugin.
258 | */
259 | public function get_version() {
260 | return $this->version;
261 | }
262 |
263 | }
264 |
--------------------------------------------------------------------------------
/public/js/cleave.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * cleave.js - 1.4.4
3 | * https://github.com/nosir/cleave.js
4 | * Apache License Version 2.0
5 | *
6 | * Copyright (C) 2012-2018 Max Huang https://github.com/nosir/
7 | */
8 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Cleave=t():e.Cleave=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){(function(t){"use strict";var n=function(e,t){var r=this;if("string"==typeof e?r.element=document.querySelector(e):r.element="undefined"!=typeof e.length&&e.length>0?e[0]:e,!r.element)throw new Error("[cleave.js] Please check the element");t.initValue=r.element.value,r.properties=n.DefaultProperties.assign({},t),r.init()};n.prototype={init:function(){var e=this,t=e.properties;return t.numeral||t.phone||t.creditCard||t.time||t.date||0!==t.blocksLength||t.prefix?(t.maxLength=n.Util.getMaxLength(t.blocks),e.isAndroid=n.Util.isAndroid(),e.lastInputValue="",e.onChangeListener=e.onChange.bind(e),e.onKeyDownListener=e.onKeyDown.bind(e),e.onFocusListener=e.onFocus.bind(e),e.onCutListener=e.onCut.bind(e),e.onCopyListener=e.onCopy.bind(e),e.element.addEventListener("input",e.onChangeListener),e.element.addEventListener("keydown",e.onKeyDownListener),e.element.addEventListener("focus",e.onFocusListener),e.element.addEventListener("cut",e.onCutListener),e.element.addEventListener("copy",e.onCopyListener),e.initPhoneFormatter(),e.initDateFormatter(),e.initTimeFormatter(),e.initNumeralFormatter(),void((t.initValue||t.prefix&&!t.noImmediatePrefix)&&e.onInput(t.initValue))):void e.onInput(t.initValue)},initNumeralFormatter:function(){var e=this,t=e.properties;t.numeral&&(t.numeralFormatter=new n.NumeralFormatter(t.numeralDecimalMark,t.numeralIntegerScale,t.numeralDecimalScale,t.numeralThousandsGroupStyle,t.numeralPositiveOnly,t.stripLeadingZeroes,t.delimiter))},initTimeFormatter:function(){var e=this,t=e.properties;t.time&&(t.timeFormatter=new n.TimeFormatter(t.timePattern),t.blocks=t.timeFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=n.Util.getMaxLength(t.blocks))},initDateFormatter:function(){var e=this,t=e.properties;t.date&&(t.dateFormatter=new n.DateFormatter(t.datePattern),t.blocks=t.dateFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=n.Util.getMaxLength(t.blocks))},initPhoneFormatter:function(){var e=this,t=e.properties;if(t.phone)try{t.phoneFormatter=new n.PhoneFormatter(new t.root.Cleave.AsYouTypeFormatter(t.phoneRegionCode),t.delimiter)}catch(r){throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib")}},onKeyDown:function(e){var t=this,r=t.properties,i=e.which||e.keyCode,a=n.Util,o=t.element.value;return 229===i&&a.isAndroidBackspaceKeydown(t.lastInputValue,o)&&(i=8),t.lastInputValue=o,8===i&&a.isDelimiter(o.slice(-r.delimiterLength),r.delimiter,r.delimiters)?void(r.backspace=!0):void(r.backspace=!1)},onChange:function(){this.onInput(this.element.value)},onFocus:function(){var e=this,t=e.properties;n.Util.fixPrefixCursor(e.element,t.prefix,t.delimiter,t.delimiters)},onCut:function(e){this.copyClipboardData(e),this.onInput("")},onCopy:function(e){this.copyClipboardData(e)},copyClipboardData:function(e){var t=this,r=t.properties,i=n.Util,a=t.element.value,o="";o=r.copyDelimiter?a:i.stripDelimiters(a,r.delimiter,r.delimiters);try{e.clipboardData?e.clipboardData.setData("Text",o):window.clipboardData.setData("Text",o),e.preventDefault()}catch(l){}},onInput:function(e){var t=this,r=t.properties,i=n.Util;return r.numeral||!r.backspace||i.isDelimiter(e.slice(-r.delimiterLength),r.delimiter,r.delimiters)||(e=i.headStr(e,e.length-r.delimiterLength)),r.phone?(!r.prefix||r.noImmediatePrefix&&!e.length?r.result=r.phoneFormatter.format(e):r.result=r.prefix+r.phoneFormatter.format(e).slice(r.prefix.length),void t.updateValueState()):r.numeral?(!r.prefix||r.noImmediatePrefix&&!e.length?r.result=r.numeralFormatter.format(e):r.result=r.prefix+r.numeralFormatter.format(e),void t.updateValueState()):(r.date&&(e=r.dateFormatter.getValidatedDate(e)),r.time&&(e=r.timeFormatter.getValidatedTime(e)),e=i.stripDelimiters(e,r.delimiter,r.delimiters),e=i.getPrefixStrippedValue(e,r.prefix,r.prefixLength,r.result),e=r.numericOnly?i.strip(e,/[^\d]/g):e,e=r.uppercase?e.toUpperCase():e,e=r.lowercase?e.toLowerCase():e,!r.prefix||r.noImmediatePrefix&&!e.length||(e=r.prefix+e,0!==r.blocksLength)?(r.creditCard&&t.updateCreditCardPropsByValue(e),e=i.headStr(e,r.maxLength),r.result=i.getFormattedValue(e,r.blocks,r.blocksLength,r.delimiter,r.delimiters,r.delimiterLazyShow),void t.updateValueState()):(r.result=e,void t.updateValueState()))},updateCreditCardPropsByValue:function(e){var t,r=this,i=r.properties,a=n.Util;a.headStr(i.result,4)!==a.headStr(e,4)&&(t=n.CreditCardDetector.getInfo(e,i.creditCardStrictMode),i.blocks=t.blocks,i.blocksLength=i.blocks.length,i.maxLength=a.getMaxLength(i.blocks),i.creditCardType!==t.type&&(i.creditCardType=t.type,i.onCreditCardTypeChanged.call(r,i.creditCardType)))},updateValueState:function(){var e=this,t=n.Util,r=e.properties;if(e.element){var i=e.element.selectionEnd,a=e.element.value,o=r.result;if(i=t.getNextCursorPosition(i,a,o,r.delimiter,r.delimiters),e.isAndroid)return void window.setTimeout(function(){e.element.value=o,t.setSelection(e.element,i,r.document,!1),e.callOnValueChanged()},1);e.element.value=o,t.setSelection(e.element,i,r.document,!1),e.callOnValueChanged()}},callOnValueChanged:function(){var e=this,t=e.properties;t.onValueChanged.call(e,{target:{value:t.result,rawValue:e.getRawValue()}})},setPhoneRegionCode:function(e){var t=this,r=t.properties;r.phoneRegionCode=e,t.initPhoneFormatter(),t.onChange()},setRawValue:function(e){var t=this,r=t.properties;e=void 0!==e&&null!==e?e.toString():"",r.numeral&&(e=e.replace(".",r.numeralDecimalMark)),r.backspace=!1,t.element.value=e,t.onInput(e)},getRawValue:function(){var e=this,t=e.properties,r=n.Util,i=e.element.value;return t.rawValueTrimPrefix&&(i=r.getPrefixStrippedValue(i,t.prefix,t.prefixLength,t.result)),i=t.numeral?t.numeralFormatter.getRawValue(i):r.stripDelimiters(i,t.delimiter,t.delimiters)},getISOFormatDate:function(){var e=this,t=e.properties;return t.date?t.dateFormatter.getISOFormatDate():""},getFormattedValue:function(){return this.element.value},destroy:function(){var e=this;e.element.removeEventListener("input",e.onChangeListener),e.element.removeEventListener("keydown",e.onKeyDownListener),e.element.removeEventListener("focus",e.onFocusListener),e.element.removeEventListener("cut",e.onCutListener),e.element.removeEventListener("copy",e.onCopyListener)},toString:function(){return"[Cleave Object]"}},n.NumeralFormatter=r(1),n.DateFormatter=r(2),n.TimeFormatter=r(3),n.PhoneFormatter=r(4),n.CreditCardDetector=r(5),n.Util=r(6),n.DefaultProperties=r(7),("object"==typeof t&&t?t:window).Cleave=n,e.exports=n}).call(t,function(){return this}())},function(e,t){"use strict";var r=function(e,t,n,i,a,o,l){var s=this;s.numeralDecimalMark=e||".",s.numeralIntegerScale=t>0?t:0,s.numeralDecimalScale=n>=0?n:2,s.numeralThousandsGroupStyle=i||r.groupStyle.thousand,s.numeralPositiveOnly=!!a,s.stripLeadingZeroes=o!==!1,s.delimiter=l||""===l?l:",",s.delimiterRE=l?new RegExp("\\"+l,"g"):""};r.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},r.prototype={getRawValue:function(e){return e.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(e){var t,n,i=this,a="";switch(e=e.replace(/[A-Za-z]/g,"").replace(i.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",i.numeralPositiveOnly?"":"-").replace("M",i.numeralDecimalMark),i.stripLeadingZeroes&&(e=e.replace(/^(-)?0+(?=\d)/,"$1")),n=e,e.indexOf(i.numeralDecimalMark)>=0&&(t=e.split(i.numeralDecimalMark),n=t[0],a=i.numeralDecimalMark+t[1].slice(0,i.numeralDecimalScale)),i.numeralIntegerScale>0&&(n=n.slice(0,i.numeralIntegerScale+("-"===e.slice(0,1)?1:0))),i.numeralThousandsGroupStyle){case r.groupStyle.lakh:n=n.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+i.delimiter);break;case r.groupStyle.wan:n=n.replace(/(\d)(?=(\d{4})+$)/g,"$1"+i.delimiter);break;case r.groupStyle.thousand:n=n.replace(/(\d)(?=(\d{3})+$)/g,"$1"+i.delimiter)}return n.toString()+(i.numeralDecimalScale>0?a.toString():"")}},e.exports=r},function(e,t){"use strict";var r=function(e){var t=this;t.date=[],t.blocks=[],t.datePattern=e,t.initBlocks()};r.prototype={initBlocks:function(){var e=this;e.datePattern.forEach(function(t){"Y"===t?e.blocks.push(4):e.blocks.push(2)})},getISOFormatDate:function(){var e=this,t=e.date;return t[2]?t[2]+"-"+e.addLeadingZero(t[1])+"-"+e.addLeadingZero(t[0]):""},getBlocks:function(){return this.blocks},getValidatedDate:function(e){var t=this,r="";return e=e.replace(/[^\d]/g,""),t.blocks.forEach(function(n,i){if(e.length>0){var a=e.slice(0,n),o=a.slice(0,1),l=e.slice(n);switch(t.datePattern[i]){case"d":"00"===a?a="01":parseInt(o,10)>3?a="0"+o:parseInt(a,10)>31&&(a="31");break;case"m":"00"===a?a="01":parseInt(o,10)>1?a="0"+o:parseInt(a,10)>12&&(a="12")}r+=a,e=l}}),this.getFixedDateString(r)},getFixedDateString:function(e){var t,r,n,i=this,a=i.datePattern,o=[],l=0,s=0,c=0,u=0,d=0,m=0,p=!1;return 4===e.length&&"y"!==a[0].toLowerCase()&&"y"!==a[1].toLowerCase()&&(u="d"===a[0]?0:2,d=2-u,t=parseInt(e.slice(u,u+2),10),r=parseInt(e.slice(d,d+2),10),o=this.getFixedDate(t,r,0)),8===e.length&&(a.forEach(function(e,t){switch(e){case"d":l=t;break;case"m":s=t;break;default:c=t}}),m=2*c,u=l<=c?2*l:2*l+2,d=s<=c?2*s:2*s+2,t=parseInt(e.slice(u,u+2),10),r=parseInt(e.slice(d,d+2),10),n=parseInt(e.slice(m,m+4),10),p=4===e.slice(m,m+4).length,o=this.getFixedDate(t,r,n)),i.date=o,0===o.length?e:a.reduce(function(e,t){switch(t){case"d":return e+i.addLeadingZero(o[0]);case"m":return e+i.addLeadingZero(o[1]);default:return e+(p?i.addLeadingZeroForYear(o[2]):"")}},"")},getFixedDate:function(e,t,r){return e=Math.min(e,31),t=Math.min(t,12),r=parseInt(r||0,10),(t<7&&t%2===0||t>8&&t%2===1)&&(e=Math.min(e,2===t?this.isLeapYear(r)?29:28:30)),[e,t,r]},isLeapYear:function(e){return e%4===0&&e%100!==0||e%400===0},addLeadingZero:function(e){return(e<10?"0":"")+e},addLeadingZeroForYear:function(e){return(e<10?"000":e<100?"00":e<1e3?"0":"")+e}},e.exports=r},function(e,t){"use strict";var r=function(e){var t=this;t.time=[],t.blocks=[],t.timePattern=e,t.initBlocks()};r.prototype={initBlocks:function(){var e=this;e.timePattern.forEach(function(){e.blocks.push(2)})},getISOFormatTime:function(){var e=this,t=e.time;return t[2]?e.addLeadingZero(t[0])+":"+e.addLeadingZero(t[1])+":"+e.addLeadingZero(t[2]):""},getBlocks:function(){return this.blocks},getValidatedTime:function(e){var t=this,r="";return e=e.replace(/[^\d]/g,""),t.blocks.forEach(function(n,i){if(e.length>0){var a=e.slice(0,n),o=a.slice(0,1),l=e.slice(n);switch(t.timePattern[i]){case"h":parseInt(o,10)>2?a="0"+o:parseInt(a,10)>23&&(a="23");break;case"m":case"s":parseInt(o,10)>5?a="0"+o:parseInt(a,10)>60&&(a="60")}r+=a,e=l}}),this.getFixedTimeString(r)},getFixedTimeString:function(e){var t,r,n,i=this,a=i.timePattern,o=[],l=0,s=0,c=0,u=0,d=0,m=0;return 6===e.length&&(a.forEach(function(e,t){switch(e){case"s":l=2*t;break;case"m":s=2*t;break;case"h":c=2*t}}),m=c,d=s,u=l,t=parseInt(e.slice(u,u+2),10),r=parseInt(e.slice(d,d+2),10),n=parseInt(e.slice(m,m+2),10),o=this.getFixedTime(n,r,t)),4===e.length&&i.timePattern.indexOf("s")<0&&(a.forEach(function(e,t){switch(e){case"m":s=2*t;break;case"h":c=2*t}}),m=c,d=s,t=0,r=parseInt(e.slice(d,d+2),10),n=parseInt(e.slice(m,m+2),10),o=this.getFixedTime(n,r,t)),i.time=o,0===o.length?e:a.reduce(function(e,t){switch(t){case"s":return e+i.addLeadingZero(o[2]);case"m":return e+i.addLeadingZero(o[1]);case"h":return e+i.addLeadingZero(o[0])}},"")},getFixedTime:function(e,t,r){return r=Math.min(parseInt(r||0,10),60),t=Math.min(t,60),e=Math.min(e,60),[e,t,r]},addLeadingZero:function(e){return(e<10?"0":"")+e}},e.exports=r},function(e,t){"use strict";var r=function(e,t){var r=this;r.delimiter=t||""===t?t:" ",r.delimiterRE=t?new RegExp("\\"+t,"g"):"",r.formatter=e};r.prototype={setFormatter:function(e){this.formatter=e},format:function(e){var t=this;t.formatter.clear(),e=e.replace(/[^\d+]/g,""),e=e.replace(/^\+/,"B").replace(/\+/g,"").replace("B","+"),e=e.replace(t.delimiterRE,"");for(var r,n="",i=!1,a=0,o=e.length;ar?n:t;else{var i=this.getFirstDiffIndex(t,e.slice(0,r));e=t+e.slice(i,i+1)+e.slice(r+1)}return e.slice(r)},getFirstDiffIndex:function(e,t){for(var r=0;e.charAt(r)===t.charAt(r);)if(""===e.charAt(r++))return-1;return r},getFormattedValue:function(e,t,r,n,i,a){var o,l="",s=i.length>0;return 0===r?e:(t.forEach(function(t,c){if(e.length>0){var u=e.slice(0,t),d=e.slice(t);o=s?i[a?c-1:c]||o:n,a?(c>0&&(l+=o),l+=u):(l+=u,u.length===t&&c0?r.numeralIntegerScale:0,e.numeralDecimalScale=r.numeralDecimalScale>=0?r.numeralDecimalScale:2,e.numeralDecimalMark=r.numeralDecimalMark||".",e.numeralThousandsGroupStyle=r.numeralThousandsGroupStyle||"thousand",e.numeralPositiveOnly=!!r.numeralPositiveOnly,e.stripLeadingZeroes=r.stripLeadingZeroes!==!1,e.numericOnly=e.creditCard||e.date||!!r.numericOnly,e.uppercase=!!r.uppercase,e.lowercase=!!r.lowercase,e.prefix=e.creditCard||e.date?"":r.prefix||"",e.noImmediatePrefix=!!r.noImmediatePrefix,e.prefixLength=e.prefix.length,e.rawValueTrimPrefix=!!r.rawValueTrimPrefix,e.copyDelimiter=!!r.copyDelimiter,e.initValue=void 0!==r.initValue&&null!==r.initValue?r.initValue.toString():"",e.delimiter=r.delimiter||""===r.delimiter?r.delimiter:r.date?"/":r.time?":":r.numeral?",":(r.phone," "),e.delimiterLength=e.delimiter.length,e.delimiterLazyShow=!!r.delimiterLazyShow,e.delimiters=r.delimiters||[],e.blocks=r.blocks||[],e.blocksLength=e.blocks.length,e.root="object"==typeof t&&t?t:window,e.document=r.document||e.root.document,e.maxLength=0,e.backspace=!1,e.result="",e.onValueChanged=r.onValueChanged||function(){},e}};e.exports=r}).call(t,function(){return this}())}])});
--------------------------------------------------------------------------------
/languages/woocommerce-confirm-payment-en_US.po:
--------------------------------------------------------------------------------
1 | msgid ""
2 | msgstr ""
3 | "Project-Id-Version: Woocommerce confirm payment\n"
4 | "POT-Creation-Date: 2018-09-07 08:57+0700\n"
5 | "PO-Revision-Date: 2018-09-07 08:57+0700\n"
6 | "Last-Translator: \n"
7 | "Language-Team: Surakrai\n"
8 | "Language: en_US\n"
9 | "MIME-Version: 1.0\n"
10 | "Content-Type: text/plain; charset=UTF-8\n"
11 | "Content-Transfer-Encoding: 8bit\n"
12 | "X-Generator: Poedit 2.1.1\n"
13 | "X-Poedit-Basepath: ..\n"
14 | "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15 | "X-Poedit-KeywordsList: __;_e;esc_html_e;esc_html__;_n_noop;esc_attr_e\n"
16 | "X-Poedit-SourceCharset: UTF-8\n"
17 | "X-Poedit-SearchPath-0: .\n"
18 |
19 | #: admin/class-woocommerce-confirm-payment-admin.php:130
20 | msgid "Select"
21 | msgstr ""
22 |
23 | #: admin/class-woocommerce-confirm-payment-admin.php:131
24 | msgid "Select bank logo"
25 | msgstr ""
26 |
27 | #: admin/class-woocommerce-confirm-payment-admin.php:132
28 | msgid "Upload"
29 | msgstr ""
30 |
31 | #: admin/class-woocommerce-confirm-payment-admin.php:141
32 | #: admin/class-woocommerce-confirm-payment-admin.php:142
33 | #: admin/class-woocommerce-confirm-payment-admin.php:143
34 | #: public/class-woocommerce-confirm-payment-public.php:178
35 | #: public/class-woocommerce-confirm-payment-public.php:357
36 | #: public/class-woocommerce-confirm-payment-public.php:479
37 | msgid "Confirm payment"
38 | msgstr ""
39 |
40 | #: admin/class-woocommerce-confirm-payment-admin.php:144
41 | msgid "Search Confirm payment"
42 | msgstr ""
43 |
44 | #: admin/class-woocommerce-confirm-payment-admin.php:145
45 | #: admin/class-woocommerce-confirm-payment-admin.php:146
46 | msgid "No Confirm payment found."
47 | msgstr ""
48 |
49 | #: admin/class-woocommerce-confirm-payment-admin.php:188
50 | #: admin/class-woocommerce-confirm-payment-admin.php:232
51 | msgid "Checking payment"
52 | msgstr ""
53 |
54 | #: admin/class-woocommerce-confirm-payment-admin.php:193
55 | #, php-format
56 | msgid "Checking payment (%s)"
57 | msgstr ""
58 |
59 | #: admin/class-woocommerce-confirm-payment-admin.php:197
60 | msgid "Pending confirm"
61 | msgstr ""
62 |
63 | #: admin/class-woocommerce-confirm-payment-admin.php:202
64 | #, php-format
65 | msgid "Pending confirm (%s)"
66 | msgstr ""
67 |
68 | #: admin/class-woocommerce-confirm-payment-admin.php:206
69 | msgid "Success"
70 | msgstr ""
71 |
72 | #: admin/class-woocommerce-confirm-payment-admin.php:211
73 | #, php-format
74 | msgid "Success (%s)"
75 | msgstr ""
76 |
77 | #: admin/class-woocommerce-confirm-payment-admin.php:215
78 | #: admin/class-woocommerce-confirm-payment-admin.php:332
79 | msgid "Cancel"
80 | msgstr ""
81 |
82 | #: admin/class-woocommerce-confirm-payment-admin.php:220
83 | #, php-format
84 | msgid "Cancel (%s)"
85 | msgstr ""
86 |
87 | #: admin/class-woocommerce-confirm-payment-admin.php:244
88 | #: admin/class-woocommerce-confirm-payment-setting.php:145
89 | msgid "Confirm Payment Page"
90 | msgstr ""
91 |
92 | #: admin/class-woocommerce-confirm-payment-admin.php:257
93 | #: public/partials/woocommerce-confirm-payment-history.php:19
94 | #: public/partials/woocommerce-confirm-payment-history.php:37
95 | msgid "Slip"
96 | msgstr ""
97 |
98 | #: admin/class-woocommerce-confirm-payment-admin.php:258
99 | #: public/class-woocommerce-confirm-payment-public.php:342
100 | #: public/partials/woocommerce-confirm-payment-confirm-form.php:52
101 | #: public/partials/woocommerce-confirm-payment-email.php:21
102 | #: templates/emails/email-payment-detail.php:39
103 | msgid "Name"
104 | msgstr ""
105 |
106 | #: admin/class-woocommerce-confirm-payment-admin.php:259
107 | #: public/class-woocommerce-confirm-payment-public.php:347
108 | #: public/partials/woocommerce-confirm-payment-confirm-form.php:66
109 | #: public/partials/woocommerce-confirm-payment-email.php:45
110 | #: public/partials/woocommerce-confirm-payment-history.php:20
111 | #: public/partials/woocommerce-confirm-payment-history.php:46
112 | #: templates/emails/email-payment-detail.php:58
113 | msgid "Order"
114 | msgstr ""
115 |
116 | #: admin/class-woocommerce-confirm-payment-admin.php:260
117 | #: public/class-woocommerce-confirm-payment-public.php:346
118 | #: public/partials/woocommerce-confirm-payment-bank-details.php:25
119 | #: public/partials/woocommerce-confirm-payment-email.php:41
120 | #: templates/emails/email-payment-detail.php:54
121 | msgid "Bank"
122 | msgstr ""
123 |
124 | #: admin/class-woocommerce-confirm-payment-admin.php:261
125 | #: public/partials/woocommerce-confirm-payment-confirm-form.php:89
126 | #: public/partials/woocommerce-confirm-payment-email.php:37
127 | #: public/partials/woocommerce-confirm-payment-history.php:21
128 | #: public/partials/woocommerce-confirm-payment-history.php:49
129 | #: templates/emails/email-payment-detail.php:50
130 | msgid "Transfer amount"
131 | msgstr ""
132 |
133 | #: admin/class-woocommerce-confirm-payment-admin.php:262
134 | #: public/partials/woocommerce-confirm-payment-confirm-form.php:115
135 | #: public/partials/woocommerce-confirm-payment-history.php:22
136 | #: public/partials/woocommerce-confirm-payment-history.php:50
137 | msgid "Transfer date"
138 | msgstr ""
139 |
140 | #: admin/class-woocommerce-confirm-payment-admin.php:263
141 | #: public/class-woocommerce-confirm-payment-public.php:343
142 | #: public/partials/woocommerce-confirm-payment-confirm-form.php:59
143 | #: public/partials/woocommerce-confirm-payment-email.php:25
144 | #: templates/emails/email-payment-detail.php:43
145 | msgid "Phone"
146 | msgstr ""
147 |
148 | #: admin/class-woocommerce-confirm-payment-admin.php:264
149 | #: public/class-woocommerce-confirm-payment-public.php:344
150 | #: public/partials/woocommerce-confirm-payment-email.php:29
151 | #: templates/emails/email-payment-detail.php:47
152 | msgid "Date"
153 | msgstr ""
154 |
155 | #: admin/class-woocommerce-confirm-payment-admin.php:265
156 | #: public/partials/woocommerce-confirm-payment-history.php:23
157 | #: public/partials/woocommerce-confirm-payment-history.php:51
158 | msgid "Status"
159 | msgstr ""
160 |
161 | #: admin/class-woocommerce-confirm-payment-admin.php:266
162 | msgid "Action"
163 | msgstr ""
164 |
165 | #: admin/class-woocommerce-confirm-payment-admin.php:337
166 | msgid "Approve"
167 | msgstr ""
168 |
169 | #: admin/class-woocommerce-confirm-payment-admin.php:364
170 | msgid "Select an order"
171 | msgstr ""
172 |
173 | #: admin/class-woocommerce-confirm-payment-admin.php:431
174 | msgid "Processing"
175 | msgstr ""
176 |
177 | #: admin/class-woocommerce-confirm-payment-admin.php:439
178 | msgid "View payment detail"
179 | msgstr ""
180 |
181 | #: admin/class-woocommerce-confirm-payment-admin.php:458
182 | #: admin/class-woocommerce-confirm-payment-customer-email-completed-payment.php:34
183 | msgid "Completed payment"
184 | msgstr ""
185 |
186 | #: admin/class-woocommerce-confirm-payment-admin.php:468
187 | #: admin/class-woocommerce-confirm-payment-customer-email-cancelled-payment.php:34
188 | #: admin/class-woocommerce-confirm-payment-customer-email-cancelled-payment.php:70
189 | msgid "Cancelled payment"
190 | msgstr ""
191 |
192 | #: admin/class-woocommerce-confirm-payment-customer-email-cancelled-payment.php:35
193 | msgid ""
194 | "This is an order notification sent to customers containing order details "
195 | "after admin cancelled payment."
196 | msgstr ""
197 |
198 | #: admin/class-woocommerce-confirm-payment-customer-email-cancelled-payment.php:60
199 | msgid "[{site_title}] Cancelled payment order ({order_number})"
200 | msgstr ""
201 |
202 | #: admin/class-woocommerce-confirm-payment-customer-email-completed-payment.php:35
203 | msgid ""
204 | "This is an order notification sent to customers containing order details "
205 | "after admin approved payment."
206 | msgstr ""
207 |
208 | #: admin/class-woocommerce-confirm-payment-customer-email-completed-payment.php:59
209 | msgid "[{site_title}] Your payment order ({order_number}) is success"
210 | msgstr ""
211 |
212 | #: admin/class-woocommerce-confirm-payment-customer-email-completed-payment.php:69
213 | msgid "Thank you for your payment."
214 | msgstr ""
215 |
216 | #: admin/class-woocommerce-confirm-payment-email-new-payment.php:32
217 | msgid "New confirm payment"
218 | msgstr ""
219 |
220 | #: admin/class-woocommerce-confirm-payment-email-new-payment.php:33
221 | msgid ""
222 | "This is a payment notification sent to admin containing payment details "
223 | "after customer confirm payment."
224 | msgstr ""
225 |
226 | #: admin/class-woocommerce-confirm-payment-email-new-payment.php:62
227 | msgid "[{site_title}] Confirm payment order {order_number}"
228 | msgstr ""
229 |
230 | #: admin/class-woocommerce-confirm-payment-email-new-payment.php:72
231 | msgid "Customer Confirm payment"
232 | msgstr ""
233 |
234 | #: admin/class-woocommerce-confirm-payment-email-new-payment.php:144
235 | msgid "Enable/Disable"
236 | msgstr ""
237 |
238 | #: admin/class-woocommerce-confirm-payment-email-new-payment.php:146
239 | msgid "Enable this email notification"
240 | msgstr ""
241 |
242 | #: admin/class-woocommerce-confirm-payment-email-new-payment.php:150
243 | msgid "Recipient(s)"
244 | msgstr ""
245 |
246 | #: admin/class-woocommerce-confirm-payment-email-new-payment.php:153
247 | #, php-format
248 | msgid "Enter recipients (comma separated) for this email. Defaults to %s."
249 | msgstr ""
250 |
251 | #: admin/class-woocommerce-confirm-payment-email-new-payment.php:159
252 | msgid "Subject"
253 | msgstr ""
254 |
255 | #: admin/class-woocommerce-confirm-payment-email-new-payment.php:163
256 | #: admin/class-woocommerce-confirm-payment-email-new-payment.php:172
257 | #, php-format
258 | msgid "Available placeholders: %s"
259 | msgstr ""
260 |
261 | #: admin/class-woocommerce-confirm-payment-email-new-payment.php:168
262 | msgid "Email heading"
263 | msgstr ""
264 |
265 | #: admin/class-woocommerce-confirm-payment-email-new-payment.php:177
266 | msgid "Email type"
267 | msgstr ""
268 |
269 | #: admin/class-woocommerce-confirm-payment-email-new-payment.php:179
270 | msgid "Choose which format of email to send."
271 | msgstr ""
272 |
273 | #: admin/class-woocommerce-confirm-payment-setting.php:91
274 | msgid "Woocommerce confirm payment settings"
275 | msgstr ""
276 |
277 | #: admin/class-woocommerce-confirm-payment-setting.php:92
278 | msgid "Setting"
279 | msgstr ""
280 |
281 | #: admin/class-woocommerce-confirm-payment-setting.php:104
282 | msgid "Confirm Payment Settings"
283 | msgstr ""
284 |
285 | #: admin/class-woocommerce-confirm-payment-setting.php:138
286 | msgid "Notification"
287 | msgstr ""
288 |
289 | #: admin/class-woocommerce-confirm-payment-setting.php:153
290 | msgid "Bank account"
291 | msgstr ""
292 |
293 | #: admin/class-woocommerce-confirm-payment-setting.php:161
294 | msgid "LINE Notify"
295 | msgstr ""
296 |
297 | #: admin/class-woocommerce-confirm-payment-setting.php:167
298 | msgid "Enable this line notification"
299 | msgstr ""
300 |
301 | #: admin/class-woocommerce-confirm-payment-setting.php:172
302 | msgid "Line Notify Token"
303 | msgstr ""
304 |
305 | #: admin/class-woocommerce-confirm-payment-setting.php:179
306 | #, php-format
307 | msgid "Generate token Click here"
308 | msgstr ""
309 |
310 | #: admin/class-woocommerce-confirm-payment-setting.php:238
311 | #, php-format
312 | msgid "For email notification settings, %sclick here to senting.%s"
313 | msgstr ""
314 |
315 | #: admin/partials/woocommerce-confirm-payment-admin-account-details-field.php:22
316 | msgid "logo"
317 | msgstr ""
318 |
319 | #: admin/partials/woocommerce-confirm-payment-admin-account-details-field.php:23
320 | msgid "Bank name"
321 | msgstr ""
322 |
323 | #: admin/partials/woocommerce-confirm-payment-admin-account-details-field.php:24
324 | #: public/partials/woocommerce-confirm-payment-bank-details.php:28
325 | msgid "Account number"
326 | msgstr ""
327 |
328 | #: admin/partials/woocommerce-confirm-payment-admin-account-details-field.php:25
329 | #: public/partials/woocommerce-confirm-payment-bank-details.php:31
330 | msgid "Account name"
331 | msgstr ""
332 |
333 | #: admin/partials/woocommerce-confirm-payment-admin-account-details-field.php:40
334 | msgid "Uplpad"
335 | msgstr ""
336 |
337 | #: admin/partials/woocommerce-confirm-payment-admin-account-details-field.php:61
338 | msgid "+ Add account"
339 | msgstr ""
340 |
341 | #: admin/partials/woocommerce-confirm-payment-admin-account-details-field.php:62
342 | msgid "Remove selected account(s)"
343 | msgstr ""
344 |
345 | #: includes/class-woocommerce-confirm-payment-activator.php:39
346 | msgid "Confirm Payment"
347 | msgstr ""
348 |
349 | #: public/class-woocommerce-confirm-payment-history.php:76
350 | msgid "Payment History"
351 | msgstr ""
352 |
353 | #: public/class-woocommerce-confirm-payment-public.php:200
354 | msgid "Enter your name"
355 | msgstr ""
356 |
357 | #: public/class-woocommerce-confirm-payment-public.php:201
358 | msgid "Enter your phone."
359 | msgstr ""
360 |
361 | #: public/class-woocommerce-confirm-payment-public.php:202
362 | msgid "Enter transfer date"
363 | msgstr ""
364 |
365 | #: public/class-woocommerce-confirm-payment-public.php:203
366 | msgid "Enter transfer time"
367 | msgstr ""
368 |
369 | #: public/class-woocommerce-confirm-payment-public.php:204
370 | msgid "Select bank transfer"
371 | msgstr ""
372 |
373 | #: public/class-woocommerce-confirm-payment-public.php:205
374 | msgid "Enter amount transfer"
375 | msgstr ""
376 |
377 | #: public/class-woocommerce-confirm-payment-public.php:208
378 | msgid "Enter order number"
379 | msgstr ""
380 |
381 | #: public/class-woocommerce-confirm-payment-public.php:216
382 | msgid "Upload transfer slip"
383 | msgstr ""
384 |
385 | #: public/class-woocommerce-confirm-payment-public.php:219
386 | msgid ""
387 | "This file type is not supported. You can only upload jpg, png, gif, pdf "
388 | "files."
389 | msgstr ""
390 |
391 | #: public/class-woocommerce-confirm-payment-public.php:265
392 | msgid "Successfully payment confirmation!"
393 | msgstr ""
394 |
395 | #: public/class-woocommerce-confirm-payment-public.php:311
396 | msgid ""
397 | "This order has been paid. Please wait for the confirmation from the store."
398 | msgstr ""
399 |
400 | #: public/class-woocommerce-confirm-payment-public.php:313
401 | msgid "This order has been successfully paid."
402 | msgstr ""
403 |
404 | #: public/class-woocommerce-confirm-payment-public.php:315
405 | msgid "This order is not in any payment status."
406 | msgstr ""
407 |
408 | #: public/class-woocommerce-confirm-payment-public.php:319
409 | msgid "This order does not require an informed your payment."
410 | msgstr ""
411 |
412 | #: public/class-woocommerce-confirm-payment-public.php:322
413 | msgid "Order not found"
414 | msgstr ""
415 |
416 | #: public/class-woocommerce-confirm-payment-public.php:345
417 | msgid "Amount"
418 | msgstr ""
419 |
420 | #: public/partials/woocommerce-confirm-payment-bank-details.php:18
421 | msgid "Our bank details"
422 | msgstr ""
423 |
424 | #: public/partials/woocommerce-confirm-payment-bank-details.php:35
425 | #, php-format
426 | msgid ""
427 | "After bank transfer, Please confirm your payment here Confirm "
428 | "payment"
429 | msgstr ""
430 |
431 | #: public/partials/woocommerce-confirm-payment-confirm-form.php:78
432 | msgid "Total"
433 | msgstr ""
434 |
435 | #: public/partials/woocommerce-confirm-payment-confirm-form.php:94
436 | msgid "Bank transfer"
437 | msgstr ""
438 |
439 | #: public/partials/woocommerce-confirm-payment-confirm-form.php:117
440 | msgid "dd/mm/yyyy"
441 | msgstr ""
442 |
443 | #: public/partials/woocommerce-confirm-payment-confirm-form.php:122
444 | msgid "Transfer time"
445 | msgstr ""
446 |
447 | #: public/partials/woocommerce-confirm-payment-confirm-form.php:124
448 | msgid "hh:mm"
449 | msgstr ""
450 |
451 | #: public/partials/woocommerce-confirm-payment-confirm-form.php:129
452 | #: public/partials/woocommerce-confirm-payment-email.php:50
453 | #: templates/emails/email-payment-detail.php:63
454 | msgid "Transfer slip"
455 | msgstr ""
456 |
457 | #: public/partials/woocommerce-confirm-payment-confirm-form.php:139
458 | msgid "Submit"
459 | msgstr ""
460 |
461 | #: public/partials/woocommerce-confirm-payment-email.php:33
462 | msgid "Time"
463 | msgstr ""
464 |
465 | #: public/partials/woocommerce-confirm-payment-history.php:43
466 | msgid "no slip"
467 | msgstr ""
468 |
469 | #: public/partials/woocommerce-confirm-payment-history.php:59
470 | msgid "No payment found."
471 | msgstr ""
472 |
473 | #: public/partials/woocommerce-confirm-payment-history.php:67
474 | msgid "Previous"
475 | msgstr ""
476 |
477 | #: public/partials/woocommerce-confirm-payment-history.php:71
478 | msgid "Next"
479 | msgstr ""
480 |
481 | #: templates/emails/admin-cancelled-payment.php:29
482 | #, php-format
483 | msgid ""
484 | "Submitted payment. Order number #%s has been cancelled. Due to your payment "
485 | "is not correct.Please submit your payment again. Confirm payment"
487 | msgstr ""
488 |
489 | #: templates/emails/admin-new-payment.php:28
490 | #, php-format
491 | msgid "You have received a payment from %s. The payment is as follows:"
492 | msgstr ""
493 |
494 | #: templates/emails/email-payment-detail.php:72
495 | msgid "View details"
496 | msgstr ""
497 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 |
294 | Copyright (C)
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | , 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
--------------------------------------------------------------------------------
/public/class-woocommerce-confirm-payment-public.php:
--------------------------------------------------------------------------------
1 |
22 | */
23 | class Woocommerce_Confirm_Payment_Public {
24 |
25 | /**
26 | * The ID of this plugin.
27 | *
28 | * @since 0.9.0
29 | * @access private
30 | * @var string $plugin_name The ID of this plugin.
31 | */
32 | private $plugin_name;
33 |
34 | /**
35 | * The version of this plugin.
36 | *
37 | * @since 0.9.0
38 | * @access private
39 | * @var string $version The current version of this plugin.
40 | */
41 | private $version;
42 |
43 |
44 | /**
45 | * bank_accounts
46 | *
47 | * @var array
48 | */
49 | private $bank_accounts = array();
50 |
51 | /**
52 | * line api url
53 | *
54 | * @var string
55 | */
56 | private $line_api;
57 |
58 | /**
59 | * Initialize the class and set its properties.
60 | *
61 | * @since 0.9.0
62 | * @param string $plugin_name The name of the plugin.
63 | * @param string $version The version of this plugin.
64 | */
65 | public function __construct( $plugin_name, $version ) {
66 |
67 | $this->plugin_name = $plugin_name;
68 | $this->version = $version;
69 | $this->bank_accounts = get_option( 'wcp_bank_accounts' );
70 | $this->options = get_option( 'wcp_option' );
71 | $this->line_api = 'https://notify-api.line.me/api/notify';
72 |
73 | $this->load_dependencies();
74 | }
75 |
76 |
77 | /**
78 | * Load the required dependencies for the Admin facing functionality.
79 | *
80 | * Include the following files that make up the plugin:
81 | *
82 | * - Woocommerce_Confirm_Payment_History.
83 | *
84 | *
85 | * @since 0.9.0
86 | * @access private
87 | */
88 | private function load_dependencies() {
89 |
90 | /**
91 | * The class responsible for orchestrating the actions and filters of the
92 | * core plugin.
93 | */
94 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-woocommerce-confirm-payment-history.php';
95 |
96 | }
97 |
98 | /**
99 | * Register the stylesheets for the public-facing side of the site.
100 | *
101 | * @since 0.9.0
102 | */
103 | public function enqueue_styles() {
104 |
105 | /**
106 | * This function is provided for demonstration purposes only.
107 | *
108 | * An instance of this class should be passed to the run() function
109 | * defined in Woocommerce_Confirm_Payment_Loader as all of the hooks are defined
110 | * in that particular class.
111 | *
112 | * The Woocommerce_Confirm_Payment_Loader will then create the relationship
113 | * between the defined hooks and the functions defined in this
114 | * class.
115 | */
116 | wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/woocommerce-confirm-payment-public.css', array(), $this->version, 'all' );
117 |
118 | }
119 |
120 | /**
121 | * Register the JavaScript for the public-facing side of the site.
122 | *
123 | * @since 0.9.0
124 | */
125 | public function enqueue_scripts() {
126 |
127 | /**
128 | * This function is provided for demonstration purposes only.
129 | *
130 | * An instance of this class should be passed to the run() function
131 | * defined in Woocommerce_Confirm_Payment_Loader as all of the hooks are defined
132 | * in that particular class.
133 | *
134 | * The Woocommerce_Confirm_Payment_Loader will then create the relationship
135 | * between the defined hooks and the functions defined in this
136 | * class.
137 | */
138 |
139 | wp_enqueue_script( $this->plugin_name . '-modernizr', plugin_dir_url( __FILE__ ) . 'js/modernizr-custom.js', array( 'jquery' ), $this->version, false );
140 | wp_enqueue_script( $this->plugin_name . '-jquery-form', plugin_dir_url( __FILE__ ) . 'js/jquery.form.js', array( 'jquery' ), $this->version, false );
141 | wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/woocommerce-confirm-payment-public.js', array( 'jquery' ), $this->version, false );
142 |
143 | wp_localize_script( $this->plugin_name, 'WCP', array(
144 | 'ajaxurl' => admin_url( 'admin-ajax.php' ),
145 | 'check_order_nonce' => wp_create_nonce( 'wcp_check_order_nonce' ),
146 | 'cleave' => plugin_dir_url( __FILE__ ) . 'js/cleave.min.js',
147 | 'current_date' => current_time( 'd-m-Y' ),
148 | 'i18n' => array(
149 | 'maximum_upload_file' => __( 'Maximum upload file size 2 MB.', 'woocommerce-confirm-payment' )
150 | )
151 | ));
152 |
153 | }
154 |
155 | public function add_shortcode() {
156 |
157 | add_shortcode( 'wcp_confirm_payment_form', array( $this, 'print_confirm_payment_form' ) );
158 | add_shortcode( 'wcp_confirm_payment_button', array( $this, 'print_confirm_payment_button' ) );
159 |
160 | }
161 |
162 | public function print_confirm_payment_form( $atts, $content = '' ) {
163 |
164 | ob_start();
165 |
166 | include( 'partials/woocommerce-confirm-payment-confirm-form.php' );
167 |
168 | $html = ob_get_contents();
169 | ob_end_clean();
170 |
171 | return $html;
172 |
173 | }
174 |
175 | public function print_confirm_payment_button( $atts, $content = '' ) {
176 |
177 | return sprintf(
178 | '%s',
179 | empty( $atts['order_id'] ) ? wcp_get_confirm_payment_url() : wcp_get_confirm_payment_url( $atts['order_id'] ),
180 | __( 'Confirm payment', 'woocommerce-confirm-payment' )
181 | );
182 |
183 | }
184 |
185 |
186 | public function confirm_payment() {
187 |
188 | check_ajax_referer( 'wcp_form_nonce_action', 'wcp_form_security_nonce' );
189 |
190 | $errors = array();
191 | $success = '';
192 | $check_icon = '';
193 | $allowed_slip = array( 'image/jpeg', 'image/gif', 'image/png', 'application/pdf' );
194 | $name = sanitize_text_field( $_POST['name'] );
195 | $phone = sanitize_text_field( $_POST['phone'] );
196 | $date = sanitize_text_field( $_POST['date'] );
197 | $time = sanitize_text_field( $_POST['time'] );
198 | $bank = sanitize_text_field( $_POST['bank'] );
199 | $amount = absint( $_POST['amount'] );
200 | $slip = $_FILES['slip'];
201 | $order_id = absint( $_POST['order'] );
202 |
203 | if ( ! $name ) $errors['name'] = __( 'Enter your name', 'woocommerce-confirm-payment' );
204 | if ( ! $phone ) $errors['phone'] = __( 'Enter your phone.', 'woocommerce-confirm-payment' );
205 | if ( ! $date ) $errors['date'] = __( 'Enter transfer date', 'woocommerce-confirm-payment' );
206 | if ( ! $time ) $errors['time'] = __( 'Enter transfer time', 'woocommerce-confirm-payment' );
207 | if ( ! $bank ) $errors['bank'] = __( 'Select bank transfer', 'woocommerce-confirm-payment' );
208 | if ( ! $amount ) $errors['amount'] = __( 'Enter amount transfer', 'woocommerce-confirm-payment' );
209 |
210 | if ( ! $order_id ){
211 | $errors['order'] = __( 'Enter order number', 'woocommerce-confirm-payment' );
212 | } else {
213 | if ( $this->check_order( $order_id ) ) {
214 | $errors['order'] = $this->check_order( $order_id );
215 | }
216 | }
217 |
218 | if ( ! $slip && ! empty( $this->options['transfer_slip_required'] ) ){
219 | $errors['slip'] = __( 'Upload transfer slip', 'woocommerce-confirm-payment' );
220 | }
221 |
222 | if ( $slip && ! in_array( $slip['type'], $allowed_slip ) ) {
223 | $errors['slip'] = __( 'This file type is not supported. You can only upload jpg, png, gif, pdf files.', 'woocommerce-confirm-payment' );
224 | }
225 |
226 | if ( empty( $errors ) ) {
227 |
228 | $post_id = wp_insert_post( array(
229 | 'post_type' => 'wcp_confirm_payment',
230 | 'post_title' => wp_strip_all_tags( $name ),
231 | 'post_status' => 'wcp-pending_confirm',
232 | 'post_author' => 1,
233 | ) );
234 |
235 | update_post_meta( $post_id, '_wcp_payment_date', date_i18n( 'Y-m-d H:i', strtotime( str_replace( '/', '-', $date . ' ' . $time ) ) ) );
236 | update_post_meta( $post_id, '_wcp_payment_phone', $phone );
237 | update_post_meta( $post_id, '_wcp_payment_bank', $bank );
238 | update_post_meta( $post_id, '_wcp_payment_amount', $amount );
239 | update_post_meta( $post_id, '_wcp_payment_order_id', $order_id );
240 | update_post_meta( $post_id, '_wcp_payment_user_id', ( is_user_logged_in() ? get_current_user_id() : 'guest' ) );
241 | update_post_meta( $order_id,'_wcp_order_payment_id', $post_id );
242 |
243 | if ( $post_id != 0 && $slip ){
244 |
245 | if ( !function_exists('wp_generate_attachment_metadata') ){
246 | require_once(ABSPATH . "wp-admin" . '/includes/image.php');
247 | require_once(ABSPATH . "wp-admin" . '/includes/file.php');
248 | require_once(ABSPATH . "wp-admin" . '/includes/media.php');
249 | }
250 |
251 | $attachment_id = media_handle_upload( 'slip', $post_id, array( 'post_title' => 'Payment slip #' . $order_id ) );
252 |
253 | if ( is_wp_error( $attachment_id ) ) {
254 |
255 | $errors['attachment'] = $attachment_id->get_error_message();
256 |
257 | wp_delete_post( $post_id );
258 |
259 | }else{
260 |
261 | update_post_meta( $post_id,'_thumbnail_id', $attachment_id );
262 | update_post_meta( $attachment_id,'_wcp_payment_slip', $post_id );
263 |
264 | }
265 |
266 | }
267 |
268 | if ( empty( $errors ) ) {
269 |
270 | $this->payment_complete( $post_id );
271 |
272 | $check_icon = '';
273 | $success = sprintf( '