mirror of
https://git.wownero.com/wownero/wownerowp.git
synced 2024-08-15 01:03:16 +00:00
such wow
This commit is contained in:
parent
572f04dfba
commit
b9e5fcc96e
21 changed files with 152 additions and 157 deletions
|
@ -1,8 +1,7 @@
|
|||
<?php
|
||||
/*
|
||||
* Copyright (c) 2018, Ryo Currency Project
|
||||
* Copyright (c) 2018, Fireice Trust Fund
|
||||
* Admin interface for Monero gateway
|
||||
* Authors: mosu-forge
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
@ -27,7 +26,7 @@ class Monero_Admin_Interface {
|
|||
public function meta_boxes() {
|
||||
add_meta_box(
|
||||
'monero_admin_order_details',
|
||||
__('Monero Gateway','monero_gateway'),
|
||||
__('Wownero Gateway','wownero_gateway'),
|
||||
array($this, 'meta_box_order_details'),
|
||||
'shop_order',
|
||||
'normal',
|
||||
|
@ -47,28 +46,28 @@ class Monero_Admin_Interface {
|
|||
*/
|
||||
public function admin_menu() {
|
||||
add_menu_page(
|
||||
__('Monero', 'monero_gateway'),
|
||||
__('Monero', 'monero_gateway'),
|
||||
__('Wownero', 'wownero_gateway'),
|
||||
__('Wownero', 'wownero_gateway'),
|
||||
'manage_woocommerce',
|
||||
'monero_gateway',
|
||||
'wownero_gateway',
|
||||
array($this, 'orders_page'),
|
||||
MONERO_GATEWAY_PLUGIN_URL.'/assets/images/monero-icon-admin.png',
|
||||
MONERO_GATEWAY_PLUGIN_URL.'/assets/images/wownero-icon-admin.png',
|
||||
56 // Position on menu, woocommerce has 55.5, products has 55.6
|
||||
);
|
||||
|
||||
add_submenu_page(
|
||||
'monero_gateway',
|
||||
__('Payments', 'monero_gateway'),
|
||||
__('Payments', 'monero_gateway'),
|
||||
'wownero_gateway',
|
||||
__('Payments', 'wownero_gateway'),
|
||||
__('Payments', 'wownero_gateway'),
|
||||
'manage_woocommerce',
|
||||
'monero_gateway_payments',
|
||||
'wownero_gateway_payments',
|
||||
array($this, 'payments_page')
|
||||
);
|
||||
|
||||
$settings_page = add_submenu_page(
|
||||
'monero_gateway',
|
||||
__('Settings', 'monero_gateway'),
|
||||
__('Settings', 'monero_gateway'),
|
||||
'wownero_gateway',
|
||||
__('Settings', 'wownero_gateway'),
|
||||
__('Settings', 'wownero_gateway'),
|
||||
'manage_options',
|
||||
'monero_gateway_settings',
|
||||
array($this, 'settings_page')
|
||||
|
@ -81,8 +80,8 @@ class Monero_Admin_Interface {
|
|||
*/
|
||||
public function admin_menu_update() {
|
||||
global $submenu;
|
||||
if (isset($submenu['monero_gateway'])) {
|
||||
unset($submenu['monero_gateway'][0]);
|
||||
if (isset($submenu['wownero_gateway'])) {
|
||||
unset($submenu['wownero_gateway'][0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,7 +104,7 @@ class Monero_Admin_Interface {
|
|||
public function settings_page_init() {
|
||||
global $current_tab, $current_section;
|
||||
|
||||
$current_section = 'monero_gateway';
|
||||
$current_section = 'wownero_gateway';
|
||||
$current_tab = 'checkout';
|
||||
|
||||
// Include settings pages.
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<?php
|
||||
/*
|
||||
* Copyright (c) 2018, Ryo Currency Project
|
||||
* Copyright (c) 2018, Fireice Trust Fund
|
||||
* Admin interface for Monero gateway
|
||||
* Authors: mosu-forge
|
||||
*/
|
||||
|
||||
if(!class_exists('WP_List_Table')) {
|
||||
|
@ -54,7 +53,7 @@ class Monero_Admin_Payments_List extends WP_List_Table {
|
|||
} else {
|
||||
$tab_info['all']['active'] = 'class="current" aria-current="page"';
|
||||
}
|
||||
if(Monero_Gateway::get_confirm_type() == 'monero-wallet-rpc') {
|
||||
if(Monero_Gateway::get_confirm_type() == 'wownero-wallet-rpc') {
|
||||
$balance = Monero_Gateway::admin_balance_info();
|
||||
$balance_info = <<<HTML
|
||||
<div style="border:1px solid #ddd;padding:5px 10px;">
|
||||
|
@ -69,32 +68,32 @@ HTML;
|
|||
}
|
||||
echo <<<HTML
|
||||
<div class="wrap">
|
||||
<h1 class="wp-heading-inline">Monero Payments</h1>
|
||||
<h1 class="wp-heading-inline">Wownero Payments</h1>
|
||||
$balance_info
|
||||
<hr class="wp-header-end">
|
||||
<ul class="subsubsub">
|
||||
<li>
|
||||
<a href="?page=monero_gateway_payments&type=all" {$tab_info['all']['active']}>
|
||||
<a href="?page=wownero_gateway_payments&type=all" {$tab_info['all']['active']}>
|
||||
All <span class="count">({$tab_info['all']['count']})</span>
|
||||
</a> |
|
||||
</li>
|
||||
<li style="display:none">
|
||||
<a href="?page=monero_gateway_payments&type=pending" {$tab_info['pending']['active']}>
|
||||
<a href="?page=wownero_gateway_payments&type=pending" {$tab_info['pending']['active']}>
|
||||
Pending <span class="count">({$tab_info['pending']['count']})</span>
|
||||
</a> |
|
||||
</li>
|
||||
<li>
|
||||
<a href="?page=monero_gateway_payments&type=paid" {$tab_info['paid']['active']}>
|
||||
<a href="?page=wownero_gateway_payments&type=paid" {$tab_info['paid']['active']}>
|
||||
Received <span class="count">({$tab_info['paid']['count']})</span>
|
||||
</a> |
|
||||
</li>
|
||||
<li>
|
||||
<a href="?page=monero_gateway_payments&type=confirmed" {$tab_info['confirmed']['active']}>
|
||||
<a href="?page=wownero_gateway_payments&type=confirmed" {$tab_info['confirmed']['active']}>
|
||||
Confirmed <span class="count">({$tab_info['confirmed']['count']})</span>
|
||||
</a> |
|
||||
</li>
|
||||
<li>
|
||||
<a href="?page=monero_gateway_payments&type=expired" {$tab_info['expired']['active']}>
|
||||
<a href="?page=wownero_gateway_payments&type=expired" {$tab_info['expired']['active']}>
|
||||
Expired <span class="count">({$tab_info['expired']['count']})</span>
|
||||
</a>
|
||||
</li>
|
||||
|
@ -107,7 +106,7 @@ HTML;
|
|||
</p>
|
||||
$hidden_fields
|
||||
</form>
|
||||
<h2 class="screen-reader-text">Monero Payments List</h2>
|
||||
<h2 class="screen-reader-text">Wownero Payments List</h2>
|
||||
<style>
|
||||
#col_order_id { width: 150px; }
|
||||
#col_payment_id { width: 150px; }
|
||||
|
@ -145,7 +144,7 @@ HTML;
|
|||
echo $item->height;
|
||||
break;
|
||||
case 'col_amount':
|
||||
echo Monero_Gateway::format_monero($item->amount).' Monero';
|
||||
echo Monero_Gateway::format_monero($item->amount).' Wownero';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -200,7 +199,7 @@ HTML;
|
|||
}
|
||||
|
||||
public function no_items() {
|
||||
esc_html_e('No Monero payments found', 'monero_gateway');
|
||||
esc_html_e('No Wownero payments found', 'wownero_gateway');
|
||||
}
|
||||
|
||||
protected function get_filter_vars() {
|
||||
|
|
|
@ -4,117 +4,117 @@ defined( 'ABSPATH' ) || exit;
|
|||
|
||||
return array(
|
||||
'enabled' => array(
|
||||
'title' => __('Enable / Disable', 'monero_gateway'),
|
||||
'label' => __('Enable this payment gateway', 'monero_gateway'),
|
||||
'title' => __('Enable / Disable', 'wownero_gateway'),
|
||||
'label' => __('Enable this payment gateway', 'wownero_gateway'),
|
||||
'type' => 'checkbox',
|
||||
'default' => 'no'
|
||||
),
|
||||
'title' => array(
|
||||
'title' => __('Title', 'monero_gateway'),
|
||||
'title' => __('Title', 'wownero_gateway'),
|
||||
'type' => 'text',
|
||||
'desc_tip' => __('Payment title the customer will see during the checkout process.', 'monero_gateway'),
|
||||
'default' => __('Monero Gateway', 'monero_gateway')
|
||||
'desc_tip' => __('Payment title the customer will see during the checkout process.', 'wownero_gateway'),
|
||||
'default' => __('Wownero Gateway', 'wownero_gateway')
|
||||
),
|
||||
'description' => array(
|
||||
'title' => __('Description', 'monero_gateway'),
|
||||
'title' => __('Description', 'wownero_gateway'),
|
||||
'type' => 'textarea',
|
||||
'desc_tip' => __('Payment description the customer will see during the checkout process.', 'monero_gateway'),
|
||||
'default' => __('Pay securely using Monero. You will be provided payment details after checkout.', 'monero_gateway')
|
||||
'desc_tip' => __('Payment description the customer will see during the checkout process.', 'wownero_gateway'),
|
||||
'default' => __('Pay securely using Wownero. You will be provided payment details after checkout.', 'wownero_gateway')
|
||||
),
|
||||
'discount' => array(
|
||||
'title' => __('Discount for using Monero', 'monero_gateway'),
|
||||
'desc_tip' => __('Provide a discount to your customers for making a private payment with Monero', 'monero_gateway'),
|
||||
'description' => __('Enter a percentage discount (i.e. 5 for 5%) or leave this empty if you do not wish to provide a discount', 'monero_gateway'),
|
||||
'title' => __('Discount for using Wownero', 'wownero_gateway'),
|
||||
'desc_tip' => __('Provide a discount to your customers for making a private payment with Wownero', 'wownero_gateway'),
|
||||
'description' => __('Enter a percentage discount (i.e. 5 for 5%) or leave this empty if you do not wish to provide a discount', 'wownero_gateway'),
|
||||
'type' => __('number'),
|
||||
'default' => '0'
|
||||
),
|
||||
'valid_time' => array(
|
||||
'title' => __('Order valid time', 'monero_gateway'),
|
||||
'desc_tip' => __('Amount of time order is valid before expiring', 'monero_gateway'),
|
||||
'description' => __('Enter the number of seconds that the funds must be received in after order is placed. 3600 seconds = 1 hour', 'monero_gateway'),
|
||||
'title' => __('Order valid time', 'wownero_gateway'),
|
||||
'desc_tip' => __('Amount of time order is valid before expiring', 'wownero_gateway'),
|
||||
'description' => __('Enter the number of seconds that the funds must be received in after order is placed. 3600 seconds = 1 hour', 'wownero_gateway'),
|
||||
'type' => __('number'),
|
||||
'default' => '3600'
|
||||
),
|
||||
'confirms' => array(
|
||||
'title' => __('Number of confirmations', 'monero_gateway'),
|
||||
'desc_tip' => __('Number of confirms a transaction must have to be valid', 'monero_gateway'),
|
||||
'description' => __('Enter the number of confirms that transactions must have. Enter 0 to zero-confim. Each confirm will take approximately four minutes', 'monero_gateway'),
|
||||
'title' => __('Number of confirmations', 'wownero_gateway'),
|
||||
'desc_tip' => __('Number of confirms a transaction must have to be valid', 'wownero_gateway'),
|
||||
'description' => __('Enter the number of confirms that transactions must have. Enter 0 to zero-confim. Each confirm will take approximately four minutes', 'wownero_gateway'),
|
||||
'type' => __('number'),
|
||||
'default' => '5'
|
||||
'default' => '4'
|
||||
),
|
||||
'confirm_type' => array(
|
||||
'title' => __('Confirmation Type', 'monero_gateway'),
|
||||
'desc_tip' => __('Select the method for confirming transactions', 'monero_gateway'),
|
||||
'description' => __('Select the method for confirming transactions', 'monero_gateway'),
|
||||
'title' => __('Confirmation Type', 'wownero_gateway'),
|
||||
'desc_tip' => __('Select the method for confirming transactions', 'wownero_gateway'),
|
||||
'description' => __('Select the method for confirming transactions', 'wownero_gateway'),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'viewkey' => __('viewkey', 'monero_gateway'),
|
||||
'monero-wallet-rpc' => __('monero-wallet-rpc', 'monero_gateway')
|
||||
'viewkey' => __('viewkey', 'wownero_gateway'),
|
||||
'wownero-wallet-rpc' => __('wownero-wallet-rpc', 'wownero_gateway')
|
||||
),
|
||||
'default' => 'viewkey'
|
||||
),
|
||||
'monero_address' => array(
|
||||
'title' => __('Monero Address', 'monero_gateway'),
|
||||
'title' => __('Wownero Address', 'wownero_gateway'),
|
||||
'label' => __('Useful for people that have not a daemon online'),
|
||||
'type' => 'text',
|
||||
'desc_tip' => __('Monero Wallet Address (MoneroL)', 'monero_gateway')
|
||||
'desc_tip' => __('Wownero Wallet Address (MoneroL)', 'wownero_gateway')
|
||||
),
|
||||
'viewkey' => array(
|
||||
'title' => __('Secret Viewkey', 'monero_gateway'),
|
||||
'title' => __('Secret Viewkey', 'wownero_gateway'),
|
||||
'label' => __('Secret Viewkey'),
|
||||
'type' => 'text',
|
||||
'desc_tip' => __('Your secret Viewkey', 'monero_gateway')
|
||||
'desc_tip' => __('Your secret Viewkey', 'wownero_gateway')
|
||||
),
|
||||
'daemon_host' => array(
|
||||
'title' => __('Monero wallet RPC Host/IP', 'monero_gateway'),
|
||||
'title' => __('Wownero wallet RPC Host/IP', 'wownero_gateway'),
|
||||
'type' => 'text',
|
||||
'desc_tip' => __('This is the Daemon Host/IP to authorize the payment with', 'monero_gateway'),
|
||||
'desc_tip' => __('This is the Daemon Host/IP to authorize the payment with', 'wownero_gateway'),
|
||||
'default' => '127.0.0.1',
|
||||
),
|
||||
'daemon_port' => array(
|
||||
'title' => __('Monero wallet RPC port', 'monero_gateway'),
|
||||
'title' => __('Wownero wallet RPC port', 'wownero_gateway'),
|
||||
'type' => __('number'),
|
||||
'desc_tip' => __('This is the Wallet RPC port to authorize the payment with', 'monero_gateway'),
|
||||
'default' => '18080',
|
||||
'desc_tip' => __('This is the Wallet RPC port to authorize the payment with', 'wownero_gateway'),
|
||||
'default' => '34567',
|
||||
),
|
||||
'testnet' => array(
|
||||
'title' => __(' Testnet', 'monero_gateway'),
|
||||
'label' => __(' Check this if you are using testnet ', 'monero_gateway'),
|
||||
'title' => __(' Testnet', 'wownero_gateway'),
|
||||
'label' => __(' Check this if you are using testnet ', 'wownero_gateway'),
|
||||
'type' => 'checkbox',
|
||||
'description' => __('Advanced usage only', 'monero_gateway'),
|
||||
'description' => __('Advanced usage only', 'wownero_gateway'),
|
||||
'default' => 'no'
|
||||
),
|
||||
'javascript' => array(
|
||||
'title' => __(' Javascript', 'monero_gateway'),
|
||||
'label' => __(' Check this to ENABLE Javascript in Checkout page ', 'monero_gateway'),
|
||||
'title' => __(' Javascript', 'wownero_gateway'),
|
||||
'label' => __(' Check this to ENABLE Javascript in Checkout page ', 'wownero_gateway'),
|
||||
'type' => 'checkbox',
|
||||
'default' => 'no'
|
||||
),
|
||||
'onion_service' => array(
|
||||
'title' => __(' SSL warnings ', 'monero_gateway'),
|
||||
'label' => __(' Check to Silence SSL warnings', 'monero_gateway'),
|
||||
'title' => __(' SSL warnings ', 'wownero_gateway'),
|
||||
'label' => __(' Check to Silence SSL warnings', 'wownero_gateway'),
|
||||
'type' => 'checkbox',
|
||||
'description' => __('Check this box if you are running on an Onion Service (Suppress SSL errors)', 'monero_gateway'),
|
||||
'description' => __('Check this box if you are running on an Onion Service (Suppress SSL errors)', 'wownero_gateway'),
|
||||
'default' => 'no'
|
||||
),
|
||||
'show_qr' => array(
|
||||
'title' => __('Show QR Code', 'monero_gateway'),
|
||||
'label' => __('Show QR Code', 'monero_gateway'),
|
||||
'title' => __('Show QR Code', 'wownero_gateway'),
|
||||
'label' => __('Show QR Code', 'wownero_gateway'),
|
||||
'type' => 'checkbox',
|
||||
'description' => __('Enable this to show a QR code after checkout with payment details.'),
|
||||
'default' => 'no'
|
||||
),
|
||||
'use_monero_price' => array(
|
||||
'title' => __('Show Prices in Monero', 'monero_gateway'),
|
||||
'label' => __('Show Prices in Monero', 'monero_gateway'),
|
||||
'title' => __('Show Prices in Wownero', 'wownero_gateway'),
|
||||
'label' => __('Show Prices in Wownero', 'wownero_gateway'),
|
||||
'type' => 'checkbox',
|
||||
'description' => __('Enable this to convert ALL prices on the frontend to Monero (experimental)'),
|
||||
'description' => __('Enable this to convert ALL prices on the frontend to Wownero (experimental)'),
|
||||
'default' => 'no'
|
||||
),
|
||||
'use_monero_price_decimals' => array(
|
||||
'title' => __('Display Decimals', 'monero_gateway'),
|
||||
'title' => __('Display Decimals', 'wownero_gateway'),
|
||||
'type' => __('number'),
|
||||
'description' => __('Number of decimal places to display on frontend. Upon checkout exact price will be displayed.'),
|
||||
'default' => 12,
|
||||
'default' => 11,
|
||||
),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue