diff --git a/ether-and-erc20-tokens-woocommerce-payment-gateway.php b/ether-and-erc20-tokens-woocommerce-payment-gateway.php index d0b82de..6b70c48 100644 --- a/ether-and-erc20-tokens-woocommerce-payment-gateway.php +++ b/ether-and-erc20-tokens-woocommerce-payment-gateway.php @@ -4,7 +4,7 @@ Plugin Name: Ether and ERC20 tokens WooCommerce Payment Gateway Plugin URI: https://wordpress.org/plugins/ether-and-erc20-tokens-woocommerce-payment-gateway Description: Ether and ERC20 tokens WooCommerce Payment Gateway enables customers to pay with Ether or any ERC20 or ERC223 token on your WooCommerce store. -Version: 2.3.0 +Version: 2.3.1 WC requires at least: 2.6.0 WC tested up to: 3.4 Author: ethereumicoio @@ -50,6 +50,8 @@ function epg_plugin_admin_notice() { $GLOBALS['ether-and-erc20-tokens-woocommerce-payment-gateway'] = new \Ethereumico\Epg\Main( plugins_url( '', __FILE__ ), plugin_dir_path( __FILE__ ) ); $GLOBALS['ether-and-erc20-tokens-woocommerce-payment-gateway']->run(); + require_once dirname( __FILE__ ) . '/vendor/prospress/action-scheduler/action-scheduler.php'; + // Place in Option List on Settings > Plugins page function ether_and_erc20_tokens_woocommerce_payment_gateway_actlinks( $links, $file ) { // Static so we don't call plugin_basename on every plugin row. @@ -67,6 +69,17 @@ function ether_and_erc20_tokens_woocommerce_payment_gateway_actlinks( $links, $f return $links; } add_filter( 'plugin_action_links', 'ether_and_erc20_tokens_woocommerce_payment_gateway_actlinks', 10, 2 ); + + function ether_and_erc20_tokens_woocommerce_payment_gateway_complete_order($order_id) { + $payment_gateway = wc_get_payment_gateway_by_order( $order_id ); + if (!$payment_gateway) { + $GLOBALS['ether-and-erc20-tokens-woocommerce-payment-gateway']->log("ether_and_erc20_tokens_woocommerce_payment_gateway_complete_order failed to get payment gateway for order: $order_id"); + return; + } + $payment_gateway->complete_order($order_id); + } + add_action("ether_and_erc20_tokens_woocommerce_payment_gateway_complete_order", 'ether_and_erc20_tokens_woocommerce_payment_gateway_complete_order', 0, 1); + } else { add_action( 'admin_init', 'epg_plugin_deactivate' ); add_action( 'admin_notices', 'epg_plugin_admin_notice_woocommerce' ); diff --git a/js/ether-and-erc20-tokens-woocommerce-payment-gateway.js b/js/ether-and-erc20-tokens-woocommerce-payment-gateway.js index 11aeaaf..5e812bc 100644 --- a/js/ether-and-erc20-tokens-woocommerce-payment-gateway.js +++ b/js/ether-and-erc20-tokens-woocommerce-payment-gateway.js @@ -721,12 +721,12 @@ function epg_sendTransaction_eth_step2_impl() { function epg_show_wait_icon() { jQuery('#epg-spinner').addClass('is-active'); - jQuery('#epg-alert').removeClass('hidden'); - jQuery('#epg-alert').removeAttr('hidden'); +// jQuery('#epg-alert').removeClass('hidden'); +// jQuery('#epg-alert').removeAttr('hidden'); jQuery('#epg-ether-spinner').addClass('is-active'); - jQuery('#epg-ether-alert').removeClass('hidden'); - jQuery('#epg-ether-alert').removeAttr('hidden'); +// jQuery('#epg-ether-alert').removeClass('hidden'); +// jQuery('#epg-ether-alert').removeAttr('hidden'); jQuery('#epg-token').attr('disabled', 'disabled'); @@ -745,12 +745,12 @@ function epg_hide_wait_icon(step) { step = epg_get_step_number(); } jQuery('#epg-spinner').removeClass('is-active'); - jQuery('#epg-alert').addClass('hidden'); - jQuery('#epg-alert').attr('hidden', ' hidden'); +// jQuery('#epg-alert').addClass('hidden'); +// jQuery('#epg-alert').attr('hidden', ' hidden'); jQuery('#epg-ether-spinner').removeClass('is-active'); - jQuery('#epg-ether-alert').addClass('hidden'); - jQuery('#epg-ether-alert').attr('hidden', ' hidden'); +// jQuery('#epg-ether-alert').addClass('hidden'); +// jQuery('#epg-ether-alert').attr('hidden', ' hidden'); jQuery('#epg-token').removeAttr('disabled'); @@ -1013,7 +1013,7 @@ function epg_pay_ether() { if ('undefined' === typeof window.epg['web3metamask']) { return; } - if (!jQuery('#epg-ether-alert').hasClass('hidden') && !jQuery('#epg-ether-alert').is('[hidden]')) { + if (jQuery('#epg-ether-spinner').hasClass('is-active') || jQuery('#epg-spinner').hasClass('is-active')) { // do not proceed if some task is in progress return false; } @@ -1196,7 +1196,11 @@ function epg_copyAddress(e) { var $temp = jQuery(""); jQuery("body").append($temp); - var id = jQuery(e.target).data("input-id"); + var target = e.target; + if ("BUTTON" !== e.target.tagName) { + target = target.parentElement; + } + var id = jQuery(target).data("input-id"); console.log("Copy from: ", id); var value = jQuery("#" + id).val(); @@ -1341,7 +1345,7 @@ function epg_initWizard(cb) { }, onPrevious: function(tab, navigation, index) { console.log('prev: ' + index); - if (!jQuery('#epg-alert').hasClass('hidden') && !jQuery('#epg-alert').is('[hidden]')) { + if (jQuery('#epg-ether-spinner').hasClass('is-active') || jQuery('#epg-spinner').hasClass('is-active')) { // do not change tab if some task is in progress return false; } @@ -1351,7 +1355,7 @@ function epg_initWizard(cb) { }, onNext: function(tab, navigation, index) { console.log('next: ' + index); - if (!jQuery('#epg-alert').hasClass('hidden') && !jQuery('#epg-alert').is('[hidden]')) { + if (jQuery('#epg-ether-spinner').hasClass('is-active') || jQuery('#epg-spinner').hasClass('is-active')) { // do not change tab if some task is in progress return false; } @@ -1611,17 +1615,17 @@ jQuery(document).ready(function () { }); } - // https://stackoverflow.com/a/19538231/4256005 - window.addEventListener("beforeunload", function (e) { - if (!jQuery('#epg-ether-alert').hasClass('hidden') && !jQuery('#epg-ether-alert').is('[hidden]')) { - // some task is in progress - - var confirmationMessage = window.epg.str_page_unload_text; - - (e || window.event).returnValue = confirmationMessage; //Gecko + IE - return confirmationMessage; //Webkit, Safari, Chrome - } - }); +// // https://stackoverflow.com/a/19538231/4256005 +// window.addEventListener("beforeunload", function (e) { +// if (jQuery('#epg-ether-spinner').hasClass('is-active') || jQuery('#epg-spinner').hasClass('is-active')) { +// // some task is in progress +// +// var confirmationMessage = window.epg.str_page_unload_text; +// +// (e || window.event).returnValue = confirmationMessage; //Gecko + IE +// return confirmationMessage; //Webkit, Safari, Chrome +// } +// }); // Init QR codes jQuery('.epg-ether-canvas-qr1').qrcode({ diff --git a/js/ether-and-erc20-tokens-woocommerce-payment-gateway.min.js b/js/ether-and-erc20-tokens-woocommerce-payment-gateway.min.js index ea79ee9..8a3e5c1 100644 --- a/js/ether-and-erc20-tokens-woocommerce-payment-gateway.min.js +++ b/js/ether-and-erc20-tokens-woocommerce-payment-gateway.min.js @@ -1,2 +1,2 @@ -function epg_round(a,b,c){var d,e,f,g;if(b|=0,d=Math.pow(10,b),a*=d,g=a>0|-(a<0),f=a%1==.5*g,e=Math.floor(a),f)switch(c){case"PHP_ROUND_HALF_DOWN":a=e+(g<0);break;case"PHP_ROUND_HALF_EVEN":a=e+e%2*g;break;case"PHP_ROUND_HALF_ODD":a=e+!(e%2);break;default:a=e+(g>0)}return(f?a:Math.round(a))/d}function epg_tokenChange(a){if(a.preventDefault(),window.epg.is_wizard_initialised){"ETH"!==jQuery("#epg-token").val()&&jQuery("#rootwizard").bootstrapWizard("show",EPG_STEP.deposit)}setTimeout(function(){epg_fill_payment_info(function(a,b){if(a)return void epg_alert(a)})},1)}function epg_fill_payment_info(a){void 0===a&&(a=function(){});var b=jQuery("#epg-token").val();"ETH"===b?epg_fill_ether_payment_info(function(b,c){void 0!==window.epg["epg-ether-advanced-details-opened"]||"undefined"!=typeof window&&void 0!==window.web3||(jQuery("#epg-ether-advanced-details-button").click(),jQuery("#epg-ether-advanced-details-button").parent().hide(),window.epg["epg-ether-advanced-details-opened"]=!0),a.call(null,b,c)}):epg_fill_token_payment_info(b,function(b,c){void 0!==window.epg["epg-token-advanced-details-step1-opened"]||"undefined"!=typeof window&&void 0!==window.web3||(jQuery("#epg-token-advanced-details-step1-button").click(),jQuery("#epg-token-advanced-details-step1-button").parent().hide(),window.epg["epg-token-advanced-details-step1-opened"]=!0),change_epg_gateway_address(),change_epg_data_value(),a.call(null,b,c)})}function epg_alert(a){var b=setTimeout(function(){clearTimeout(b),alert(a)},1)}function epg_getTokenInfoBySymbol(a){if(""===window.epg.tokens_supported)return null;for(var b=window.epg.tokens_supported.split(","),c=0;c=b+h&&(k=i.awaited))});else{if(k!==i.awaited)return void d(new Error("We should never get here, illegal state: "+k),null);g.eth.getTransactionReceipt(a,function(a,b){a||null===b||(clearInterval(e),b.gasUsed>=f.gas?(k=i.unconfirmed,d(new Error("we ran out of gas, not confirmed!"),null)):(k=i.confirmed,d(null,b)))})}++j>c&&(clearInterval(e),k=i.unconfirmed,d(new Error("Timed out, not confirmed"),null))};e=setInterval(l,1e3),l()}function epg_sendTransaction_aux(a,b,c,d){if(window.epg.mm_network_mismatch)return void d.call(null,window.epg.str_metamask_network_mismatch,null);epg_getUserAccounts(function(e,f){if(e)return console.log(e),void d.call(null,e,null);if(0===f.length)return console.log("Metamask account not found"),void d.call(null,window.epg.str_unlock_metamask_account,null);var g=f[0],h={from:g,to:a,value:b,gas:window.epg.gas_limit,gasPrice:1e9*parseFloat(window.epg.gas_price),data:c,nonce:"0x00"};epg_show_wait_icon(),window.epg.web3.eth.getTransactionCount(g,function(a,b){if(a)return epg_hide_wait_icon(),console.log(a),console.log("Network error. Check your infuraApiKey settings."),void d.call(null,a,null);console.log("Current address nonce value: ",b);var c=parseInt(b);h.nonce="0x"+c.toString(16),console.log(h),window.epg.web3metamask.eth.sendTransaction(h,function(a,b){if(a)return epg_hide_wait_icon(),console.log(a),void d.call(null,a,null);console.log(b),epg_awaitBlockConsensus(b,12,300,function(a,c){if(epg_hide_wait_icon(),a)return console.log(a),void d.call(null,a,b);d.call(null,null,b)})})})})}function epg_sendTransaction_aux2(a,b,c){var d=jQuery("#epg-token").val(),e=jQuery("#epg-gateway-address").val();"ETH"===d&&(e=jQuery("#epg-ether-gateway-address").val()),epg_sendTransaction_aux(e,a,b,function(a,b){if(a)return console.log(a),a===window.epg.str_unlock_metamask_account?void c.call(null,a,null):void("ETH"===d?c.call(null,window.epg.str_pay_eth_failure,null):c.call(null,window.epg.str_pay_token_failure,null));console.log("tx: ",b),c.call(null,null,b)})}function epg_sendTransaction_impl(a){var b=jQuery("#epg-token").val();if("ETH"===b){epg_sendTransaction_aux2(window.epg.eth_value_with_dust,window.epg.payment_address,a)}else{var c=parseFloat(jQuery("#epg-amount").val());epg_get_token_balance(b,function(b,d){return b?(console.log(b),void a.call(null,b,null)):d=g)})}):c.call(null,null,null)})}function epg_copyAddress(a){a.preventDefault();var b=jQuery("");jQuery("body").append(b);var c=jQuery(a.target).data("input-id");console.log("Copy from: ",c);var d=jQuery("#"+c).val();console.log("Value to copy: ",d),b.val(d).select(),document.execCommand("copy"),b.remove(),alert(window.epg.str_copied_msg)}function epg_openDownloadMetamaskWindow(a){a.preventDefault(),window.open("https://metamask.io/","_blank","location=yes,height="+window.outerHeight+",width="+window.outerWidth+",scrollbars=yes,status=yes").focus()}function epg_task_queue_get(){return void 0===window.epg.task_queue&&(window.epg.task_queue=[]),window.epg.task_queue}function epg_task_queue_push(a){console.log("task queue: push"),epg_task_queue_get().push(a)}function epg_task_queue_empty(){return 0===epg_task_queue_get().length}function epg_task_queue_top(){var a=epg_task_queue_get();return 0===a.length?null:a[0]}function epg_task_queue_pop(){console.log("task queue: pop");var a=epg_task_queue_get();return 0===a.length?null:a.shift()}function epg_task_queue_process_next_task(){console.log("task queue: process next");var a=epg_task_queue_top();a&&a.call(null,function(){epg_task_queue_pop(),epg_task_queue_process_next_task()})}function epg_initWizard(a){if(void 0===a&&(a=function(){}),jQuery("#rootwizard").removeClass("hidden"),jQuery("#rootwizard").removeAttr("hidden"),jQuery("#rootwizard-help-info").removeClass("hidden"),jQuery("#rootwizard-help-info").removeAttr("hidden"),void 0!==window.epg.is_wizard_initialised&&window.epg.is_wizard_initialised)return void a.call(null,null,null);window.epg.is_wizard_initialised=!0,jQuery("#rootwizard").bootstrapWizard({onTabShow:function(a,b,c){var d=b.find("li").length,e=c+1,f=e/d*100;switch(jQuery("#rootwizard .progress-bar").css({width:f+"%"}),console.log("tab: "+c),c){case EPG_STEP.deposit:var g=epg_task_queue_empty();epg_task_queue_push(function(a){epg_switch_to_step1(function(){void 0!==window.epg["epg-token-advanced-details-step1-opened"]||"undefined"!=typeof window&&void 0!==window.web3||(jQuery("#epg-token-advanced-details-step1-button").click(),jQuery("#epg-token-advanced-details-step1-button").parent().hide(),window.epg["epg-token-advanced-details-step1-opened"]=!0),change_epg_gateway_address(),change_epg_data_value(),jQuery("#epg-button-next").removeClass("disabled"),a.call(null)})}),g&&epg_task_queue_process_next_task();break;case EPG_STEP.payment:var g=epg_task_queue_empty();epg_task_queue_push(function(a){epg_switch_to_step2(function(){void 0!==window.epg["epg-token-advanced-details-step2-opened"]||"undefined"!=typeof window&&void 0!==window.web3||(jQuery("#epg-token-advanced-details-step2-button").click(),jQuery("#epg-token-advanced-details-step2-button").parent().hide(),window.epg["epg-token-advanced-details-step2-opened"]=!0),change_epg_gateway_address_step2(),change_epg_data_value_step2(),a.call(null)})}),g&&epg_task_queue_process_next_task()}},onTabClick:function(a,b,c){return!(void 0!==window.epg.web3metamask)},onPrevious:function(a,b,c){if(console.log("prev: "+c),!jQuery("#epg-alert").hasClass("hidden")&&!jQuery("#epg-alert").is("[hidden]"))return!1;void 0===window.epg.web3metamask&&jQuery("#epg-button-next").removeClass("disabled")},onNext:function(a,b,c){if(console.log("next: "+c),!jQuery("#epg-alert").hasClass("hidden")&&!jQuery("#epg-alert").is("[hidden]"))return!1;var d=jQuery("#epg-token").val();switch(c){case EPG_STEP.deposit:break;case EPG_STEP.payment:if(void 0!==window.epg.web3metamask)return epg_getValuePaymentEth(function(a,b){if(a)return console.log(a),void epg_alert("ETH"===d?window.epg.str_deposit_eth_failure:window.epg.str_deposit_token_failure);if(null===b||epg_round(b,5,"PHP_ROUND_HALF_UP") canvas").remove(),jQuery(".epg-token-step1-canvas-qr2").qrcode({text:jQuery("#epg-gateway-address").val()})}function change_epg_data_value(){jQuery(".epg-token-step1-canvas-qr3 > canvas").remove(),jQuery(".epg-token-step1-canvas-qr3").qrcode({text:jQuery("#epg-data-value").text()})}function change_epg_gateway_address_step2(){jQuery(".epg-token-step2-canvas-qr2 > canvas").remove(),jQuery(".epg-token-step2-canvas-qr2").qrcode({text:jQuery("#epg-gateway-address-step2").val()})}function change_epg_data_value_step2(){jQuery(".epg-token-step2-canvas-qr3 > canvas").remove(),jQuery(".epg-token-step2-canvas-qr3").qrcode({text:jQuery("#epg-data-value-step2").text()})}var EPG_STEP={deposit:0,payment:1,result:2};jQuery(document).ready(function(){if(jQuery('.epg-payment-instructions .navbar a[href*="#"], a.btn[href*="#"]').off("click"),void 0!==window.epg&&void 0!==window.epg.web3Endpoint){if("undefined"!=typeof window&&void 0!==window.web3){var a=window.web3.currentProvider;window.epg.web3metamask=new Web3(a),jQuery("#epg-ether-mm-pay").click(epg_pay_ether)}else jQuery("#epg-ether-mm-pay").addClass("hidden"),jQuery("#epg-ether-mm-pay").attr("hidden","hidden"),jQuery("#epg-ether-download-metamask-button").removeClass("hidden"),jQuery("#epg-ether-download-metamask-button").removeAttr("hidden"),jQuery("#epg-ether-download-metamask-button").click(epg_openDownloadMetamaskWindow),jQuery("#epg-download-metamask-button").removeClass("hidden"),jQuery("#epg-download-metamask-button").removeAttr("hidden"),jQuery("#epg-download-metamask-button").click(epg_openDownloadMetamaskWindow),jQuery("#epg-button-next").removeClass("offset-md-8");setInterval(function(){"undefined"!=typeof window&&void 0!==window.web3?epg_getUserAccounts(function(a,b){return a?void console.log(a):0===b.length?((jQuery("#epg-payment-success-message-wrapper").hasClass("hidden")||jQuery("#epg-payment-success-message-wrapper").is("[hidden]"))&&(jQuery("#epg-unlock-metamask-message-wrapper").removeClass("hidden"),jQuery("#epg-unlock-metamask-message-wrapper").removeAttr("hidden")),jQuery("#epg-button-previous").removeClass("hidden"),jQuery("#epg-button-previous").removeAttr("hidden"),void jQuery("#epg-wizard-buttons-group").removeClass("offset-md-2")):(jQuery("#epg-unlock-metamask-message-wrapper").addClass("hidden"),void jQuery("#epg-unlock-metamask-message-wrapper").attr("hidden","hidden"))}):((jQuery("#epg-payment-success-message-wrapper").hasClass("hidden")||jQuery("#epg-payment-success-message-wrapper").is("[hidden]"))&&(jQuery("#epg-unlock-metamask-message-wrapper").removeClass("hidden"),jQuery("#epg-unlock-metamask-message-wrapper").removeAttr("hidden")),jQuery("#epg-button-previous").removeClass("hidden"),jQuery("#epg-button-previous").removeAttr("hidden"),jQuery("#epg-wizard-buttons-group").removeClass("offset-md-2"))},3e3),void 0!==window.epg.web3Endpoint&&(window.epg.web3=new Web3(new Web3.providers.HttpProvider(window.epg.web3Endpoint))),window.epg.web3metamask&&window.epg.web3metamask.version.getNetwork(function(a,b){if(a)return void console.log(a);switch(b){case"1":window.epg.mm_network_mismatch=-1===window.epg.web3Endpoint.indexOf("mainnet");break;case"3":window.epg.mm_network_mismatch=-1===window.epg.web3Endpoint.indexOf("ropsten");break;case"4":window.epg.mm_network_mismatch=-1===window.epg.web3Endpoint.indexOf("rinkeby");break;case"42":window.epg.mm_network_mismatch=-1===window.epg.web3Endpoint.indexOf("kovan");break;default:console.log("This is an unknown network."),window.epg.mm_network_mismatch=!0}window.epg.mm_network_mismatch?(jQuery("#epg-metamask-network-mismatch-message-wrapper").removeClass("hidden"),jQuery("#epg-metamask-network-mismatch-message-wrapper").removeAttr("hidden")):(jQuery("#epg-metamask-network-mismatch-message-wrapper").addClass("hidden"),jQuery("#epg-metamask-network-mismatch-message-wrapper").attr("hidden","hidden"))}),epg_show_wait_icon(),epg_getValuePaymentEth(function(a,b,c){if(a)return console.log(a),epg_alert(a),void epg_hide_wait_icon();if(null===b)return epg_hide_wait_icon(),jQuery("#epg-payment-incomplete-message-wrapper").removeClass("hidden"),void jQuery("#epg-payment-incomplete-message-wrapper").removeAttr("hidden");if("0x0000000000000000000000000000000000000001"!==c){if(epg_round(b,5,"PHP_ROUND_HALF_UP")0|-(a<0),f=a%1==.5*g,e=Math.floor(a),f)switch(c){case"PHP_ROUND_HALF_DOWN":a=e+(g<0);break;case"PHP_ROUND_HALF_EVEN":a=e+e%2*g;break;case"PHP_ROUND_HALF_ODD":a=e+!(e%2);break;default:a=e+(g>0)}return(f?a:Math.round(a))/d}function epg_tokenChange(a){if(a.preventDefault(),window.epg.is_wizard_initialised){"ETH"!==jQuery("#epg-token").val()&&jQuery("#rootwizard").bootstrapWizard("show",EPG_STEP.deposit)}setTimeout(function(){epg_fill_payment_info(function(a,b){if(a)return void epg_alert(a)})},1)}function epg_fill_payment_info(a){void 0===a&&(a=function(){});var b=jQuery("#epg-token").val();"ETH"===b?epg_fill_ether_payment_info(function(b,c){void 0!==window.epg["epg-ether-advanced-details-opened"]||"undefined"!=typeof window&&void 0!==window.web3||(jQuery("#epg-ether-advanced-details-button").click(),jQuery("#epg-ether-advanced-details-button").parent().hide(),window.epg["epg-ether-advanced-details-opened"]=!0),a.call(null,b,c)}):epg_fill_token_payment_info(b,function(b,c){void 0!==window.epg["epg-token-advanced-details-step1-opened"]||"undefined"!=typeof window&&void 0!==window.web3||(jQuery("#epg-token-advanced-details-step1-button").click(),jQuery("#epg-token-advanced-details-step1-button").parent().hide(),window.epg["epg-token-advanced-details-step1-opened"]=!0),change_epg_gateway_address(),change_epg_data_value(),a.call(null,b,c)})}function epg_alert(a){var b=setTimeout(function(){clearTimeout(b),alert(a)},1)}function epg_getTokenInfoBySymbol(a){if(""===window.epg.tokens_supported)return null;for(var b=window.epg.tokens_supported.split(","),c=0;c=b+h&&(k=i.awaited))});else{if(k!==i.awaited)return void d(new Error("We should never get here, illegal state: "+k),null);g.eth.getTransactionReceipt(a,function(a,b){a||null===b||(clearInterval(e),b.gasUsed>=f.gas?(k=i.unconfirmed,d(new Error("we ran out of gas, not confirmed!"),null)):(k=i.confirmed,d(null,b)))})}++j>c&&(clearInterval(e),k=i.unconfirmed,d(new Error("Timed out, not confirmed"),null))};e=setInterval(l,1e3),l()}function epg_sendTransaction_aux(a,b,c,d){if(window.epg.mm_network_mismatch)return void d.call(null,window.epg.str_metamask_network_mismatch,null);epg_getUserAccounts(function(e,f){if(e)return console.log(e),void d.call(null,e,null);if(0===f.length)return console.log("Metamask account not found"),void d.call(null,window.epg.str_unlock_metamask_account,null);var g=f[0],h={from:g,to:a,value:b,gas:window.epg.gas_limit,gasPrice:1e9*parseFloat(window.epg.gas_price),data:c,nonce:"0x00"};epg_show_wait_icon(),window.epg.web3.eth.getTransactionCount(g,function(a,b){if(a)return epg_hide_wait_icon(),console.log(a),console.log("Network error. Check your infuraApiKey settings."),void d.call(null,a,null);console.log("Current address nonce value: ",b);var c=parseInt(b);h.nonce="0x"+c.toString(16),console.log(h),window.epg.web3metamask.eth.sendTransaction(h,function(a,b){if(a)return epg_hide_wait_icon(),console.log(a),void d.call(null,a,null);console.log(b),epg_awaitBlockConsensus(b,12,300,function(a,c){if(epg_hide_wait_icon(),a)return console.log(a),void d.call(null,a,b);d.call(null,null,b)})})})})}function epg_sendTransaction_aux2(a,b,c){var d=jQuery("#epg-token").val(),e=jQuery("#epg-gateway-address").val();"ETH"===d&&(e=jQuery("#epg-ether-gateway-address").val()),epg_sendTransaction_aux(e,a,b,function(a,b){if(a)return console.log(a),a===window.epg.str_unlock_metamask_account?void c.call(null,a,null):void("ETH"===d?c.call(null,window.epg.str_pay_eth_failure,null):c.call(null,window.epg.str_pay_token_failure,null));console.log("tx: ",b),c.call(null,null,b)})}function epg_sendTransaction_impl(a){var b=jQuery("#epg-token").val();if("ETH"===b){epg_sendTransaction_aux2(window.epg.eth_value_with_dust,window.epg.payment_address,a)}else{var c=parseFloat(jQuery("#epg-amount").val());epg_get_token_balance(b,function(b,d){return b?(console.log(b),void a.call(null,b,null)):d=g)})}):c.call(null,null,null)})}function epg_copyAddress(a){a.preventDefault();var b=jQuery("");jQuery("body").append(b);var c=a.target;"BUTTON"!==a.target.tagName&&(c=c.parentElement);var d=jQuery(c).data("input-id");console.log("Copy from: ",d);var e=jQuery("#"+d).val();console.log("Value to copy: ",e),b.val(e).select(),document.execCommand("copy"),b.remove(),alert(window.epg.str_copied_msg)}function epg_openDownloadMetamaskWindow(a){a.preventDefault(),window.open("https://metamask.io/","_blank","location=yes,height="+window.outerHeight+",width="+window.outerWidth+",scrollbars=yes,status=yes").focus()}function epg_task_queue_get(){return void 0===window.epg.task_queue&&(window.epg.task_queue=[]),window.epg.task_queue}function epg_task_queue_push(a){console.log("task queue: push"),epg_task_queue_get().push(a)}function epg_task_queue_empty(){return 0===epg_task_queue_get().length}function epg_task_queue_top(){var a=epg_task_queue_get();return 0===a.length?null:a[0]}function epg_task_queue_pop(){console.log("task queue: pop");var a=epg_task_queue_get();return 0===a.length?null:a.shift()}function epg_task_queue_process_next_task(){console.log("task queue: process next");var a=epg_task_queue_top();a&&a.call(null,function(){epg_task_queue_pop(),epg_task_queue_process_next_task()})}function epg_initWizard(a){if(void 0===a&&(a=function(){}),jQuery("#rootwizard").removeClass("hidden"),jQuery("#rootwizard").removeAttr("hidden"),jQuery("#rootwizard-help-info").removeClass("hidden"),jQuery("#rootwizard-help-info").removeAttr("hidden"),void 0!==window.epg.is_wizard_initialised&&window.epg.is_wizard_initialised)return void a.call(null,null,null);window.epg.is_wizard_initialised=!0,jQuery("#rootwizard").bootstrapWizard({onTabShow:function(a,b,c){var d=b.find("li").length,e=c+1,f=e/d*100;switch(jQuery("#rootwizard .progress-bar").css({width:f+"%"}),console.log("tab: "+c),c){case EPG_STEP.deposit:var g=epg_task_queue_empty();epg_task_queue_push(function(a){epg_switch_to_step1(function(){void 0!==window.epg["epg-token-advanced-details-step1-opened"]||"undefined"!=typeof window&&void 0!==window.web3||(jQuery("#epg-token-advanced-details-step1-button").click(),jQuery("#epg-token-advanced-details-step1-button").parent().hide(),window.epg["epg-token-advanced-details-step1-opened"]=!0),change_epg_gateway_address(),change_epg_data_value(),jQuery("#epg-button-next").removeClass("disabled"),a.call(null)})}),g&&epg_task_queue_process_next_task();break;case EPG_STEP.payment:var g=epg_task_queue_empty();epg_task_queue_push(function(a){epg_switch_to_step2(function(){void 0!==window.epg["epg-token-advanced-details-step2-opened"]||"undefined"!=typeof window&&void 0!==window.web3||(jQuery("#epg-token-advanced-details-step2-button").click(),jQuery("#epg-token-advanced-details-step2-button").parent().hide(),window.epg["epg-token-advanced-details-step2-opened"]=!0),change_epg_gateway_address_step2(),change_epg_data_value_step2(),a.call(null)})}),g&&epg_task_queue_process_next_task()}},onTabClick:function(a,b,c){return!(void 0!==window.epg.web3metamask)},onPrevious:function(a,b,c){if(console.log("prev: "+c),jQuery("#epg-ether-spinner").hasClass("is-active")||jQuery("#epg-spinner").hasClass("is-active"))return!1;void 0===window.epg.web3metamask&&jQuery("#epg-button-next").removeClass("disabled")},onNext:function(a,b,c){if(console.log("next: "+c),jQuery("#epg-ether-spinner").hasClass("is-active")||jQuery("#epg-spinner").hasClass("is-active"))return!1;var d=jQuery("#epg-token").val();switch(c){case EPG_STEP.deposit:break;case EPG_STEP.payment:if(void 0!==window.epg.web3metamask)return epg_getValuePaymentEth(function(a,b){if(a)return console.log(a),void epg_alert("ETH"===d?window.epg.str_deposit_eth_failure:window.epg.str_deposit_token_failure);if(null===b||epg_round(b,5,"PHP_ROUND_HALF_UP") canvas").remove(),jQuery(".epg-token-step1-canvas-qr2").qrcode({text:jQuery("#epg-gateway-address").val()})}function change_epg_data_value(){jQuery(".epg-token-step1-canvas-qr3 > canvas").remove(),jQuery(".epg-token-step1-canvas-qr3").qrcode({text:jQuery("#epg-data-value").text()})}function change_epg_gateway_address_step2(){jQuery(".epg-token-step2-canvas-qr2 > canvas").remove(),jQuery(".epg-token-step2-canvas-qr2").qrcode({text:jQuery("#epg-gateway-address-step2").val()})}function change_epg_data_value_step2(){jQuery(".epg-token-step2-canvas-qr3 > canvas").remove(),jQuery(".epg-token-step2-canvas-qr3").qrcode({text:jQuery("#epg-data-value-step2").text()})}var EPG_STEP={deposit:0,payment:1,result:2};jQuery(document).ready(function(){if(jQuery('.epg-payment-instructions .navbar a[href*="#"], a.btn[href*="#"]').off("click"),void 0!==window.epg&&void 0!==window.epg.web3Endpoint){if("undefined"!=typeof window&&void 0!==window.web3){var a=window.web3.currentProvider;window.epg.web3metamask=new Web3(a),jQuery("#epg-ether-mm-pay").click(epg_pay_ether)}else jQuery("#epg-ether-mm-pay").addClass("hidden"),jQuery("#epg-ether-mm-pay").attr("hidden","hidden"),jQuery("#epg-ether-download-metamask-button").removeClass("hidden"),jQuery("#epg-ether-download-metamask-button").removeAttr("hidden"),jQuery("#epg-ether-download-metamask-button").click(epg_openDownloadMetamaskWindow),jQuery("#epg-download-metamask-button").removeClass("hidden"),jQuery("#epg-download-metamask-button").removeAttr("hidden"),jQuery("#epg-download-metamask-button").click(epg_openDownloadMetamaskWindow),jQuery("#epg-button-next").removeClass("offset-md-8");setInterval(function(){"undefined"!=typeof window&&void 0!==window.web3?epg_getUserAccounts(function(a,b){return a?void console.log(a):0===b.length?((jQuery("#epg-payment-success-message-wrapper").hasClass("hidden")||jQuery("#epg-payment-success-message-wrapper").is("[hidden]"))&&(jQuery("#epg-unlock-metamask-message-wrapper").removeClass("hidden"),jQuery("#epg-unlock-metamask-message-wrapper").removeAttr("hidden")),jQuery("#epg-button-previous").removeClass("hidden"),jQuery("#epg-button-previous").removeAttr("hidden"),void jQuery("#epg-wizard-buttons-group").removeClass("offset-md-2")):(jQuery("#epg-unlock-metamask-message-wrapper").addClass("hidden"),void jQuery("#epg-unlock-metamask-message-wrapper").attr("hidden","hidden"))}):((jQuery("#epg-payment-success-message-wrapper").hasClass("hidden")||jQuery("#epg-payment-success-message-wrapper").is("[hidden]"))&&(jQuery("#epg-unlock-metamask-message-wrapper").removeClass("hidden"),jQuery("#epg-unlock-metamask-message-wrapper").removeAttr("hidden")),jQuery("#epg-button-previous").removeClass("hidden"),jQuery("#epg-button-previous").removeAttr("hidden"),jQuery("#epg-wizard-buttons-group").removeClass("offset-md-2"))},3e3),void 0!==window.epg.web3Endpoint&&(window.epg.web3=new Web3(new Web3.providers.HttpProvider(window.epg.web3Endpoint))),window.epg.web3metamask&&window.epg.web3metamask.version.getNetwork(function(a,b){if(a)return void console.log(a);switch(b){case"1":window.epg.mm_network_mismatch=-1===window.epg.web3Endpoint.indexOf("mainnet");break;case"3":window.epg.mm_network_mismatch=-1===window.epg.web3Endpoint.indexOf("ropsten");break;case"4":window.epg.mm_network_mismatch=-1===window.epg.web3Endpoint.indexOf("rinkeby");break;case"42":window.epg.mm_network_mismatch=-1===window.epg.web3Endpoint.indexOf("kovan");break;default:console.log("This is an unknown network."),window.epg.mm_network_mismatch=!0}window.epg.mm_network_mismatch?(jQuery("#epg-metamask-network-mismatch-message-wrapper").removeClass("hidden"),jQuery("#epg-metamask-network-mismatch-message-wrapper").removeAttr("hidden")):(jQuery("#epg-metamask-network-mismatch-message-wrapper").addClass("hidden"),jQuery("#epg-metamask-network-mismatch-message-wrapper").attr("hidden","hidden"))}),epg_show_wait_icon(),epg_getValuePaymentEth(function(a,b,c){if(a)return console.log(a),epg_alert(a),void epg_hide_wait_icon();if(null===b)return epg_hide_wait_icon(),jQuery("#epg-payment-incomplete-message-wrapper").removeClass("hidden"),void jQuery("#epg-payment-incomplete-message-wrapper").removeAttr("hidden");if("0x0000000000000000000000000000000000000001"!==c){if(epg_round(b,5,"PHP_ROUND_HALF_UP")%s" msgstr "" -#: src/gateway.php:394 +#: src/gateway.php:443 msgid "Title" msgstr "" -#: src/gateway.php:396 +#: src/gateway.php:445 msgid "" "This controls the name of the payment option that the user sees during " "checkout." msgstr "" -#: src/gateway.php:397 +#: src/gateway.php:446 msgid "Pay with ETH or ERC20 token" msgstr "" -#: src/gateway.php:400 +#: src/gateway.php:449 msgid "Short description" msgstr "" -#: src/gateway.php:402 +#: src/gateway.php:451 msgid "" "This controls the description of the payment option that the user sees " "during checkout." msgstr "" -#: src/gateway.php:408 +#: src/gateway.php:457 msgid "API credentials" msgstr "" -#: src/gateway.php:413 +#: src/gateway.php:462 msgid "Infura API Key" msgstr "" -#: src/gateway.php:415 +#: src/gateway.php:464 #, php-format msgid "" "

