dev
wowario 3 years ago
parent 572f04dfba
commit b9e5fcc96e
No known key found for this signature in database
GPG Key ID: 24DCBE762DE9C111

@ -1,7 +1,7 @@
MIT License
Copyright (c) 2017-2018, Monero Integrations
Copyright (c) 2018, Ryo Currency Project
Copyright (c) 2018, Fireice Trust Fund
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

@ -22,7 +22,7 @@
### Automatic Method
In the "Add Plugins" section of the WordPress admin UI, search for "monero" and click the Install Now button next to "Monero WooCommerce Extension" by mosu-forge, SerHack. This will enable auto-updates, but only for official releases, so if you need to work from git master or your local fork, please use the manual method below.
In the "Add Plugins" section of the WordPress admin UI, search for "monero" and click the Install Now button next to "Monero WooCommerce Extension" by SerHack. This will enable auto-updates, but only for official releases, so if you need to work from git master or your local fork, please use the manual method below.
### Manual Method
@ -109,5 +109,3 @@ This will display a badge showing that you accept Monero-currency.
## Donations
monero-integrations: 44krVcL6TPkANjpFwS2GWvg1kJhTrN7y9heVeQiDJ3rP8iGbCd5GeA4f3c2NKYHC1R4mCgnW7dsUUUae2m9GiNBGT4T8s2X
ryo-currency: 4A6BQp7do5MTxpCguq1kAS27yMLpbHcf89Ha2a8Shayt2vXkCr6QRpAXr1gLYRV5esfzoK3vLJTm5bDWk5gKmNrT6s6xZep

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 941 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Ryo Currency Project
* Copyright (c) 2018, Fireice Trust Fund
*/
function monero_showNotification(message, type='success') {
var toast = jQuery('<div class="' + type + '"><span>' + message + '</span></div>');
@ -62,7 +62,7 @@ function monero_updateDetails() {
break;
}
jQuery('#monero_exchange_rate').html('1 XMR = '+details.rate_formatted+' '+details.currency);
jQuery('#monero_exchange_rate').html('1 WOW = '+details.rate_formatted+' '+details.currency);
jQuery('#monero_total_amount').html(details.amount_total_formatted);
jQuery('#monero_total_paid').html(details.amount_paid_formatted);
jQuery('#monero_total_due').html(details.amount_due_formatted);
@ -87,7 +87,7 @@ function monero_updateDetails() {
'<a href="'+monero_explorer_url+'/tx/'+tx.txid+'" target="_blank">'+tx.txid+'</a>'+
'</td>'+
'<td>'+height+'</td>'+
'<td>'+tx.amount_formatted+' Monero</td>'+
'<td>'+tx.amount_formatted+' Wownero</td>'+
'</tr>';
jQuery('#monero_tx_table tbody').append(row);
@ -110,7 +110,7 @@ function monero_updateDetails() {
}
}
if(is_new_tx) {
monero_showNotification('Transaction received for '+new_txs[i].amount_formatted+' Monero');
monero_showNotification('Transaction received for '+new_txs[i].amount_formatted+' Wownero');
}
}
}

@ -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,
),
);

@ -7,7 +7,6 @@
*
* @author Serhack
* @author cryptochangements
* @author mosu-forge
*
*/

