Skip to content

Commit

Permalink
Merge pull request #4 from dogecash/Nugetzrul3-patch-1
Browse files Browse the repository at this point in the history
[Core] Update files for Wordpress submission
  • Loading branch information
weoka committed Aug 8, 2021
2 parents 31f74d8 + 7ed93d5 commit 18fdf53
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
5 changes: 3 additions & 2 deletions WC_Dogecash.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function payment_fields(){
<table>
<tr style="vertical-align: middle; text-align: left;">
<td width="180">
<img alt="plugin logo" width="160" style="max-height: 40px;" src="<?php echo plugins_url('/woocommerce-dogecash/img/plugin-logo.png') ?>">
<img alt="plugin logo" width="160" style="max-height: 40px;" src="<?php echo plugins_url('img/plugin-logo.png', __FILE__) ?>">
</td>
<td>
<div>Exchange rate:</div>
Expand All @@ -139,7 +139,8 @@ public function dogec_exchange_rate($default_currency) {
}

if ( is_checkout() ) {
$rate = file_get_contents(DOGEC_API_URL ."?rate=" . $default_currency);
$rate = wp_remote_get(DOGEC_API_URL ."?rate=" . $default_currency);
$rate = wp_remote_retrieve_body($rate);
$rate = json_decode($rate, true);
return $rate['result'];
}
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
=== DogeCash Gateway for WooCommerce ===
Tags: woocommerce, dogecash, cryptocurrency, gateway
Tested up to: 5.8
Stable tag: 4.3
Stable tag: 1.0.4
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down
9 changes: 5 additions & 4 deletions woocommerce-dogecash.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ function dogec_admin_notice()
function dogec_load_cp_scripts()
{
if (is_wc_endpoint_url('order-pay')) {
wp_enqueue_style('cp-styles', plugins_url('/woocommerce-dogecash/css/cp-styles.css'));
wp_enqueue_script('cp-script', plugins_url('/woocommerce-dogecash/js/cp-script.js'));
wp_enqueue_style('cp-styles', plugins_url('css/cp-styles.css', __FILE__));
wp_enqueue_script('cp-script', plugins_url('js/cp-script.js', __FILE__));
}
}

Expand Down Expand Up @@ -158,7 +158,7 @@ function dogec_verify_payment()

$wc_dogec = new WC_Dogecash;

$order_id = $_POST['order_id'];
$order_id = intval(sanitize_text_field($_POST['order_id']));
$order = new WC_Order($order_id);


Expand All @@ -174,7 +174,8 @@ function dogec_verify_payment()
if (empty($transaction_id)) {
$transaction_id = "missing";
}
$response = file_get_contents(DOGEC_API_URL . "?address=" . $payment_address . "&tx=" . $transaction_id . "&amount=" . $order_in_crypto . "&conf=" . $confirmation_no . "&otime=" . $order_time . "&mtime=" . $max_time_limit . "&pv=" . $plugin_version);
$response = wp_remote_get(DOGEC_API_URL . "?address=" . $payment_address . "&tx=" . $transaction_id . "&amount=" . $order_in_crypto . "&conf=" . $confirmation_no . "&otime=" . $order_time . "&mtime=" . $max_time_limit . "&pv=" . $plugin_version);
$response = wp_remote_retrieve_body($response);
$response = json_decode($response);


Expand Down
16 changes: 8 additions & 8 deletions woocommerce/checkout/form-pay.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<ul class="cp-order-info-list">
<li class="cp-order-info-list-item">
<?php _e( 'Order number:', 'woocommerce' ); ?>
<strong><?php echo $order->get_order_number(); ?></strong>
<strong><?php echo esc_html($order->get_order_number()); ?></strong>
</li>

<li class="cp-order-info-list-item">
Expand All @@ -57,7 +57,7 @@

<li class="cp-order-info-list-item">
<?php _e( 'Total:', 'woocommerce' ); ?>
<strong><?php echo $cp_order->order_in_crypto . " " . $wc_dogec->cryptocurrency_used . " (" . $cp_order->order_total . " " . $cp_order->order_default_currency . ")" ?></strong>
<strong><?php echo esc_html($cp_order->order_in_crypto . " " . $wc_dogec->cryptocurrency_used . " (" . $cp_order->order_total . " " . $cp_order->order_default_currency . ")") ?></strong>
</li>
</ul>
</div>
Expand All @@ -70,16 +70,16 @@

<div>Amount:</div>
<div class="cp-input-box">
<input type="text" class="cp-payment-input" value="<?php echo $cp_order->order_in_crypto ?>" readonly>
<button type="button" class="cp-copy-btn"><img src="<?php echo plugins_url('/woocommerce-dogecash/img/cp-copy-icon.svg') ?>" /></button>
<input type="text" class="cp-payment-input" value="<?php echo esc_attr($cp_order->order_in_crypto) ?>" readonly>
<button type="button" class="cp-copy-btn"><img src="<?php echo plugins_url('/img/cp-copy-icon.svg', __FILE__) ?>" /></button>
</div>

<br />

<div>Payment Address:</div>
<div class="cp-input-box">
<input type="text" class="cp-payment-input" value="<?php echo $cp_order->payment_address ?>" readonly>
<button type="button" class="cp-copy-btn"><img src="<?php echo plugins_url('/woocommerce-dogecash/img/cp-copy-icon.svg') ?>" /></button>
<input type="text" class="cp-payment-input" value="<?php echo esc_attr($cp_order->payment_address) ?>" readonly>
<button type="button" class="cp-copy-btn"><img src="<?php echo plugins_url('img/cp-copy-icon.svg', __FILE__) ?>" /></button>
</div>

<br />
Expand All @@ -88,13 +88,13 @@
<div class="cp-counter">00:00</div>
<div class="cp-payment-info">
<div class="cp-payment-info-status">Waiting for payment...</div>
<div class="cp-payment-info-text">Exchange rate locked 1 <?php echo $wc_dogec->cryptocurrency_used; ?> = <?php echo round($cp_order->order_crypto_exchange_rate, 5) . ' ' . $cp_order->order_default_currency; ?></div>
<div class="cp-payment-info-text">Exchange rate locked 1 <?php echo esc_html($wc_dogec->cryptocurrency_used) ?> = <?php echo esc_html(round($cp_order->order_crypto_exchange_rate, 5) . ' ' . $cp_order->order_default_currency) ?></div>
</div>
</div>
</div>
<div class="cp-box-col-2">
<div class="cp-qr-code-holder">
<img src="https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=<?php echo $cp_order->payment_address ?>&choe=UTF-8" />
<img src="https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=<?php echo esc_attr($cp_order->payment_address) ?>&choe=UTF-8" />
</div>
</div>
</div>
Expand Down

0 comments on commit 18fdf53

Please sign in to comment.