The API key for the %s. You need to " "register on this site to obtain it.

" msgstr "" -#: src/gateway.php:419 +#: src/gateway.php:468 msgid "Blockchain" msgstr "" -#: src/gateway.php:421 +#: src/gateway.php:470 msgid "" "

The blockchain used: mainnet or ropsten. Use mainnet in production, and " "ropsten in test mode.

" msgstr "" -#: src/gateway.php:427 src/main.php:139 +#: src/gateway.php:476 src/main.php:139 msgid "Payment details" msgstr "" -#: src/gateway.php:432 +#: src/gateway.php:481 msgid "Your ethereum address" msgstr "" -#: src/gateway.php:434 +#: src/gateway.php:483 msgid "" "The ethereum address payment should be sent to. Make sure to use one address " "per one online store. Do not use one address for two or more stores! Also, " @@ -151,11 +151,11 @@ msgid "" "accept it!" msgstr "" -#: src/gateway.php:438 +#: src/gateway.php:487 msgid "Supported ERC20 tokens list" msgstr "" -#: src/gateway.php:440 +#: src/gateway.php:489 msgid "" "Provide a list of tokens you want to support. It should be in a format like " "this: Token_symbol1:token_eth_address1:token_price_eth1,Token_symbol2:" @@ -164,52 +164,52 @@ msgid "" "EOS:0x86Fa049857E0209aa7D9e616F7eb3b3B78ECfdb0:0.01054550" msgstr "" -#: src/gateway.php:444 +#: src/gateway.php:493 msgid "Disable Ether" msgstr "" -#: src/gateway.php:445 +#: src/gateway.php:494 msgid "Disallow customer to pay with Ether" msgstr "" -#: src/gateway.php:447 +#: src/gateway.php:496 msgid "" "This option is useful to accept only some token. It is an advanced option. " "Use with care." msgstr "" -#: src/gateway.php:451 +#: src/gateway.php:500 msgid "Gas limit" msgstr "" -#: src/gateway.php:453 +#: src/gateway.php:502 msgid "The gas limit for transaction." msgstr "" -#: src/gateway.php:457 +#: src/gateway.php:506 msgid "Gas price, Gwei" msgstr "" -#: src/gateway.php:459 +#: src/gateway.php:508 msgid "The gas price for transaction." msgstr "" -#: src/gateway.php:463 +#: src/gateway.php:512 msgid "Mark Ether price up by %" msgstr "" -#: src/gateway.php:464 +#: src/gateway.php:513 msgid "" "To help cover currency fluctuations the plugin can automatically mark up " "converted rates for you. These are applied as percentage markup, so a 1ETH " "value with a 1.00% markup will be presented to the customer as 1.01ETH." msgstr "" -#: src/gateway.php:475 +#: src/gateway.php:524 msgid "Mark ERC20 token price up by %" msgstr "" -#: src/gateway.php:476 +#: src/gateway.php:525 msgid "" "To help cover currency fluctuations the plugin can automatically mark up " "converted rates for you. These are applied as percentage markup, so a 1 " @@ -217,38 +217,47 @@ msgid "" "1.01 Token." msgstr "" -#: src/gateway.php:490 +#: src/gateway.php:539 msgid "Need help to configure this plugin?" msgstr "" -#: src/gateway.php:493 src/gateway.php:504 +#: src/gateway.php:542 src/gateway.php:553 #, php-format msgid "Feel free to %1$shire me!%2$s" msgstr "" -#: src/gateway.php:501 +#: src/gateway.php:550 msgid "Need help to develop a ERC20 token for your ICO?" msgstr "" -#: src/gateway.php:512 +#: src/gateway.php:561 msgid "Want to sell your ERC20/ERC223 ICO token from your ICO site?" msgstr "" -#: src/gateway.php:515 +#: src/gateway.php:564 #, php-format msgid "Install the %1$sThe EthereumICO Wordpress plugin%2$s!" msgstr "" -#: src/gateway.php:523 +#: src/gateway.php:572 msgid "Want to sell ERC20 token for fiat and/or Bitcoin?" msgstr "" -#: src/gateway.php:526 +#: src/gateway.php:575 #, php-format msgid "Install the %1$sCryptocurrency Product for WooCommerce plugin%2$s!" msgstr "" -#: src/gateway.php:556 +#: src/gateway.php:583 +msgid "Want to create Ethereum wallets on your Wordpress site?" +msgstr "" + +#: src/gateway.php:586 +#, php-format +msgid "Install the %1$sWordPress Ethereum Wallet plugin%2$s!" +msgstr "" + +#: src/gateway.php:616 #, php-format msgid "" "Your customers will be given instructions about where, and how much to pay. " @@ -257,88 +266,88 @@ msgid "" "\">WooCommerce Orders page." msgstr "" -#: src/gateway.php:585 +#: src/gateway.php:645 #, php-format msgid "Order submitted, and payment with %s requested." msgstr "" -#: src/gateway.php:593 +#: src/gateway.php:653 #, php-format msgid "Order value calculated as %f %s" msgstr "" -#: src/gateway.php:597 +#: src/gateway.php:657 msgid "Awaiting payment." msgstr "" -#: src/gateway.php:636 +#: src/gateway.php:696 #, php-format msgid "Order do not need payment, tx check stopped: %s" msgstr "" -#: src/gateway.php:650 +#: src/gateway.php:710 #, php-format -msgid "Order expired: %s" +msgid "Order expired. Order updated to failed: %s" msgstr "" -#: src/gateway.php:654 +#: src/gateway.php:714 src/gateway.php:716 msgid "Order was expired." msgstr "" -#: src/gateway.php:666 +#: src/gateway.php:728 #, php-format msgid "No payment found for order: %s" msgstr "" -#: src/gateway.php:680 +#: src/gateway.php:742 #, php-format msgid "" "PaymentInfo recieved for order_id=%s. %s: %s. eth_value=%s, eth_value_wei=%s" msgstr "" -#: src/gateway.php:711 src/gateway.php:714 +#: src/gateway.php:773 src/gateway.php:776 msgid "Successful payment notification received. Order updated to pending." msgstr "" -#: src/gateway.php:720 +#: src/gateway.php:782 #, php-format msgid "" "Non-successful payment notification received. Order updated to failed: %s" msgstr "" -#: src/gateway.php:724 +#: src/gateway.php:786 msgid "Non-successful payment notification received. Order updated to failed." msgstr "" -#: src/gateway.php:726 +#: src/gateway.php:788 msgid "Non-successful payment notification." msgstr "" -#: src/gateway.php:757 +#: src/gateway.php:806 msgid "The ERC20 token payment consists of two steps." msgstr "" -#: src/gateway.php:758 +#: src/gateway.php:807 msgid "" "Deposit funds to the payment gateway smart contract in the Ethereum " "blockchain, and" msgstr "" -#: src/gateway.php:759 +#: src/gateway.php:808 msgid "Use this deposit to pay for your order." msgstr "" -#: src/gateway.php:760 +#: src/gateway.php:809 msgid "" "You have to send two transactions to the Ethereum blockchain: first for " "deposit and second for the real payment." msgstr "" -#: src/gateway.php:761 +#: src/gateway.php:810 msgid "Step 2: Release deposit for payment." msgstr "" -#: src/gateway.php:762 +#: src/gateway.php:811 msgid "" "Send a command to the payment gateway smart contract to do the actual " "payment for you. The payment gateway smart contract can not spend your " @@ -351,11 +360,11 @@ msgid "" "due to the ERC20 token internal limitations." msgstr "" -#: src/gateway.php:763 +#: src/gateway.php:812 msgid "Step 1: Deposit funds to the payment gateway smart contract." msgstr "" -#: src/gateway.php:764 +#: src/gateway.php:813 msgid "" "This step calls the approve method on the token smart contract to allow the " "payment gateway contract to spend this amount of tokens on behalf of you. " @@ -363,23 +372,23 @@ msgid "" "order. The Value field is always 0 (zero) for token payments." msgstr "" -#: src/gateway.php:765 +#: src/gateway.php:814 msgid "Payment succeeded!" msgstr "" -#: src/gateway.php:766 +#: src/gateway.php:815 msgid "Payment succeeded! Reload page if it was not auto reloaded." msgstr "" -#: src/gateway.php:767 +#: src/gateway.php:816 msgid "Payment status: not complete." msgstr "" -#: src/gateway.php:768 +#: src/gateway.php:817 msgid "Payment status: deposit made." msgstr "" -#: src/gateway.php:769 +#: src/gateway.php:818 msgid "" "This wizard requires the MetaMask browser extension to be installed and your " "MetaMask account to be unlocked. If you do not want to use MetaMask, just " @@ -388,158 +397,154 @@ msgid "" "to reconcile your payment." msgstr "" -#: src/gateway.php:770 +#: src/gateway.php:819 msgid "" "MetaMask network mismatch. Choose another network or ask site administrator." msgstr "" -#: src/gateway.php:816 +#: src/gateway.php:865 msgid "Choose Ether or ERC20 token" msgstr "" -#: src/gateway.php:849 src/gateway.php:1006 src/gateway.php:1125 +#: src/gateway.php:898 src/gateway.php:1055 src/gateway.php:1174 #: src/main.php:143 msgid "Amount" msgstr "" -#: src/gateway.php:856 src/gateway.php:1021 src/gateway.php:1132 +#: src/gateway.php:905 src/gateway.php:1070 src/gateway.php:1181 msgid "Advanced" msgstr "" -#: src/gateway.php:860 src/gateway.php:1025 src/gateway.php:1136 +#: src/gateway.php:909 src/gateway.php:1074 src/gateway.php:1185 msgid "Value" msgstr "" -#: src/gateway.php:868 src/gateway.php:896 src/gateway.php:924 -#: src/gateway.php:1033 src/gateway.php:1061 src/gateway.php:1089 -#: src/gateway.php:1144 src/gateway.php:1172 src/gateway.php:1199 +#: src/gateway.php:917 src/gateway.php:945 src/gateway.php:973 +#: src/gateway.php:1082 src/gateway.php:1110 src/gateway.php:1138 +#: src/gateway.php:1193 src/gateway.php:1221 src/gateway.php:1248 msgid "QR" msgstr "" -#: src/gateway.php:871 src/gateway.php:899 src/gateway.php:927 -#: src/gateway.php:1036 src/gateway.php:1064 src/gateway.php:1092 -#: src/gateway.php:1147 src/gateway.php:1175 src/gateway.php:1202 +#: src/gateway.php:920 src/gateway.php:948 src/gateway.php:976 +#: src/gateway.php:1085 src/gateway.php:1113 src/gateway.php:1141 +#: src/gateway.php:1196 src/gateway.php:1224 src/gateway.php:1251 msgid "Copy" msgstr "" -#: src/gateway.php:888 src/gateway.php:1053 src/gateway.php:1164 +#: src/gateway.php:937 src/gateway.php:1102 src/gateway.php:1213 #: src/main.php:144 msgid "Address" msgstr "" -#: src/gateway.php:916 src/gateway.php:1082 src/gateway.php:1192 +#: src/gateway.php:965 src/gateway.php:1131 src/gateway.php:1241 msgid "Data" msgstr "" -#: src/gateway.php:948 src/gateway.php:1224 src/gateway.php:1275 -msgid "Do not close or reload this page until payment confirmation complete." -msgstr "" - -#: src/gateway.php:952 src/gateway.php:1277 +#: src/gateway.php:1001 src/gateway.php:1326 msgid "Pay with MetaMask" msgstr "" -#: src/gateway.php:953 src/gateway.php:1232 +#: src/gateway.php:1002 src/gateway.php:1281 msgid "Download MetaMask!" msgstr "" -#: src/gateway.php:968 src/gateway.php:998 src/gateway.php:1117 +#: src/gateway.php:1017 src/gateway.php:1047 src/gateway.php:1166 msgid "More..." msgstr "" -#: src/gateway.php:987 +#: src/gateway.php:1036 msgid "1. Deposit funds" msgstr "" -#: src/gateway.php:988 +#: src/gateway.php:1037 msgid "2. Make payment" msgstr "" -#: src/gateway.php:1014 +#: src/gateway.php:1063 msgid "Balance" msgstr "" -#: src/gateway.php:1229 +#: src/gateway.php:1278 msgid "Previous" msgstr "" -#: src/gateway.php:1231 +#: src/gateway.php:1280 msgid "Next" msgstr "" -#: src/gateway.php:1276 +#: src/gateway.php:1325 msgid "Deposit with MetaMask" msgstr "" -#: src/gateway.php:1278 +#: src/gateway.php:1327 msgid "Download MetaMask" msgstr "" -#: src/gateway.php:1279 +#: src/gateway.php:1328 msgid "Download MetaMask or input your ethereum address" msgstr "" -#: src/gateway.php:1280 +#: src/gateway.php:1329 msgid "Unlock your MetaMask account please." msgstr "" -#: src/gateway.php:1281 +#: src/gateway.php:1330 msgid "Failed to pay ETH with MetaMask" msgstr "" -#: src/gateway.php:1282 +#: src/gateway.php:1331 msgid "Pay ETH with MetaMask succeeded" msgstr "" -#: src/gateway.php:1283 +#: src/gateway.php:1332 msgid "Failed to deposit ETH with MetaMask" msgstr "" -#: src/gateway.php:1284 +#: src/gateway.php:1333 msgid "Deposit ETH with MetaMask succeeded" msgstr "" -#: src/gateway.php:1285 +#: src/gateway.php:1334 msgid "Failed to pay ERC20 token with MetaMask" msgstr "" -#: src/gateway.php:1286 +#: src/gateway.php:1335 msgid "Failed to pay ERC20 token: insufficient balance" msgstr "" -#: src/gateway.php:1287 +#: src/gateway.php:1336 msgid "Pay ERC20 token with MetaMask succeeded" msgstr "" -#: src/gateway.php:1288 +#: src/gateway.php:1337 msgid "Failed to pay ETH with MetaMask - rejected" msgstr "" -#: src/gateway.php:1289 +#: src/gateway.php:1338 msgid "Failed to pay ERC20 token with MetaMask - rejected" msgstr "" -#: src/gateway.php:1290 +#: src/gateway.php:1339 msgid "Failed to deposit ERC20 token with MetaMask" msgstr "" -#: src/gateway.php:1291 +#: src/gateway.php:1340 msgid "Failed to deposit ERC20 token: insufficient balance" msgstr "" -#: src/gateway.php:1292 +#: src/gateway.php:1341 msgid "Deposit ERC20 token with MetaMask succeeded" msgstr "" -#: src/gateway.php:1293 +#: src/gateway.php:1342 msgid "Failed to deposit ETH with MetaMask - rejected" msgstr "" -#: src/gateway.php:1294 +#: src/gateway.php:1343 msgid "Failed to deposit ERC20 token with MetaMask - rejected" msgstr "" -#: src/gateway.php:1295 +#: src/gateway.php:1344 msgid "Copied to clipboard" msgstr "" diff --git a/languages/ether-and-erc20-tokens-woocommerce-payment-gateway-ru_RU.mo b/languages/ether-and-erc20-tokens-woocommerce-payment-gateway-ru_RU.mo index d2a9eeb..3b3f658 100644 Binary files a/languages/ether-and-erc20-tokens-woocommerce-payment-gateway-ru_RU.mo and b/languages/ether-and-erc20-tokens-woocommerce-payment-gateway-ru_RU.mo differ diff --git a/languages/ether-and-erc20-tokens-woocommerce-payment-gateway-ru_RU.po b/languages/ether-and-erc20-tokens-woocommerce-payment-gateway-ru_RU.po index bc10b8b..2bdc7ec 100644 --- a/languages/ether-and-erc20-tokens-woocommerce-payment-gateway-ru_RU.po +++ b/languages/ether-and-erc20-tokens-woocommerce-payment-gateway-ru_RU.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: ether-and-erc20-tokens-woocommerce-payment-gateway\n" -"POT-Creation-Date: 2018-07-16 20:07+0700\n" -"PO-Revision-Date: 2018-07-16 20:08+0700\n" +"POT-Creation-Date: 2018-07-18 04:41+0700\n" +"PO-Revision-Date: 2018-07-18 04:43+0700\n" "Last-Translator: \n" "Language-Team: ethereumicoio\n" "Language: ru_RU\n" @@ -18,112 +18,112 @@ msgstr "" "X-Poedit-SearchPathExcluded-0: vendor\n" "X-Poedit-SearchPathExcluded-1: node_modules\n" -#: ether-and-erc20-tokens-woocommerce-payment-gateway.php:63 +#: ether-and-erc20-tokens-woocommerce-payment-gateway.php:65 msgid "Settings" msgstr "Настройки" -#: src/gateway.php:24 src/gateway.php:34 +#: src/gateway.php:25 src/gateway.php:35 msgid "Unknown network name in configuration settings" msgstr "Неизвестное название сети настройках" -#: src/gateway.php:118 src/gateway.php:147 +#: src/gateway.php:119 src/gateway.php:148 #, php-format msgid "call contract %s method %s for market %s for order %s" msgstr "вызов контракта %s. Метод %s. Адрес магазина %s. Номер заказа %s" -#: src/gateway.php:175 +#: src/gateway.php:176 #, php-format msgid "call contract %s method decimals" msgstr "вызов контракта %s. Метод decimals" -#: src/gateway.php:219 src/gateway.php:555 +#: src/gateway.php:220 src/gateway.php:615 msgid "Pay with Ether or ERC20 token" msgstr "Заплатить эфиром (ETH) или ERC20 токеном" -#: src/gateway.php:304 +#: src/gateway.php:353 #, php-format msgid "" "Payment of %s ETH or an equvalent in ERC20 supported tokens will be due." msgstr "" "Оплата %s ETH или эквивалента в одном из принимаемых к оплате ERC20 токенов." -#: src/gateway.php:309 +#: src/gateway.php:358 #, php-format msgid "Problem performing currency conversion: %s" msgstr "Не удалось выполнить конвертацию валюты %s" -#: src/gateway.php:316 +#: src/gateway.php:365 msgid "" "Unable to provide an order value in ETH at this time. Please contact support." msgstr "" "Не удалось получить стоимость заказа в ETH. Пожалуйста, обратитесь в службу " "поддержки." -#: src/gateway.php:333 +#: src/gateway.php:382 msgid "" "ETH price quote has been updated, please check and confirm before proceeding." msgstr "" "Курс ETH был обновлён. Пожалуйста, проверьте и подтвердите прежде чем " "продолжить." -#: src/gateway.php:373 +#: src/gateway.php:422 msgid "Enable / disable" msgstr "Включить / Выключить" -#: src/gateway.php:374 +#: src/gateway.php:423 msgid "Enable payment with Ether or ERC20 tokens" msgstr "Включить оплату ETH и токенами ERC20" -#: src/gateway.php:382 +#: src/gateway.php:431 msgid "Basic settings" msgstr "Базовые настройки" -#: src/gateway.php:387 +#: src/gateway.php:436 msgid "Enable debug mode" msgstr "Включить режим отладки" -#: src/gateway.php:388 +#: src/gateway.php:437 msgid "Enable only if you are diagnosing problems." msgstr "Включайте только если наблюдаются проблемы в функциональности плагина." -#: src/gateway.php:390 +#: src/gateway.php:439 #, php-format msgid "Log interactions inside %s" msgstr "Файл логов %s" -#: src/gateway.php:394 +#: src/gateway.php:443 msgid "Title" msgstr "Название" -#: src/gateway.php:396 +#: src/gateway.php:445 msgid "" "This controls the name of the payment option that the user sees during " "checkout." msgstr "Отображается в названии способа платежа." -#: src/gateway.php:397 +#: src/gateway.php:446 msgid "Pay with ETH or ERC20 token" msgstr "Оплатить с помощью ETH или токена ERC20" -#: src/gateway.php:400 +#: src/gateway.php:449 msgid "Short description" msgstr "Краткое описание" -#: src/gateway.php:402 +#: src/gateway.php:451 msgid "" "This controls the description of the payment option that the user sees " "during checkout." msgstr "Краткое описание способа платежа." -#: src/gateway.php:408 +#: src/gateway.php:457 msgid "API credentials" msgstr "Ключи доступа к сторонним API" -#: src/gateway.php:413 +#: src/gateway.php:462 msgid "Infura API Key" msgstr "Ключ доступа к API infura.io" -#: src/gateway.php:415 +#: src/gateway.php:464 #, php-format msgid "" "