@ -1,7 +1,7 @@
<?php
/*
* Main Gateway of Monero using either a local daemon or the explorer
* Authors: SerHack, cryptochangements, mosu-forge
* Authors: SerHack, cryptochangements
*/
defined( 'ABSPATH' ) || exit;
@ -10,10 +10,10 @@ require_once('class-monero-cryptonote.php');
class Monero_Gateway extends WC_Payment_Gateway
{
private static $_id = 'monero_gateway';
private static $_title = 'Monero Gateway';
private static $_method_title = 'Monero Gateway';
private static $_method_description = 'Monero Gateway Plug-in for WooCommerce.';
private static $_id = 'wownero_gateway';
private static $_title = 'Wownero Gateway';
private static $_method_title = 'Wownero Gateway';
private static $_method_description = 'Wownero Gateway Plug-in for WooCommerce.';
private static $_errors = [];
private static $discount = false;
@ -35,21 +35,21 @@ class Monero_Gateway extends WC_Payment_Gateway
private static $monero_explorer_tools;
private static $log;
private static $currencies = array('BTC','USD','EUR','CAD','INR','GBP','COP','SGD','JPY');
private static $currencies = 'USD';
private static $rates = array();
private static $payment_details = array();
public function get_icon()
{
return apply_filters('woocommerce_gateway_icon', '<img src="'.MONERO_GATEWAY_PLUGIN_URL.'assets/images/monero-icon.png"/>', $this->id);
return apply_filters('woocommerce_gateway_icon', '<img src="'.MONERO_GATEWAY_PLUGIN_URL.'assets/images/wownero-icon.png"/>', $this->id);
}
function __construct($add_action=true)
{
$this->id = self::$_id;
$this->method_title = __(self::$_method_title, 'monero_gateway');
$this->method_description = __(self::$_method_description, 'monero_gateway');
$this->method_title = __(self::$_method_title, 'wownero_gateway');
$this->method_description = __(self::$_method_description, 'wownero_gateway');
$this->has_fields = false;
$this->supports = array(
'products',
@ -96,8 +96,8 @@ class Monero_Gateway extends WC_Payment_Gateway
// Initialize helper classes
self::$cryptonote = new Monero_Cryptonote();
if(self::$confirm_type == 'monero-wallet-rpc') {
require_once('class-monero-wallet-rpc.php');
if(self::$confirm_type == 'wownero-wallet-rpc') {
require_once('class-wownero-wallet-rpc.php');
self::$monero_wallet_rpc = new Monero_Wallet_Rpc(self::$host, self::$port);
} else {
require_once('class-monero-explorer-tools.php');
@ -118,7 +118,7 @@ class Monero_Gateway extends WC_Payment_Gateway
if (strlen($address) == 95 && substr($address, 0, 1) == '4')
if(self::$cryptonote->verify_checksum($address))
return $address;
self::$_errors[] = 'Monero address is invalid';
self::$_errors[] = 'Wownero address is invalid';
}
return $address;
}
@ -153,7 +153,7 @@ class Monero_Gateway extends WC_Payment_Gateway
public function admin_options()
{
$confirm_type = self::$confirm_type;
if($confirm_type === 'monero-wallet-rpc')
if($confirm_type === 'wownero-wallet-rpc')
$balance = self::admin_balance_info();
$settings_html = $this->generate_settings_html(array(), false);
@ -173,8 +173,8 @@ class Monero_Gateway extends WC_Payment_Gateway
$wallet_amount = self::$monero_wallet_rpc->getbalance();
$height = self::$monero_wallet_rpc->getheight();
if (!isset($wallet_amount)) {
self::$_errors[] = 'Cannot connect to monero-wallet-rpc';
self::$log->add('Monero_Payments', '[ERROR] Cannot connect to monero-wallet-rpc');
self::$_errors[] = 'Cannot connect to wownero-wallet-rpc';
self::$log->add('Monero_Payments', '[ERROR] Cannot connect to wownero-wallet-rpc');
return array(
'height' => 'Not Available',
'balance' => 'Not Available',
@ -183,8 +183,8 @@ class Monero_Gateway extends WC_Payment_Gateway
} else {
return array(
'height' => $height,
'balance' => self::format_monero($wallet_amount['balance']).' Monero',
'unlocked_balance' => self::format_monero($wallet_amount['unlocked_balance']).' Monero'
'balance' => self::format_monero($wallet_amount['balance']).' Wownero',
'unlocked_balance' => self::format_monero($wallet_amount['unlocked_balance']).' Wownero'
);
}
}
@ -213,7 +213,7 @@ class Monero_Gateway extends WC_Payment_Gateway
$order = wc_get_order($order_id);
if(self::$confirm_type != 'monero-wallet-rpc') {
if(self::$confirm_type != 'wownero-wallet-rpc') {
// Generate a unique payment id
do {
$payment_id = bin2hex(openssl_random_pseudo_bytes(8));
@ -241,7 +241,7 @@ class Monero_Gateway extends WC_Payment_Gateway
else{
// Critical, the price has not been retrivied.
$monero_amount = -1;
$error_message = "The price for Monero could not be retrieved. Please contact the merchant.";
$error_message = "The price for Wownero could not be retrieved. Please contact the merchant.";
self::$log->add('Monero_Payments', "[ERROR] Impossible to retrieve price for order: ".$order_id);
wc_add_notice( __('Payment error:', 'woothemes') . $error_message, 'error' );
return;
@ -255,7 +255,7 @@ class Monero_Gateway extends WC_Payment_Gateway
$query = $wpdb->prepare("INSERT INTO $table_name (order_id, payment_id, currency, rate, amount) VALUES (%d, %s, %s, %d, %d)", array($order_id, $payment_id, $currency, $rate, $monero_amount));
$wpdb->query($query);
$order->update_status('on-hold', __('Awaiting offline payment', 'monero_gateway'));
$order->update_status('on-hold', __('Awaiting offline payment', 'wownero_gateway'));
wc_reduce_stock_levels( $order_id );
WC()->cart->empty_cart(); // Remove cart
@ -275,7 +275,7 @@ class Monero_Gateway extends WC_Payment_Gateway
// Get Live Price
$currencies = implode(',', self::$currencies);
$api_link = 'https://min-api.cryptocompare.com/data/price?fsym=XMR&tsyms='.$currencies.'&extraParams=monero_woocommerce';
$api_link = 'https://api.coingecko.com/api/v3/coins/wownero/tickers?page=1';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
@ -283,7 +283,8 @@ class Monero_Gateway extends WC_Payment_Gateway
));
$resp = curl_exec($curl);
curl_close($curl);
$price = json_decode($resp, true);
$json = json_decode($resp, true);
$price = $json['tickers'][0]['converted_last']['usd'];
if(!isset($price['Response']) || $price['Response'] != 'Error') {
$table_name = $wpdb->prefix.'monero_gateway_live_rates';
@ -293,17 +294,17 @@ class Monero_Gateway extends WC_Payment_Gateway
$query = $wpdb->prepare("INSERT INTO `$table_name` (currency, rate, updated) VALUES (%s, %d, NOW()) ON DUPLICATE KEY UPDATE rate=%d, updated=NOW()", array( $currency, $rate, $rate));
$result = $wpdb->query($query);
if(!$result){
self::$log->add('Monero_Payments', "[ERROR] Impossible to write DB. Please check your DB connection or enable Debugging.");
self::$log->add('Wownero_Payments', "[ERROR] Impossible to write DB. Please check your DB connection or enable Debugging.");
}
}
}
else{
self::$log->add('Monero_Payments', "[ERROR] Unable to fetch prices from cryptocompare.com.");
self::$log->add('Monero_Payments', "[ERROR] Unable to fetch prices from coingecko.com.");
}
// Get current network/wallet height
if(self::$confirm_type == 'monero-wallet-rpc')
if(self::$confirm_type == 'wownero-wallet-rpc')
$height = self::$monero_wallet_rpc->getheight();
else
$height = self::$monero_explorer_tools->getheight();
@ -339,7 +340,7 @@ class Monero_Gateway extends WC_Payment_Gateway
$payment_id = self::sanatize_id($quote->payment_id);
$amount_monero = $quote->amount_total;
if(self::$confirm_type == 'monero-wallet-rpc')
if(self::$confirm_type == 'wownero-wallet-rpc')
$new_txs = self::check_payment_rpc($payment_id);
else
$new_txs = self::check_payment_explorer($payment_id);
@ -393,9 +394,9 @@ class Monero_Gateway extends WC_Payment_Gateway
unset(self::$payment_details[$order_id]);
if(self::is_virtual_in_cart($order_id) == true){
$order->update_status('completed', __('Payment has been received.', 'monero_gateway'));
$order->update_status('completed', __('Payment has been received.', 'wownero_gateway'));
} else {
$order->update_status('processing', __('Payment has been received.', 'monero_gateway'));
$order->update_status('processing', __('Payment has been received.', 'wownero_gateway'));
}
} else if($paid) {
@ -416,7 +417,7 @@ class Monero_Gateway extends WC_Payment_Gateway
unset(self::$payment_details[$order_id]);
$order->update_status('cancelled', __('Payment has expired.', 'monero_gateway'));
$order->update_status('cancelled', __('Payment has expired.', 'wownero_gateway'));
}
}
}
@ -528,7 +529,7 @@ class Monero_Gateway extends WC_Payment_Gateway
$address = self::$address;
$payment_id = self::sanatize_id($details[0]->payment_id);
if(self::$confirm_type == 'monero-wallet-rpc') {
if(self::$confirm_type == 'wownero-wallet-rpc') {
$integrated_addr = $payment_id;
} else {
if ($address) {
@ -537,8 +538,8 @@ class Monero_Gateway extends WC_Payment_Gateway
$pub_viewkey = $decoded_address['viewkey'];
$integrated_addr = self::$cryptonote->integrated_addr_from_keys($pub_spendkey, $pub_viewkey, $payment_id);
} else {
self::$log->add('Monero_Gateway', '[ERROR] Merchant has not set Monero address');
return '[ERROR] Merchant has not set Monero address';
self::$log->add('Wownero_Gateway', '[ERROR] Merchant has not set Wownero address');
return '[ERROR] Merchant has not set Wownero address';
}
}
@ -614,7 +615,7 @@ class Monero_Gateway extends WC_Payment_Gateway
self::ajax_output(array('error' => '[ERROR] Order does not belong to this user'));
if($order->get_payment_method() != self::$_id)
self::ajax_output(array('error' => '[ERROR] Order not paid for with Monero'));
self::ajax_output(array('error' => '[ERROR] Order not paid for with Wownero'));
$details = self::get_payment_details($order);
if(!is_array($details))
@ -725,7 +726,7 @@ class Monero_Gateway extends WC_Payment_Gateway
<span class="woocommerce-Price-amount amount" data-price="$price" data-currency="$currency"
data-rate="$rate" data-rate-type="live">
$monero_amount_formatted
<span class="woocommerce-Price-currencySymbol">XMR</span>
<span class="woocommerce-Price-currencySymbol">WOW</span>
</span>
HTML;
@ -756,7 +757,7 @@ HTML;
<span class="woocommerce-Price-amount amount" data-price="$price" data-currency="$currency"
data-rate="$rate" data-rate-type="fixed">
$monero_amount_formatted
<span class="woocommerce-Price-currencySymbol">XMR</span>
<span class="woocommerce-Price-currencySymbol">WOW</span>
</span>
HTML;

@ -8,7 +8,6 @@
* @author Kacper Rowinski <krowinski@implix.com>
* http://implix.com
* Modified to work with monero-rpc wallet by Serhack and cryptochangements
* Modified to work with monero-wallet-rpc wallet by mosu-forge
*/
defined( 'ABSPATH' ) || exit;
@ -178,7 +177,7 @@ class Monero_Wallet_Rpc
// check for curl error
if (0 < curl_errno($ch)) {
if(is_admin())
echo '[ERROR] Failed to connect to monero-wallet-rpc at ' . $this->host . ' port '. $this->port .'</br>';
echo '[ERROR] Failed to connect to wownero-wallet-rpc at ' . $this->host . ' port '. $this->port .'</br>';
}
// close the connection
curl_close($ch);

@ -2,24 +2,24 @@
/*
Plugin Name: Monero Woocommerce Gateway
Plugin URI: https://github.com/monero-integrations/monerowp
Description: Extends WooCommerce by adding a Monero Gateway
Description: Extends WooCommerce by adding a Wownero Gateway
Version: 3.0.1
Tested up to: 4.9.8
Author: mosu-forge, SerHack
Author: SerHack
Author URI: https://monerointegrations.com/
*/
// This code isn't for Dark Net Markets, please report them to Authority!
// This code is for Dark Net Markets
defined( 'ABSPATH' ) || exit;
// Constants, you can edit these if you fork this repo
define('MONERO_GATEWAY_MAINNET_EXPLORER_URL', 'https://xmrchain.net/');
define('MONERO_GATEWAY_MAINNET_EXPLORER_URL', 'https://explore.wownero.com/');
define('MONERO_GATEWAY_TESTNET_EXPLORER_URL', 'https://testnet.xmrchain.com/');
define('MONERO_GATEWAY_ADDRESS_PREFIX', 0x12);
define('MONERO_GATEWAY_ADDRESS_PREFIX_INTEGRATED', 0x13);
define('MONERO_GATEWAY_ATOMIC_UNITS', 12);
define('MONERO_GATEWAY_ADDRESS_PREFIX', 0x1032);
define('MONERO_GATEWAY_ADDRESS_PREFIX_INTEGRATED', 0x1A9A);
define('MONERO_GATEWAY_ATOMIC_UNITS', 11);
define('MONERO_GATEWAY_ATOMIC_UNIT_THRESHOLD', 10); // Amount under in atomic units payment is valid
define('MONERO_GATEWAY_DIFFICULTY_TARGET', 120);
define('MONERO_GATEWAY_DIFFICULTY_TARGET', 300);
// Do not edit these constants
define('MONERO_GATEWAY_PLUGIN_DIR', plugin_dir_path(__FILE__));
@ -43,8 +43,8 @@ function monero_init() {
// Include our Admin interface class
require_once('include/admin/class-monero-admin-interface.php');
add_filter('woocommerce_payment_gateways', 'monero_gateway');
function monero_gateway($methods) {
add_filter('woocommerce_payment_gateways', 'wownero_gateway');
function wownero_gateway($methods) {
$methods[] = 'Monero_Gateway';
return $methods;
}
@ -52,7 +52,7 @@ function monero_init() {
add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'monero_payment');
function monero_payment($links) {
$plugin_links = array(
'<a href="'.admin_url('admin.php?page=monero_gateway_settings').'">'.__('Settings', 'monero_gateway').'</a>'
'<a href="'.admin_url('admin.php?page=monero_gateway_settings').'">'.__('Settings', 'wownero_gateway').'</a>'
);
return array_merge($plugin_links, $links);
}
@ -61,7 +61,7 @@ function monero_init() {
function monero_cron_add_one_minute($schedules) {
$schedules['one_minute'] = array(
'interval' => 60,
'display' => __('Once every minute', 'monero_gateway')
'display' => __('Once every minute', 'wownero_gateway')
);
return $schedules;
}
@ -100,15 +100,15 @@ function monero_init() {
add_filter('woocommerce_currencies', 'monero_add_currency');
function monero_add_currency($currencies) {
$currencies['Monero'] = __('Monero', 'monero_gateway');
$currencies['Wownero'] = __('Wownero', 'wownero_gateway');
return $currencies;
}
add_filter('woocommerce_currency_symbol', 'monero_add_currency_symbol', 10, 2);
function monero_add_currency_symbol($currency_symbol, $currency) {
switch ($currency) {
case 'Monero':
$currency_symbol = 'XMR';
case 'Wownero':
$currency_symbol = 'WOW';
break;
}
return $currency_symbol;
@ -180,7 +180,7 @@ function monero_init() {
else
$rate_formatted = sprintf('%.5f', $rate / 1e8);
return "<span class=\"monero-price\">1 XMR = $rate_formatted $currency</span>";
return "<span class=\"monero-price\">1 WOW = $rate_formatted $currency</span>";
}
add_shortcode('monero-price', 'monero_price_func');

@ -1,5 +1,5 @@
=== Monero WooCommerce Extension ===
Contributors: SerHack, mosu-forge
Contributors: SerHack
Donate link: http://monerointegrations.com/donate.html
Tags: monero, woocommerce, integration, payment, merchant, cryptocurrency, accept monero, monero woocommerce
Requires at least: 4.0
@ -61,7 +61,7 @@ Once you installed and activated WooCommerce, you may install and activate Moner
* Bug fixing
= 3.0.0 =
Huge shoutout to mosu-forge who contributes a lot to make 3.0 possible.
Fuck you mosu-forge
* Ability to set number of confirms: 0 for zero conf, up to 60.
* Amount owed in XMR gets locked in after the order for a configurable amount of time after which the order is invalid, default 60 minutes.
* Shows transactions received along with the number of confirms right on the order success page, auto-updates through AJAX.

@ -1,19 +1,19 @@
<table class="striped" style="width:100%" cellspacing="0" cellpadding="5">
<tr>
<td>Exchange rate</td>
<td>1 XMR = <?php echo $details['rate_formatted'].' '.$details['currency']; ?></td>
<td>1 WOW = <?php echo $details['rate_formatted'].' '.$details['currency']; ?></td>
</tr>
<tr>
<td>Total amount</td>
<td><?php echo $details['amount_total_formatted']; ?> XMR</td>
<td><?php echo $details['amount_total_formatted']; ?> WOW</td>
</tr>
<tr>
<td>Total paid</td>
<td><?php echo $details['amount_paid_formatted']; ?> XMR</td>
<td><?php echo $details['amount_paid_formatted']; ?> WOW</td>
</tr>
<tr>
<td>Total due</td>
<td><?php echo $details['amount_due_formatted']; ?> XMR</td>
<td><?php echo $details['amount_due_formatted']; ?> WOW</td>
</tr>
<tr>
<td>Order age</td>
@ -75,7 +75,7 @@
<a href="<?php echo MONERO_GATEWAY_EXPLORER_URL.'tx/'.$tx['txid']; ?>" target="_blank"><?php echo $tx['txid']; ?></a>
</td>
<td><?php echo $tx['height']; ?></td>
<td><?php echo sprintf(MONERO_GATEWAY_ATOMIC_UNITS_SPRINTF, $tx['amount'] / MONERO_GATEWAY_ATOMIC_UNITS_POW); ?> XMR</td>
<td><?php echo sprintf(MONERO_GATEWAY_ATOMIC_UNITS_SPRINTF, $tx['amount'] / MONERO_GATEWAY_ATOMIC_UNITS_POW); ?> WOW</td>
</tr>
<?php endforeach; ?>
</table>

@ -1,10 +1,10 @@
<?php foreach($errors as $error): ?>
<div class="error"><p><strong>Monero Gateway Error</strong>: <?php echo $error; ?></p></div>
<div class="error"><p><strong>Wownero Gateway Error</strong>: <?php echo $error; ?></p></div>
<?php endforeach; ?>
<h1>Monero Gateway Settings</h1>
<h1>Wownero Gateway Settings</h1>
<?php if($confirm_type === 'monero-wallet-rpc'): ?>
<?php if($confirm_type === 'wownero-wallet-rpc'): ?>
<div style="border:1px solid #ddd;padding:5px 10px;">
<?php
echo 'Wallet height: ' . $balance['height'] . '</br>';
@ -18,12 +18,12 @@
<?php echo $settings_html ?>
</table>
<h4><a href="https://github.com/monero-integrations/monerowp">Learn more about using the Monero payment gateway</a></h4>
<h4><a href="https://github.com/monero-integrations/monerowp">Learn more about using the Wownero payment gateway</a></h4>
<script>
function moneroUpdateFields() {
var confirmType = jQuery("#woocommerce_monero_gateway_confirm_type").val();
if(confirmType == "monero-wallet-rpc") {
if(confirmType == "wownero-wallet-rpc") {
jQuery("#woocommerce_monero_gateway_monero_address").closest("tr").hide();
jQuery("#woocommerce_monero_gateway_viewkey").closest("tr").hide();
jQuery("#woocommerce_monero_gateway_daemon_host").closest("tr").show();

@ -4,7 +4,7 @@
<?php echo $method_title ?>
</h2>
<p style="margin: 0 0 16px;">Your order has been confirmed. Thank you for paying with Monero!</p>
<p style="margin: 0 0 16px;">Your order has been confirmed. Thank you for paying with Wownero!</p>
<?php elseif($details['status'] == 'expired' || $details['status'] == 'expired_partial'): ?>
@ -37,7 +37,7 @@
<td class="td" style="text-align: left; vertical-align: middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; word-wrap: break-word; color: #636363; border: 1px solid #e5e5e5; padding: 12px;">
TOTAL DUE: <br/>
<strong>
<?php echo $details['amount_total_formatted']; ?> XMR
<?php echo $details['amount_total_formatted']; ?> WOW
</strong>
</td>
</tr>
@ -45,7 +45,7 @@
<td class="td" style="text-align: left; vertical-align: middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; word-wrap: break-word; color: #636363; border: 1px solid #e5e5e5; padding: 12px;">
EXCHANGE RATE: <br/>
<strong>
1 XMR = <?php echo $details['rate_formatted'] . ' ' . $details['currency']; ?>
1 WOW = <?php echo $details['rate_formatted'] . ' ' . $details['currency']; ?>
</strong>
</td>
</tr>

@ -10,7 +10,7 @@
<span class="monero_payment_paid">We have received your payment in full. Please wait while amount is confirmed. Approximate confirm time is <span class="monero_confirm_time"></span>. <?php if(is_wc_endpoint_url('order-received')): ?><br/>You can <a href="<?php echo $details['my_order_url']; ?>">check your payment status</a> anytime in your account dashboard.<?php endif; ?></span>
<span class="monero_payment_confirmed">Your order has been confirmed. Thank you for paying with Monero!</span>
<span class="monero_payment_confirmed">Your order has been confirmed. Thank you for paying with Wownero!</span>
<span class="monero_payment_expired">Your order has expired. Please place another order to complete your purchase.</span>
@ -40,7 +40,7 @@
Total due:
<strong class="monero_details_row">
<span class="monero_details_main">
<span id="monero_total_due"></span> XMR
<span id="monero_total_due"></span> WOW
</span>
<span class="monero_details_right button-row">
<button href="#" class="button clipboard" title="Copy Amount"
@ -53,13 +53,13 @@
<li style="display:none">
Total order amount:
<strong>
<span id="monero_total_amount"></span> XMR
<span id="monero_total_amount"></span> WOW
</strong>
</li>
<li>
Total paid:
<strong>
<span id="monero_total_paid"></span> XMR
<span id="monero_total_paid"></span> WOW
</strong>
</li>
<li>

Loading…
Cancel
Save