diff --git a/README.md b/README.md index 586776d..c8a40f3 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,19 @@ -=== XPR Checkout: Webauth payment gateway === +=== XPRCheckout - WebAuth Gateway for Woocommerce === Requires at least: 6.0 -Tested up to: 6.6.1 +Tested up to: 6.7 Requires PHP: 7.0 Stable tag: ##VERSION_TAG## License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html -# XPR Checkout: Webauth payment gateway +# XPRCheckout - WebAuth Gateway for Woocommerce *A WebAuth-Enabled Gateway for WooCommerce* ## The basic scope This plugin provides a payment gateway for WooCommerce that enables users to pay for their purchases using any cryptocurrency available in the WebAuth wallet. With this feature, users can enjoy a seamless and secure shopping experience, thank Proton, as they can easily pay for their purchases using their preferred digital currency. -XPR Checkout, through a hassle-free configuration, provides additional features to help store owners manage payment reconciliation, withdrawal, and refund inside the WooCommerce regular flow also driven by Webauth authentification. +XPR Checkout, through a hassle-free configuration, provides additional features to help store owners manage payment reconciliation, withdrawal, and refund inside the WooCommerce regular flow also driven by Webauth authentication. Overall, this plugin helps to expand the use of cryptocurrencies through the proton chain in e-commerce, making it easier and more convenient for users to use their digital assets for online shopping. @@ -65,7 +65,7 @@ Register a store to allow payment and multi-balance storage (for different token Remove a store from the store list, but keep the balance stored. - **Refund by the store owner (pay.refund)** -Allow the refund of payment by flaging flag the payment as “REFUNDED”. +Allow the refund of payment by flagging flag the payment as “REFUNDED”. - **No more Withdraw of payments by the store owner (bal.claim)** No need to withdraw payment are directly transferred to the store owner through the @xprckechout smart contract. diff --git a/includes/controllers/Orders.php b/includes/controllers/Orders.php index c998f84..bce0bb1 100644 --- a/includes/controllers/Orders.php +++ b/includes/controllers/Orders.php @@ -107,8 +107,8 @@ public function mutateOrdersColumnsHeader($columns) foreach ($columns as $column_name => $column_info) { $new_columns[$column_name] = $column_info; if ('order_status' === $column_name) { - $new_columns['transactionId'] = __('Transaction', 'xprcheckout'); // title - $new_columns['net'] = __('Mainnet/testnet', 'xprcheckout'); // title + $new_columns['transactionId'] = __('Transaction', 'xprcheckout_gateway'); // title + $new_columns['net'] = __('Mainnet/testnet', 'xprcheckout_gateway'); // title } } return $new_columns; diff --git a/includes/controllers/Refund.php b/includes/controllers/Refund.php index f63ae9e..79d4959 100644 --- a/includes/controllers/Refund.php +++ b/includes/controllers/Refund.php @@ -70,7 +70,7 @@ public function registerMetabox() { add_meta_box( 'woocommerce-xprcheckout-payment', - __('XPRCheckout payment', 'xprcheckout'), + __('XPRCheckout payment', 'xprcheckout_gateway'), [$this, 'renderMetabox'], 'shop_order', 'advanced', @@ -100,7 +100,7 @@ public function renderMetabox($post) $baseConfig['orderStatus']= $order->get_status(); $baseConfig['orderStatus']= $order->get_status(); ?> - window.pluginConfig = ; + window.pluginConfig = ;
query($wpdb->prepare( "INSERT INTO wp_%1s (symbol,contract,token_precision,rate) VALUES (%s,%s,%d,%.12f) @@ -105,9 +105,6 @@ function ($matches) { })); } catch (Exception $e) { - error_log('JSON Processing Error: ' . $e->getMessage()); - error_log('JSON Error Code: ' . json_last_error()); - error_log('JSON Error Message: ' . json_last_error_msg()); return null; } } diff --git a/includes/templates/template-payments.php b/includes/templates/template-payments.php index b5c1295..79c6be1 100644 --- a/includes/templates/template-payments.php +++ b/includes/templates/template-payments.php @@ -16,12 +16,12 @@ payment_scripts(); ?> - "> + ">
diff --git a/includes/woocommerce/gateway/xprcheckout-gateway.php b/includes/woocommerce/gateway/xprcheckout-gateway.php index 13a2ff8..1d51960 100644 --- a/includes/woocommerce/gateway/xprcheckout-gateway.php +++ b/includes/woocommerce/gateway/xprcheckout-gateway.php @@ -1,22 +1,11 @@ id = 'xprcheckout'; $this->icon = apply_filters('woocommerce_cod_icon', ''); - $this->title = __('XPR Checkout', 'xprcheckout'); - $this->method_title = __('XPR Checkout', 'xprcheckout'); - $this->method_description = __('Provides a Webauth wallet Payment Gateway for your customer.', 'xprcheckout'); + $this->title = __('XPR Checkout', 'xprcheckout_gateway'); + $this->method_title = __('XPR Checkout', 'xprcheckout_gateway'); + $this->method_description = __('Provides a Webauth wallet Payment Gateway for your customer.', 'xprcheckout_gateway'); $this->has_fields = false; } @@ -64,75 +53,75 @@ public function init_form_fields() { $this->form_fields = array( 'enabled' => array( - 'title' => __('Enable/Disable', 'xprcheckout'), + 'title' => __('Enable/Disable', 'xprcheckout_gateway'), 'type' => 'checkbox', - 'label' => __('Enable Webauth Payment', 'xprcheckout'), + 'label' => __('Enable Webauth Payment', 'xprcheckout_gateway'), 'default' => 'yes' ), 'network' => array( - 'title' => __('Select network', 'xprcheckout'), + 'title' => __('Select network', 'xprcheckout_gateway'), 'type' => 'select', 'options' => [ 'mainnet' => 'Mainnet', 'testnet' => 'Testnet', ], - 'label' => __('Select network', 'xprcheckout'), + 'label' => __('Select network', 'xprcheckout_gateway'), 'default' => 'testnet', 'value' ), 'registered' => array( - 'title' => __('Register store ', 'xprcheckout'), + 'title' => __('Register store ', 'xprcheckout_gateway'), 'type' => 'xprcheckout_register', - 'description' => __('Register you store nearby the smart contract', 'xprcheckout'), + 'description' => __('Register you store nearby the smart contract', 'xprcheckout_gateway'), 'desc_tip' => true, ), 'title' => array( - 'title' => __('Title', 'xprcheckout'), + 'title' => __('Title', 'xprcheckout_gateway'), 'type' => 'text', 'default' => 'Pay with WebAuth', - 'description' => __('This controls the title which the user sees during checkout.', 'xprcheckout'), + 'description' => __('This controls the title which the user sees during checkout.', 'xprcheckout_gateway'), 'desc_tip' => true, ), 'description' => array( - 'title' => __('Description', 'xprcheckout'), + 'title' => __('Description', 'xprcheckout_gateway'), 'type' => 'textarea', - 'description' => __('This controls the title which the user sees during checkout.', 'xprcheckout'), - 'default' => __('Pay securely with with multiple crypto currencies through WebAuth with zero gas fee', 'xprcheckout'), + 'description' => __('This controls the title which the user sees during checkout.', 'xprcheckout_gateway'), + 'default' => __('Pay securely with with multiple crypto currencies through WebAuth with zero gas fee', 'xprcheckout_gateway'), 'desc_tip' => true, ), 'wallet' => array( - 'title' => __('Mainnet account', 'xprcheckout'), + 'title' => __('Mainnet account', 'xprcheckout_gateway'), 'type' => 'hidden', - 'description' => __('Set the destination account on mainnet where pay token will be paid. Used only when "Use testnet" option is disabled', 'xprcheckout'), + 'description' => __('Set the destination account on mainnet where pay token will be paid. Used only when "Use testnet" option is disabled', 'xprcheckout_gateway'), 'desc_tip' => true, ), 'appName' => array( - 'title' => __('dApp Name', 'xprcheckout'), + 'title' => __('dApp Name', 'xprcheckout_gateway'), 'type' => 'text', - 'description' => __('The application name displayed in the webauth modal', 'xprcheckout'), - 'default' => __('My awesome store', 'xprcheckout'), + 'description' => __('The application name displayed in the webauth modal', 'xprcheckout_gateway'), + 'default' => __('My awesome store', 'xprcheckout_gateway'), 'desc_tip' => true, ), /*'appLogo' => array( - 'title' => __('dApp Logo', 'xprcheckout'), + 'title' => __('dApp Logo', 'xprcheckout_gateway'), 'type' => 'text', - 'description' => __('The application logo displayed in the webauth modal', 'xprcheckout'), + 'description' => __('The application logo displayed in the webauth modal', 'xprcheckout_gateway'), 'desc_tip' => true, ),*/ 'allowedTokens' => array( - 'title' => __('Allowed Tokens', 'xprcheckout'), + 'title' => __('Allowed Tokens', 'xprcheckout_gateway'), 'type' => 'text', - 'description' => __('Accepted tokens as payment for transfer, will be displayed in the payments process flow. Specify a uppercase only, coma separated, tokens list', 'xprcheckout'), - 'default' => __('XPR,XUSDC', 'xprcheckout'), + 'description' => __('Accepted tokens as payment for transfer, will be displayed in the payments process flow. Specify a uppercase only, coma separated, tokens list', 'xprcheckout_gateway'), + 'default' => __('XPR,XUSDC', 'xprcheckout_gateway'), 'desc_tip' => true, ), 'currencyApi' => array( - 'title' => __('Free api key ', 'xprcheckout'), + 'title' => __('Free api key ', 'xprcheckout_gateway'), 'type' => 'text', - 'description' => __('We provide limited one. You can register yours for free here.', 'xprcheckout'), + 'description' => __('We provide limited one. You can register yours for free here.', 'xprcheckout_gateway'), 'desc_tip' => false, ), ); @@ -274,7 +263,7 @@ public function generate_xprcheckout_register_html($key, $data) $baseConfig['walletInputSelector']= "#woocommerce_xprcheckout_wallet"; ?> - window.pluginConfig = ; + window.pluginConfig = ; @@ -345,7 +334,7 @@ public function generate_hidden_html($key, $data) function xprcheckout_redirect_on_new_order($order) { - if(WC()->session->chosen_payment_method == 'xprcheckout'){ + if(WC()->session->chosen_payment_method == 'xprcheckout_gateway'){ $this->xprcheckout_redirect_to_payment_page(); } diff --git a/xprcheckout_gateway.php b/xprcheckout.php similarity index 99% rename from xprcheckout_gateway.php rename to xprcheckout.php index 791621c..785051c 100644 --- a/xprcheckout_gateway.php +++ b/xprcheckout.php @@ -6,7 +6,7 @@ * Author: Rémy Chauveau AKA Rockerone * Author URI: rockerone.io * Version: ##VERSION_TAG## - * slug: xprcheckout + * slug: xprcheckout_gateway * Text Domain: xprcheckout_gateway * Domain Path: /i18n/languages/ * License: GPLv2 or later