diff --git a/WC_Dogecash.php b/WC_Dogecash.php index 7b14b9d..186a9c4 100644 --- a/WC_Dogecash.php +++ b/WC_Dogecash.php @@ -117,7 +117,7 @@ public function payment_fields(){
- plugin logo + plugin logo
Exchange rate:
@@ -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']; } diff --git a/readme.txt b/readme.txt index f2cba80..fa1580a 100644 --- a/readme.txt +++ b/readme.txt @@ -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 diff --git a/woocommerce-dogecash.php b/woocommerce-dogecash.php index 999bb9f..801a522 100644 --- a/woocommerce-dogecash.php +++ b/woocommerce-dogecash.php @@ -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__)); } } @@ -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); @@ -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); diff --git a/woocommerce/checkout/form-pay.php b/woocommerce/checkout/form-pay.php index 23a352c..fd1157b 100644 --- a/woocommerce/checkout/form-pay.php +++ b/woocommerce/checkout/form-pay.php @@ -47,7 +47,7 @@
  • - get_order_number(); ?> + get_order_number()); ?>
  • @@ -57,7 +57,7 @@
  • - order_in_crypto . " " . $wc_dogec->cryptocurrency_used . " (" . $cp_order->order_total . " " . $cp_order->order_default_currency . ")" ?> + order_in_crypto . " " . $wc_dogec->cryptocurrency_used . " (" . $cp_order->order_total . " " . $cp_order->order_default_currency . ")") ?>
@@ -70,16 +70,16 @@
Amount:
- - + +

Payment Address:
- - + +

@@ -88,13 +88,13 @@
00:00
Waiting for payment...
-
Exchange rate locked 1 cryptocurrency_used; ?> = order_crypto_exchange_rate, 5) . ' ' . $cp_order->order_default_currency; ?>
+
Exchange rate locked 1 cryptocurrency_used) ?> = order_crypto_exchange_rate, 5) . ' ' . $cp_order->order_default_currency) ?>
- +