From 1c164018e6db0225a3fa098a61fef055f9fe884a Mon Sep 17 00:00:00 2001 From: Joshua Lewis Date: Mon, 13 Jan 2020 15:33:00 -0500 Subject: [PATCH] Fixed WooCommerce notices --- index.php | 15 ++++++++------- readme.txt | 5 ++++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/index.php b/index.php index 8cc83e1f..c097ae85 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: Create Invoices and process through BitPay. Configure in your WooCommerce->Payments plugin. - * Version: 3.15.2001 + * Version: 3.16.2001 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ @@ -700,6 +700,7 @@ function bitpay_checkout_ipn(WP_REST_Request $request) $invoice = new BPC_Invoice($item); //this creates the invoice with all of the config params $orderStatus = json_decode($invoice->BPC_checkInvoiceStatus($invoiceID)); + #update the lookup table $note_set = null; @@ -805,15 +806,15 @@ function woo_custom_redirect_after_purchase() setcookie("bitpay-invoice-id", "", time() - 3600); endif; - if ($order->payment_method == 'bitpay_checkout_gateway' && $show_bitpay == true): + if ($order->get_payment_method() == 'bitpay_checkout_gateway' && $show_bitpay == true): $config = new BPC_Configuration($bitpay_checkout_token, $bitpay_checkout_options['bitpay_checkout_endpoint']); //sample values to create an item, should be passed as an object' $params = new stdClass(); $current_user = wp_get_current_user(); #$params->fullNotifications = 'true'; $params->extension_version = BPC_getBitPayVersionInfo(); - $params->price = $order->total; - $params->currency = $order->currency; //set as needed + $params->price = $order->get_total(); + $params->currency = $order->get_currency(); //set as needed if ($bitpay_checkout_options['bitpay_checkout_capture_email'] == 1): $current_user = wp_get_current_user(); @@ -832,7 +833,7 @@ function woo_custom_redirect_after_purchase() if (empty($checkout_slug)): $checkout_slug = 'checkout'; endif; - $params->redirectURL = get_home_url() . '/' . $checkout_slug . '/order-received/' . $order_id . '/?key=' . $order->order_key . '&redirect=false'; + $params->redirectURL = get_home_url() . '/' . $checkout_slug . '/order-received/' . $order_id . '/?key=' . $order->get_order_key() . '&redirect=false'; #create a hash for the ipn $hash_key = $config->BPC_generateHash($params->orderId); @@ -1008,7 +1009,7 @@ function bitpay_checkout_thankyou_page($order_id) endif; #use the modal - if ($order->payment_method == 'bitpay_checkout_gateway' && $use_modal == 1): + if ($order->get_payment_method() == 'bitpay_checkout_gateway' && $use_modal == 1): $invoiceID = $_COOKIE['bitpay-invoice-id']; ?> @@ -1065,7 +1066,7 @@ function bitpay_checkout_thankyou_page($order_id) function bitpay_checkout_custom_message($order_id) { $order = new WC_Order($order_id); - if ($order->payment_method == 'bitpay_checkout_gateway'): + if ($order->get_payment_method() == 'bitpay_checkout_gateway'): $bitpay_checkout_options = get_option('woocommerce_bitpay_checkout_gateway_settings'); $checkout_message = $bitpay_checkout_options['bitpay_checkout_checkout_message']; if ($checkout_message != ''): diff --git a/readme.txt b/readme.txt index ef49dfa3..60bcbac5 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: bitcoin, bitcoin cash, payments, bitpay, cryptocurrency, payment gateway Requires at least: 4.9 Tested up to: 5.3 Requires PHP: 5.5 -Stable tag: 3.15.2001 +Stable tag: 3.16.2001 License: MIT License (MIT) License URI: https://github.com/bitpay/bitpay-checkout-for-woocommerce/blob/master/LICENSE @@ -114,6 +114,9 @@ You can contact our support team via the following form https://bitpay.com/reque == Changelog == += 3.16.2001 = +* Fixed WooCommerce notices + = 3.15.2001 = * Removed unused code