The API key for the %s. You need to " @@ -132,11 +132,11 @@ msgstr "" "

Ключ доступа к API %s. " "Зарегистрируйтесь на сайте infura.io чтобы получить свой ключ.

" -#: src/gateway.php:419 +#: src/gateway.php:468 msgid "Blockchain" msgstr "Блокчейн" -#: src/gateway.php:421 +#: src/gateway.php:470 msgid "" "

The blockchain used: mainnet or ropsten. Use mainnet in production, and " "ropsten in test mode.

" @@ -144,15 +144,15 @@ msgstr "" "

Используемая сеть: mainnet или ropsten. Используйте mainnet для " "нормальной работы, и ropsten для тестирования.

" -#: src/gateway.php:427 src/main.php:139 +#: src/gateway.php:476 src/main.php:139 msgid "Payment details" msgstr "Детали оплаты" -#: src/gateway.php:432 +#: src/gateway.php:481 msgid "Your ethereum address" msgstr "Адрес вашего аккаунта Ethereum" -#: src/gateway.php:434 +#: src/gateway.php:483 msgid "" "The ethereum address payment should be sent to. Make sure to use one address " "per one online store. Do not use one address for two or more stores! Also, " @@ -164,11 +164,11 @@ msgstr "" "Используйте один адрес для одного магазина. Нельзя использовать один адрес " "для двух и более магазинов!" -#: src/gateway.php:438 +#: src/gateway.php:487 msgid "Supported ERC20 tokens list" msgstr "Список принимаемых к оплате токенов ERC20" -#: src/gateway.php:440 +#: src/gateway.php:489 msgid "" "Provide a list of tokens you want to support. It should be in a format like " "this: Token_symbol1:token_eth_address1:token_price_eth1,Token_symbol2:" @@ -182,15 +182,15 @@ msgstr "" "TSX:0xe762Da33bf2b2412477c65b01f46D923A7Ef5794:0.001," "EOS:0x86Fa049857E0209aa7D9e616F7eb3b3B78ECfdb0:0.01054550" -#: src/gateway.php:444 +#: src/gateway.php:493 msgid "Disable Ether" msgstr "Не принимать Ether" -#: src/gateway.php:445 +#: src/gateway.php:494 msgid "Disallow customer to pay with Ether" msgstr "Запретить покупателю платить с использованием Ether" -#: src/gateway.php:447 +#: src/gateway.php:496 msgid "" "This option is useful to accept only some token. It is an advanced option. " "Use with care." @@ -198,27 +198,27 @@ msgstr "" "Эта настройка позволяет настроить продажу только за какой-то токен. Это " "продвинутая функциональность. Используйте только если полностью уверены." -#: src/gateway.php:451 +#: src/gateway.php:500 msgid "Gas limit" msgstr "Ограничение газа" -#: src/gateway.php:453 +#: src/gateway.php:502 msgid "The gas limit for transaction." msgstr "Максимальное количество газа для транзакции." -#: src/gateway.php:457 +#: src/gateway.php:506 msgid "Gas price, Gwei" msgstr "Стоимость газа, Gwei" -#: src/gateway.php:459 +#: src/gateway.php:508 msgid "The gas price for transaction." msgstr "Стоимость газа для транзакции." -#: src/gateway.php:463 +#: src/gateway.php:512 msgid "Mark Ether price up by %" msgstr "При оплате с помощью Ether увеличить стоимость товара на указанный %" -#: src/gateway.php:464 +#: src/gateway.php:513 msgid "" "To help cover currency fluctuations the plugin can automatically mark up " "converted rates for you. These are applied as percentage markup, so a 1ETH " @@ -228,12 +228,12 @@ msgstr "" "увеличивать цену товара на указанный здесь процент. Таким образом, для " "значения в 1% товар стоимостью 1ETH будет продан пользователю за 1.01ETH." -#: src/gateway.php:475 +#: src/gateway.php:524 msgid "Mark ERC20 token price up by %" msgstr "" "При оплате с помощью ERC20 токена увеличить стоимость товара на указанный %" -#: src/gateway.php:476 +#: src/gateway.php:525 msgid "" "To help cover currency fluctuations the plugin can automatically mark up " "converted rates for you. These are applied as percentage markup, so a 1 " @@ -245,38 +245,47 @@ msgstr "" "значения в 1% товар стоимостью 1 токен будет продан пользователю за 1.01 " "токена." -#: src/gateway.php:490 +#: src/gateway.php:539 msgid "Need help to configure this plugin?" msgstr "Нужна помощь в настройке этого плагина?" -#: src/gateway.php:493 src/gateway.php:504 +#: src/gateway.php:542 src/gateway.php:553 #, php-format msgid "Feel free to %1$shire me!%2$s" msgstr "Наймите %1$sменя!%2$s" -#: src/gateway.php:501 +#: src/gateway.php:550 msgid "Need help to develop a ERC20 token for your ICO?" msgstr "Нужна помощь в создании ERC20 токена для вашего ICO?" -#: src/gateway.php:512 +#: src/gateway.php:561 msgid "Want to sell your ERC20/ERC223 ICO token from your ICO site?" msgstr "Хотите продавать ваши ERC20/ERC223 ICO токены с вашего ICO сайта?" -#: src/gateway.php:515 +#: src/gateway.php:564 #, php-format msgid "Install the %1$sThe EthereumICO Wordpress plugin%2$s!" msgstr "Установите %1$sEthereumICO WordPress%2$s плагин!" -#: src/gateway.php:523 +#: src/gateway.php:572 msgid "Want to sell ERC20 token for fiat and/or Bitcoin?" msgstr "Хотите продавать ваши ERC20 токены за рубли или Bitcoin?" -#: src/gateway.php:526 +#: src/gateway.php:575 #, php-format msgid "Install the %1$sCryptocurrency Product for WooCommerce plugin%2$s!" msgstr "Установите плагин %1$sCryptocurrency Product for WooCommerce%2$s!" -#: src/gateway.php:556 +#: src/gateway.php:583 +msgid "Want to create Ethereum wallets on your Wordpress site?" +msgstr "Хотите создавать Ethereum-кошельки для ваших пользователей?" + +#: src/gateway.php:586 +#, php-format +msgid "Install the %1$sWordPress Ethereum Wallet plugin%2$s!" +msgstr "Установите %1$sWordPress Ethereum Wallet%2$s плагин!" + +#: src/gateway.php:616 #, php-format msgid "" "Your customers will be given instructions about where, and how much to pay. " @@ -289,40 +298,42 @@ msgstr "" "подтверждения платежа. Вы всегда сможете обновить или удалить заказы на " "странице Заказов WooCommerce." -#: src/gateway.php:585 +#: src/gateway.php:645 #, php-format msgid "Order submitted, and payment with %s requested." msgstr "Создан заказ и запрошена оплата в %s." -#: src/gateway.php:593 +#: src/gateway.php:653 #, php-format msgid "Order value calculated as %f %s" msgstr "Сумма заказа %f %s" -#: src/gateway.php:597 +#: src/gateway.php:657 msgid "Awaiting payment." msgstr "Ожидание оплаты." -#: src/gateway.php:636 +#: src/gateway.php:696 #, php-format msgid "Order do not need payment, tx check stopped: %s" msgstr "Заказ %s уже оплачен, прекращаем проверки" -#: src/gateway.php:650 +#: src/gateway.php:710 #, php-format -msgid "Order expired: %s" -msgstr "Заказ %s просрочен" +msgid "Order expired. Order updated to failed: %s" +msgstr "" +"Оплата заказа не не была выполнена в срок. Статус заказа %s обновлён до " +"Неудавшийся" -#: src/gateway.php:654 +#: src/gateway.php:714 src/gateway.php:716 msgid "Order was expired." msgstr "Заказ просрочен." -#: src/gateway.php:666 +#: src/gateway.php:728 #, php-format msgid "No payment found for order: %s" msgstr "Не обнаружено оплаты для заказа %s" -#: src/gateway.php:680 +#: src/gateway.php:742 #, php-format msgid "" "PaymentInfo recieved for order_id=%s. %s: %s. eth_value=%s, eth_value_wei=%s" @@ -330,40 +341,40 @@ msgstr "" "Информация об оплате получена для заказа №%s. %s: %s. eth_value=%s, " "eth_value_wei=%s" -#: src/gateway.php:711 src/gateway.php:714 +#: src/gateway.php:773 src/gateway.php:776 msgid "Successful payment notification received. Order updated to pending." msgstr "" "Получено подтверждение оплаты. Статус заказа обновлён до \"В ожидании\"." -#: src/gateway.php:720 +#: src/gateway.php:782 #, php-format msgid "" "Non-successful payment notification received. Order updated to failed: %s" msgstr "Оплата заказа не удалась. Статус заказа %s обновлён до Неудавшийся" -#: src/gateway.php:724 +#: src/gateway.php:786 msgid "Non-successful payment notification received. Order updated to failed." msgstr "Оплата заказа не удалась. Статус заказа обновлён до Неудавшийся." -#: src/gateway.php:726 +#: src/gateway.php:788 msgid "Non-successful payment notification." msgstr "Оплата заказа не удалась." -#: src/gateway.php:757 +#: src/gateway.php:806 msgid "The ERC20 token payment consists of two steps." msgstr "Оплата токеном ERC20 проводится в два этапа." -#: src/gateway.php:758 +#: src/gateway.php:807 msgid "" "Deposit funds to the payment gateway smart contract in the Ethereum " "blockchain, and" msgstr "Внести депозит на баланс смарт контракта платёжного шлюза, и" -#: src/gateway.php:759 +#: src/gateway.php:808 msgid "Use this deposit to pay for your order." msgstr "Оплатить заказ списав средства с внесённого на первом шаге депозита." -#: src/gateway.php:760 +#: src/gateway.php:809 msgid "" "You have to send two transactions to the Ethereum blockchain: first for " "deposit and second for the real payment." @@ -371,11 +382,11 @@ msgstr "" "Вам нужно подписать две транзакции: одна для внесения депозита и вторая для " "непосредственной оплаты." -#: src/gateway.php:761 +#: src/gateway.php:810 msgid "Step 2: Release deposit for payment." msgstr "Шаг 2: Списать средства с депозита для оплаты заказа." -#: src/gateway.php:762 +#: src/gateway.php:811 msgid "" "Send a command to the payment gateway smart contract to do the actual " "payment for you. The payment gateway smart contract can not spend your " @@ -397,11 +408,11 @@ msgstr "" "при покупке в другом магазине, использующем этот же платёжный шлюз. Такое " "ограничение связано с особенностями стандарта ERC20 токена." -#: src/gateway.php:763 +#: src/gateway.php:812 msgid "Step 1: Deposit funds to the payment gateway smart contract." msgstr "Шаг 1. Внесение средств на счёт смарт контракта платёжного шлюза." -#: src/gateway.php:764 +#: src/gateway.php:813 msgid "" "This step calls the approve method on the token smart contract to allow the " "payment gateway contract to spend this amount of tokens on behalf of you. " @@ -413,23 +424,23 @@ msgstr "" "поле Количество указано количество токенов к оплате за ваш заказ. В поле " "Value при оплате токенами всегда указывается 0 (нуль)." -#: src/gateway.php:765 +#: src/gateway.php:814 msgid "Payment succeeded!" msgstr "Платёж подтверждён!" -#: src/gateway.php:766 +#: src/gateway.php:815 msgid "Payment succeeded! Reload page if it was not auto reloaded." msgstr "Платёж подтверждён! Обновите страницу." -#: src/gateway.php:767 +#: src/gateway.php:816 msgid "Payment status: not complete." msgstr "Статус платежа: не завершён." -#: src/gateway.php:768 +#: src/gateway.php:817 msgid "Payment status: deposit made." msgstr "Статус платежа: внесён депозит." -#: src/gateway.php:769 +#: src/gateway.php:818 msgid "" "This wizard requires the MetaMask browser extension to be installed and your " "MetaMask account to be unlocked. If you do not want to use MetaMask, just " @@ -445,7 +456,7 @@ msgstr "" "значения скопированы верно, иначе ваши средства будут потеряны и мы не " "сможем вам их вернуть." -#: src/gateway.php:770 +#: src/gateway.php:819 msgid "" "MetaMask network mismatch. Choose another network or ask site administrator." msgstr "" @@ -453,154 +464,149 @@ msgstr "" "сайте. Попробуйте выбрать другую сеть, например, mainnet, или обратитесь к " "администрации сайта." -#: src/gateway.php:816 +#: src/gateway.php:865 msgid "Choose Ether or ERC20 token" msgstr "Валюта платежа" -#: src/gateway.php:849 src/gateway.php:1006 src/gateway.php:1125 +#: src/gateway.php:898 src/gateway.php:1055 src/gateway.php:1174 #: src/main.php:143 msgid "Amount" msgstr "Сумма заказа" -#: src/gateway.php:856 src/gateway.php:1021 src/gateway.php:1132 +#: src/gateway.php:905 src/gateway.php:1070 src/gateway.php:1181 msgid "Advanced" msgstr "Расширенные" -#: src/gateway.php:860 src/gateway.php:1025 src/gateway.php:1136 +#: src/gateway.php:909 src/gateway.php:1074 src/gateway.php:1185 msgid "Value" msgstr "К оплате" -#: src/gateway.php:868 src/gateway.php:896 src/gateway.php:924 -#: src/gateway.php:1033 src/gateway.php:1061 src/gateway.php:1089 -#: src/gateway.php:1144 src/gateway.php:1172 src/gateway.php:1199 +#: src/gateway.php:917 src/gateway.php:945 src/gateway.php:973 +#: src/gateway.php:1082 src/gateway.php:1110 src/gateway.php:1138 +#: src/gateway.php:1193 src/gateway.php:1221 src/gateway.php:1248 msgid "QR" msgstr "QR-код" -#: src/gateway.php:871 src/gateway.php:899 src/gateway.php:927 -#: src/gateway.php:1036 src/gateway.php:1064 src/gateway.php:1092 -#: src/gateway.php:1147 src/gateway.php:1175 src/gateway.php:1202 +#: src/gateway.php:920 src/gateway.php:948 src/gateway.php:976 +#: src/gateway.php:1085 src/gateway.php:1113 src/gateway.php:1141 +#: src/gateway.php:1196 src/gateway.php:1224 src/gateway.php:1251 msgid "Copy" msgstr "Копировать" -#: src/gateway.php:888 src/gateway.php:1053 src/gateway.php:1164 +#: src/gateway.php:937 src/gateway.php:1102 src/gateway.php:1213 #: src/main.php:144 msgid "Address" msgstr "Адрес" -#: src/gateway.php:916 src/gateway.php:1082 src/gateway.php:1192 +#: src/gateway.php:965 src/gateway.php:1131 src/gateway.php:1241 msgid "Data" msgstr "Данные" -#: src/gateway.php:948 src/gateway.php:1224 src/gateway.php:1275 -msgid "Do not close or reload this page until payment confirmation complete." -msgstr "" -"Не закрывайте и не перезагружайте страницу! Дождитесь подтверждения оплаты." - -#: src/gateway.php:952 src/gateway.php:1277 +#: src/gateway.php:1001 src/gateway.php:1326 msgid "Pay with MetaMask" msgstr "Оплатить с помощью MetaMask" -#: src/gateway.php:953 src/gateway.php:1232 +#: src/gateway.php:1002 src/gateway.php:1281 msgid "Download MetaMask!" msgstr "Скачать MetaMask!" -#: src/gateway.php:968 src/gateway.php:998 src/gateway.php:1117 +#: src/gateway.php:1017 src/gateway.php:1047 src/gateway.php:1166 msgid "More..." msgstr "Подробнее..." -#: src/gateway.php:987 +#: src/gateway.php:1036 msgid "1. Deposit funds" msgstr "1. Внести депозит" -#: src/gateway.php:988 +#: src/gateway.php:1037 msgid "2. Make payment" msgstr "2. Оплатить" -#: src/gateway.php:1014 +#: src/gateway.php:1063 msgid "Balance" msgstr "Баланс на аккаунте" -#: src/gateway.php:1229 +#: src/gateway.php:1278 msgid "Previous" msgstr "Назад" -#: src/gateway.php:1231 +#: src/gateway.php:1280 msgid "Next" msgstr "Вперёд" -#: src/gateway.php:1276 +#: src/gateway.php:1325 msgid "Deposit with MetaMask" msgstr "Внесение депозита с помощью MetaMask" -#: src/gateway.php:1278 +#: src/gateway.php:1327 msgid "Download MetaMask" msgstr "Скачайте и установите MetaMask" -#: src/gateway.php:1279 +#: src/gateway.php:1328 msgid "Download MetaMask or input your ethereum address" msgstr "Скачайте MetaMask или ведите свой Ethereum адрес" -#: src/gateway.php:1280 +#: src/gateway.php:1329 msgid "Unlock your MetaMask account please." msgstr "Выполните ход в свой аккаунт MetaMask." -#: src/gateway.php:1281 +#: src/gateway.php:1330 msgid "Failed to pay ETH with MetaMask" msgstr "Не удалось выполнить оплату ETH с помощью MetaMask" -#: src/gateway.php:1282 +#: src/gateway.php:1331 msgid "Pay ETH with MetaMask succeeded" msgstr "Оплата ETH с помощью MetaMask выполнена успешно" -#: src/gateway.php:1283 +#: src/gateway.php:1332 msgid "Failed to deposit ETH with MetaMask" msgstr "Не удалось внести депозит ETH с помощью MetaMask" -#: src/gateway.php:1284 +#: src/gateway.php:1333 msgid "Deposit ETH with MetaMask succeeded" msgstr "Внесение депозита ETH с помощью MetaMask выполнена успешно" -#: src/gateway.php:1285 +#: src/gateway.php:1334 msgid "Failed to pay ERC20 token with MetaMask" msgstr "Не удалось выполнить оплату токеном ERC20 с помощью MetaMask" -#: src/gateway.php:1286 +#: src/gateway.php:1335 msgid "Failed to pay ERC20 token: insufficient balance" msgstr "Не удалось выполнить оплату токеном ERC20: недостаточный баланс" -#: src/gateway.php:1287 +#: src/gateway.php:1336 msgid "Pay ERC20 token with MetaMask succeeded" msgstr "Оплата токеном ERC20 с помощью MetaMask выполнена успешно" -#: src/gateway.php:1288 +#: src/gateway.php:1337 msgid "Failed to pay ETH with MetaMask - rejected" msgstr "Оплата ETH с помощью MetaMask отменена" -#: src/gateway.php:1289 +#: src/gateway.php:1338 msgid "Failed to pay ERC20 token with MetaMask - rejected" msgstr "Оплата ERC20 токеном с помощью MetaMask отменена" -#: src/gateway.php:1290 +#: src/gateway.php:1339 msgid "Failed to deposit ERC20 token with MetaMask" msgstr "Не удалось внести депозит токеном ERC20" -#: src/gateway.php:1291 +#: src/gateway.php:1340 msgid "Failed to deposit ERC20 token: insufficient balance" msgstr "Не удалось внести депозит токеном ERC20: недостаточный баланс" -#: src/gateway.php:1292 +#: src/gateway.php:1341 msgid "Deposit ERC20 token with MetaMask succeeded" msgstr "Депозит токеном ERC20 внесён успешно" -#: src/gateway.php:1293 +#: src/gateway.php:1342 msgid "Failed to deposit ETH with MetaMask - rejected" msgstr "Внесение депозита ETH с помощью MetaMask отменена" -#: src/gateway.php:1294 +#: src/gateway.php:1343 msgid "Failed to deposit ERC20 token with MetaMask - rejected" msgstr "Внесение депозита токеном ERC20 с помощью MetaMask отменена" -#: src/gateway.php:1295 +#: src/gateway.php:1344 msgid "Copied to clipboard" msgstr "Скопировано в буфер обмена" @@ -689,6 +695,15 @@ msgstr "" msgid "Payment received for order %d" msgstr "Оплата получена для заказа № %d" +#~ msgid "Order expired: %s" +#~ msgstr "Заказ %s просрочен" + +#~ msgid "" +#~ "Do not close or reload this page until payment confirmation complete." +#~ msgstr "" +#~ "Не закрывайте и не перезагружайте страницу! Дождитесь подтверждения " +#~ "оплаты." + #~ msgid "tx check for order: %s" #~ msgstr "проверка оплаты заказа %s" diff --git a/readme.txt b/readme.txt index 066ea3f..e2e3e9e 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: ethereumicoio Tags: woocommerce, ethereum, erc20, erc223, token, e-commerce, payment, crypto, blockchain Requires at least: 4.7 Tested up to: 4.9.5 -Stable tag: 2.3.0 +Stable tag: 2.3.1 Donate link: https://etherscan.io/address/0x476Bb28Bc6D0e9De04dB5E19912C392F9a76535d License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -142,6 +142,12 @@ This guaranties your safety as a plugin customer. The feePercent and maxFee valu == Changelog == + += 2.3.1 = + +* Order would be confirmed even if user closed the payment page before transaction was confirmed +* Copy buttons fix if clicked on icon + = 2.3.0 = * `Mark ERC20 token price up by %` option is added. To help cover currency fluctuations the plugin can automatically mark up converted rates for you. These are applied as percentage markup, so a 1 ERC20 Token value with a 1.00% markup will be presented to the customer as 1.01 Token. diff --git a/src/gateway.php b/src/gateway.php index 705897c..edd63cc 100644 --- a/src/gateway.php +++ b/src/gateway.php @@ -3,6 +3,7 @@ namespace Ethereumico\Epg; require $GLOBALS['ether-and-erc20-tokens-woocommerce-payment-gateway']->base_path . '/vendor/autoload.php'; +require_once $GLOBALS['ether-and-erc20-tokens-woocommerce-payment-gateway']->base_path . '/vendor/prospress/action-scheduler/action-scheduler.php'; use Web3\Web3; use Web3\Providers\HttpProvider; @@ -247,6 +248,54 @@ function __construct() { add_action('woocommerce_thankyou_ether-and-erc20-tokens-woocommerce-payment-gateway', array($this, 'thank_you_page')); add_action( 'wp_enqueue_scripts', array( $this, 'register_plugin_styles' ) ); + + add_action( 'woocommerce_order_status_on-hold', array( $this, 'order_on_hold_handler' ) ); + } + + public function order_on_hold_handler($order_id) { + $this->enqueue_complete_order_task($order_id); + } + + public function enqueue_complete_order_task($order_id, $offset = 0/* seconds */) { + $this->cancel_complete_order_task($order_id); + $timestamp = time() + $offset; + $hook = 'ether_and_erc20_tokens_woocommerce_payment_gateway_complete_order'; + $args = array($order_id); + $task_id = wc_schedule_single_action( $timestamp, $hook, $args ); + $GLOBALS['ether-and-erc20-tokens-woocommerce-payment-gateway']->log("Task complete_order with id $task_id scheduled for order: $order_id"); + } + public function cancel_complete_order_task($order_id) { + $hook = "ether_and_erc20_tokens_woocommerce_payment_gateway_complete_order"; + $args = array($order_id); + wc_unschedule_action( $hook, $args ); + $GLOBALS['ether-and-erc20-tokens-woocommerce-payment-gateway']->log("Task complete_order unscheduled for order: $order_id"); + } + + public function complete_order($order_id) { + $tokens_supported = esc_attr($this->settings['tokens_supported']); + $providerUrl = $this->getWeb3Endpoint(); + $blockchainNetwork = esc_attr($this->settings['blockchain_network']); + $marketAddress = $this->getMarketAddress(); + $paymentSuccess = $this->check_tx_status( + $order_id, $tokens_supported, $this->getOrderExpiredTimeout(), $providerUrl, $blockchainNetwork, $marketAddress, true + ); + if (!$paymentSuccess) { + // re-enqueue itself to check later + $this->enqueue_complete_order_task($order_id, 1 * 60); + } + } + + public function complete_order_internal($order_id) { + $tokens_supported = esc_attr($this->settings['tokens_supported']); + $providerUrl = $this->getWeb3Endpoint(); + $blockchainNetwork = esc_attr($this->settings['blockchain_network']); + $marketAddress = $this->getMarketAddress(); + $paymentSuccess = $this->check_tx_status( + $order_id, $tokens_supported, $this->getOrderExpiredTimeout(), $providerUrl, $blockchainNetwork, $marketAddress, true + ); + if ($paymentSuccess) { + $this->cancel_complete_order_task($order_id); + } } public function valid_order_statuses_for_payment($statuses = array()) { @@ -524,7 +573,18 @@ function init_form_fields() { 'type' => 'title', 'description' => sprintf( __('Install the %1$sCryptocurrency Product for WooCommerce plugin%2$s!', 'ethereum-wallet') - , '' + , '' + , '' + ), + ), + ); + $this->form_fields += array( + 'ads5' => array( + 'title' => __('Want to create Ethereum wallets on your Wordpress site?', 'ether-and-erc20-tokens-woocommerce-payment-gateway'), + 'type' => 'title', + 'description' => sprintf( + __('Install the %1$sWordPress Ethereum Wallet plugin%2$s!', 'ethereum-wallet') + , '' , '' ), ), @@ -625,7 +685,7 @@ function process_payment($order_id) { } function check_tx_status( - $order_id, $tokens_supported, $orderExpiredTimeout, $event_timeout_sec + $order_id, $tokens_supported, $orderExpiredTimeout , $providerUrl, $blockchainNetwork, $marketAddress, $standalone = false ) { $order = new WC_Order($order_id); @@ -647,14 +707,16 @@ function check_tx_status( if ($standalone) { $GLOBALS['ether-and-erc20-tokens-woocommerce-payment-gateway']->log( sprintf( - __('Order expired: %s', 'ether-and-erc20-tokens-woocommerce-payment-gateway'), $order_id + __('Order expired. Order updated to failed: %s', 'ether-and-erc20-tokens-woocommerce-payment-gateway'), $order_id ) ); $order->add_order_note( __('Order was expired.', 'ether-and-erc20-tokens-woocommerce-payment-gateway') ); + $order->update_status('failed', __('Order was expired.', 'ether-and-erc20-tokens-woocommerce-payment-gateway')); } - return false; + // stop cron job re-enqueue + return true; } } @@ -735,22 +797,9 @@ function check_tx_status( public function thank_you_page($order_id) { // set task to check tx state and complete order if needed $tokens_supported = esc_attr($this->settings['tokens_supported']); - $providerUrl = $this->getWeb3Endpoint(); - $blockchainNetwork = esc_attr($this->settings['blockchain_network']); - $marketAddress = $this->getMarketAddress(); - $event_timeout_sec = $this->getEventTimeoutSec(); - $params = array( - $order_id, - $tokens_supported, - $this->getOrderExpiredTimeout(), - $event_timeout_sec, - $providerUrl, - $blockchainNetwork, - $marketAddress - ); - $paymentSuccess = $this->check_tx_status( - $order_id, $tokens_supported, $this->getOrderExpiredTimeout(), $event_timeout_sec, $providerUrl, $blockchainNetwork, $marketAddress, true - ); + + // try to complete order if payment succeeded + $this->complete_order_internal($order_id); $eth_value = ether_and_erc20_tokens_woocommerce_payment_gateway_getEthValueByOrderId($order_id); list($eth_value_with_dust, $eth_value_with_dust_str) = ether_and_erc20_tokens_woocommerce_payment_gateway_getEthValueWithDustByOrderId($eth_value, $order_id); @@ -941,13 +990,13 @@ class="form-control"> - - + -->
@@ -1217,13 +1266,13 @@ class="form-control">
- - + -->
@@ -1245,11 +1294,11 @@ class="form-control"> $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'wooetherc20paymentgateway', - $base_url . "/js/ether-and-erc20-tokens-woocommerce-payment-gateway{$min}.js", array('jquery', 'bootstrap.wizard', 'web3', 'jquery.qrcode'), '2.3.0' + $base_url . "/js/ether-and-erc20-tokens-woocommerce-payment-gateway{$min}.js", array('jquery', 'bootstrap.wizard', 'web3', 'jquery.qrcode'), '2.3.1' ); wp_enqueue_style( 'wooetherc20paymentgateway', - $base_url . "/css/ether-and-erc20-tokens-woocommerce-payment-gateway.css", array('bootstrap-ether-and-erc20-tokens-woocommerce-payment-gateway'), '2.3.0' + $base_url . "/css/ether-and-erc20-tokens-woocommerce-payment-gateway.css", array('bootstrap-ether-and-erc20-tokens-woocommerce-payment-gateway'), '2.3.1' ); $web3Endpoint = $this->getWeb3Endpoint(); @@ -1272,7 +1321,7 @@ class="form-control"> 'order_id' => $order_id, 'web3Endpoint' => esc_html($web3Endpoint), // translations - 'str_page_unload_text' => __('Do not close or reload this page until payment confirmation complete.', 'ether-and-erc20-tokens-woocommerce-payment-gateway'), +// 'str_page_unload_text' => __('Do not close or reload this page until payment confirmation complete.', 'ether-and-erc20-tokens-woocommerce-payment-gateway'), 'str_make_deposit_button_text' => __('Deposit with MetaMask', 'ether-and-erc20-tokens-woocommerce-payment-gateway'), 'str_pay_button_text' => __('Pay with MetaMask', 'ether-and-erc20-tokens-woocommerce-payment-gateway'), 'str_download_metamask' => __('Download MetaMask', 'ether-and-erc20-tokens-woocommerce-payment-gateway'), @@ -1384,15 +1433,9 @@ public function getMarketAddress() { return esc_attr($this->settings['payment_address']); } - public function getEventTimeoutSec() { - // TODO: use tx_check_period - return 60; -// return $this->settings['tx_check_period']; - } - public function getOrderExpiredTimeout() { // TODO: use order_expire_timeout - return 30 * 24 * 3600; // one month + return 1 * 24 * 3600; // one day // return $this->settings['order_expire_timeout']; }