This commit is contained in:
Lenny Ovo 2018-11-21 19:44:02 +00:00
parent ad6fe196a6
commit 76318e09e4
32 changed files with 825 additions and 797 deletions

View file

@ -1,54 +0,0 @@
<?php foreach($errors as $error): ?>
<div class="error"><p><strong>Monero Gateway Error</strong>: <?php echo $error; ?></p></div>
<?php endforeach; ?>
<h1>Monero Gateway Settings</h1>
<?php if($confirm_type === 'monero-wallet-rpc'): ?>
<div style="border:1px solid #ddd;padding:5px 10px;">
<?php
echo 'Wallet height: ' . $balance['height'] . '</br>';
echo 'Your balance is: ' . $balance['balance'] . '</br>';
echo 'Unlocked balance: ' . $balance['unlocked_balance'] . '</br>';
?>
</div>
<?php endif; ?>
<table class="form-table">
<?php echo $settings_html ?>
</table>
<h4><a href="https://github.com/monero-integrations/monerowp">Learn more about using the Monero payment gateway</a></h4>
<script>
function moneroUpdateFields() {
var confirmType = jQuery("#woocommerce_monero_gateway_confirm_type").val();
if(confirmType == "monero-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();
jQuery("#woocommerce_monero_gateway_daemon_port").closest("tr").show();
} else {
jQuery("#woocommerce_monero_gateway_monero_address").closest("tr").show();
jQuery("#woocommerce_monero_gateway_viewkey").closest("tr").show();
jQuery("#woocommerce_monero_gateway_daemon_host").closest("tr").hide();
jQuery("#woocommerce_monero_gateway_daemon_port").closest("tr").hide();
}
var useMoneroPrices = jQuery("#woocommerce_monero_gateway_use_monero_price").is(":checked");
if(useMoneroPrices) {
jQuery("#woocommerce_monero_gateway_use_monero_price_decimals").closest("tr").show();
} else {
jQuery("#woocommerce_monero_gateway_use_monero_price_decimals").closest("tr").hide();
}
}
moneroUpdateFields();
jQuery("#woocommerce_monero_gateway_confirm_type").change(moneroUpdateFields);
jQuery("#woocommerce_monero_gateway_use_monero_price").change(moneroUpdateFields);
</script>
<style>
#woocommerce_monero_gateway_monero_address,
#woocommerce_monero_gateway_viewkey {
width: 100%;
}
</style>

View file

@ -1,23 +1,23 @@
<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>
<td><?php echo Monero_Gateway::format_seconds_to_time($details['order_age']) ?> ago</td>
<td><?php echo Wownero_Gateway::format_seconds_to_time($details['order_age']) ?> ago</td>
</tr>
<tr>
<td>Order exipires</td>

View file

@ -0,0 +1,54 @@
<?php foreach($errors as $error): ?>
<div class="error"><p><strong>Wownero Gateway Error</strong>: <?php echo $error; ?></p></div>
<?php endforeach; ?>
<h1>Wownero Gateway Settings</h1>
<?php if($confirm_type === 'wownero-wallet-rpc'): ?>
<div style="border:1px solid #ddd;padding:5px 10px;">
<?php
echo 'Wallet height' . $balance['height'] . '</br>';
echo 'Your balance is: ' . $balance['balance'] . '</br>';
echo 'Unlocked balance: ' . $balance['unlocked_balance'] . '</br>';
?>
</div>
<?php endif; ?>
<table class="form-table">
<?php echo $settings_html ?>
</table>
<h4><a href="https://github.com/monero-integrations/monerowp">Learn more about using the Wownero payment gateway</a></h4>
<script>
function wowneroUpdateFields() {
var confirmType = jQuery("#woocommerce_wownero_gateway_confirm_type").val();
if(confirmType == "wownero-wallet-rpc") {
jQuery("#woocommerce_wownero_gateway_wownero_address").closest("tr").hide();
jQuery("#woocommerce_wownero_gateway_viewkey").closest("tr").hide();
jQuery("#woocommerce_wownero_gateway_daemon_host").closest("tr").show();
jQuery("#woocommerce_wownero_gateway_daemon_port").closest("tr").show();
} else {
jQuery("#woocommerce_wownero_gateway_wownero_address").closest("tr").show();
jQuery("#woocommerce_wownero_gateway_viewkey").closest("tr").show();
jQuery("#woocommerce_wownero_gateway_daemon_host").closest("tr").hide();
jQuery("#woocommerce_wownero_gateway_daemon_port").closest("tr").hide();
}
var useWowneroPrices = jQuery("#woocommerce_wownero_gateway_use_wownero_price").is(":checked");
if(useWowneroPrices) {
jQuery("#woocommerce_wownero_gateway_use_wownero_price_decimals").closest("tr").show();
} else {
jQuery("#woocommerce_wownero_gateway_use_wownero_price_decimals").closest("tr").hide();
}
}
wowneroUpdateFields();
jQuery("#woocommerce_wownero_gateway_confirm_type").change(wowneroUpdateFields);
jQuery("#woocommerce_wownero_gateway_use_wownero_price").change(wowneroUpdateFields);
</script>
<style>
#woocommerce_wownero_gateway_wownero_address,
#woocommerce_wownero_gateway_viewkey {
width: 100%;
}
</style>

View file

@ -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>
@ -53,4 +53,4 @@
</table>
</div>
<?php endif; ?>
<?php endif; ?>

View file

@ -2,35 +2,35 @@
<h2 class="woocommerce-order-details__title"><?php echo $method_title ?></h2>
<noscript><h1>You must enable javascript in order to confirm your order</h1></noscript>
<strong id="monero_payment_messages">
<strong id="wownero_payment_messages">
<span class="monero_payment_unpaid">Please pay the amount due to complete your transactions. Your order will expire in <span class="monero_payment_expire_time"></span> if payment is not received.</span>
<span class="wownero_payment_unpaid">Please pay the amount due to complete your transactions. Your order will expire in <span class="wownero_payment_expire_time"></span> if payment is not received.</span>
<span class="monero_payment_partial">We have received partial payment. Please pay the remaining amount to complete your transactions. Your order will expire in <span class="monero_payment_expire_time"></span> if payment is not received.</span>
<span class="wownero_payment_partial">We have received partial payment. Please pay the remaining amount to complete your transactions. Your order will expire in <span class="wownero_payment_expire_time"></span> if payment is not received.</span>
<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="wownero_payment_paid">We have received your payment in full. Please wait while amount is confirmed. Approximate confirm time is <span class="wownero_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="wownero_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>
<span class="wownero_payment_expired">Your order has expired. Please place another order to complete your purchase.</span>
<span class="monero_payment_expired_partial">Your order has expired. Please contact the store owner to receive refund on your partial payment.</span>
<span class="wownero_payment_expired_partial">Your order has expired. Please contact the store owner to receive refund on your partial payment.</span>
</strong>
<ul class="order_details" style="margin-top:30px">
<li>
Pay to:
<strong class="monero_details_row">
<span class="monero_details_main" id="monero_integrated_address"></span>
<span class="monero_details_right button-row">
<strong class="wownero_details_row">
<span class="wownero_details_main" id="wownero_integrated_address"></span>
<span class="wownero_details_right button-row">
<?php if($show_qr): ?>
<button href="#" class="button" title="Show QR Code" onclick="monero_showQR()">
<button href="#" class="button" title="Show QR Code" onclick="wownero_showQR()">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 512 512" version="1"><path d="M0 512h233V279H0zm47-186h139v139H47z"/><path d="M93 372h47v47H93zm279 93h47v47h-47zm93 0h47v47h-47z"/><path d="M465 326h-46v-47H279v233h47V372h46v47h140V279h-47zM0 233h233V0H0zM47 47h139v139H47z"/><path d="M93 93h47v47H93zM279 0v233h233V0zm186 186H326V47h139z"/><path d="M372 93h47v47h-47z"/></svg>
</button>
<?php endif; ?>
<button href="#" class="button clipboard" title="Copy Address"
data-clipboard-target="#monero_integrated_address">
data-clipboard-target="#wownero_integrated_address">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 512 512" version="1"><path d="M504 118c-6-6-12-8-20-8H365c-11 0-23 3-36 11V27c0-7-3-14-8-19s-12-8-20-8H183c-8 0-16 2-25 6-10 4-17 8-22 13L19 136c-5 5-9 12-13 22-4 9-6 17-6 25v192c0 7 3 14 8 19s12 8 19 8h156v82c0 8 2 14 8 20 5 5 12 8 19 8h274c8 0 14-3 20-8 5-6 8-12 8-20V137c0-8-3-14-8-19zm-175 52v86h-85l85-86zM146 61v85H61l85-85zm56 185c-5 5-10 12-14 21-3 9-5 18-5 25v73H37V183h118c8 0 14-3 20-8 5-6 8-12 8-20V37h109v118l-90 91zm273 229H219V292h119c8 0 14-2 19-8 6-5 8-11 8-19V146h110v329z"/></svg>
</button>
</span>
@ -38,13 +38,13 @@
</li>
<li>
Total due:
<strong class="monero_details_row">
<span class="monero_details_main">
<span id="monero_total_due"></span> XMR
<strong class="wownero_details_row">
<span class="wownero_details_main">
<span id="wownero_total_due"></span> WOW
</span>
<span class="monero_details_right button-row">
<span class="wownero_details_right button-row">
<button href="#" class="button clipboard" title="Copy Amount"
data-clipboard-target="#monero_total_due">
data-clipboard-target="#wownero_total_due">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 512 512" version="1"><path d="M504 118c-6-6-12-8-20-8H365c-11 0-23 3-36 11V27c0-7-3-14-8-19s-12-8-20-8H183c-8 0-16 2-25 6-10 4-17 8-22 13L19 136c-5 5-9 12-13 22-4 9-6 17-6 25v192c0 7 3 14 8 19s12 8 19 8h156v82c0 8 2 14 8 20 5 5 12 8 19 8h274c8 0 14-3 20-8 5-6 8-12 8-20V137c0-8-3-14-8-19zm-175 52v86h-85l85-86zM146 61v85H61l85-85zm56 185c-5 5-10 12-14 21-3 9-5 18-5 25v73H37V183h118c8 0 14-3 20-8 5-6 8-12 8-20V37h109v118l-90 91zm273 229H219V292h119c8 0 14-2 19-8 6-5 8-11 8-19V146h110v329z"/></svg>
</button>
</span>
@ -53,23 +53,23 @@
<li style="display:none">
Total order amount:
<strong>
<span id="monero_total_amount"></span> XMR
<span id="wownero_total_amount"></span> WOW
</strong>
</li>
<li>
Total paid:
<strong>
<span id="monero_total_paid"></span> XMR
<span id="wownero_total_paid"></span> WOW
</strong>
</li>
<li>
Exchange rate:<strong id="monero_exchange_rate"></strong>
Exchange rate:<strong id="wownero_exchange_rate"></strong>
</li>
</ul>
<table id="monero_tx_table" style="display:none;">
<table id="wownero_tx_table" style="display:none;">
<thead>
<tr>
<th>Transaction id</th>
@ -80,21 +80,21 @@
<tbody>
</tbody>
</table>
<div id="monero_tx_none" style="display:none;">
<div id="wownero_tx_none" style="display:none;">
</div>
<div id="monero_qr_code_container" style="display:none;" onclick="monero_showQR(false)">
<div id="monero_qr_code">
<div id="wownero_qr_code_container" style="display:none;" onclick="wownero_showQR(false)">
<div id="wownero_qr_code">
</div>
</div>
</section>
<div id="monero_toast"></div>
<div id="wownero_toast"></div>
<script type="text/javascript">
var monero_show_qr = <?php echo $show_qr ? 'true' : 'false'; ?>;
var monero_ajax_url = '<?php echo $ajax_url; ?>';
var monero_explorer_url = '<?php echo MONERO_GATEWAY_EXPLORER_URL; ?>';
var monero_details = <?php echo $details_json; ?>;
var wownero_show_qr = <?php echo $show_qr ? 'true' : 'false'; ?>;
var wownero_ajax_url = '<?php echo $ajax_url; ?>';
var wownero_explorer_url = '<?php echo MONERO_GATEWAY_EXPLORER_URL; ?>';
var wownero_details = <?php echo $details_json; ?>;
</script>