From a720cc8ad493b21c1dec584c82742d507121cca0 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 20 Mar 2014 11:44:54 +0000 Subject: [PATCH] WC()->api_request_url for PayPal and Mijireh Closes #5183 --- includes/gateways/mijireh/class-wc-gateway-mijireh.php | 2 +- includes/gateways/paypal/class-wc-gateway-paypal.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/gateways/mijireh/class-wc-gateway-mijireh.php b/includes/gateways/mijireh/class-wc-gateway-mijireh.php index b01cef4f326..8ae58b54b14 100644 --- a/includes/gateways/mijireh/class-wc-gateway-mijireh.php +++ b/includes/gateways/mijireh/class-wc-gateway-mijireh.php @@ -275,7 +275,7 @@ class WC_Gateway_Mijireh extends WC_Payment_Gateway { $mj_order->add_meta_data( 'wc_order_id', $order_id ); // Set URL for mijireh payment notificatoin - use WC API - $mj_order->return_url = str_replace( 'https:', 'http:', add_query_arg( 'wc-api', 'WC_Gateway_Mijireh', home_url( '/' ) ) ); + $mj_order->return_url = WC()->api_request_url( 'WC_Gateway_Mijireh' ); // Identify woocommerce $mj_order->partner_id = 'woo'; diff --git a/includes/gateways/paypal/class-wc-gateway-paypal.php b/includes/gateways/paypal/class-wc-gateway-paypal.php index aac7c33ea2e..dbe1208397d 100644 --- a/includes/gateways/paypal/class-wc-gateway-paypal.php +++ b/includes/gateways/paypal/class-wc-gateway-paypal.php @@ -32,7 +32,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway { $this->liveurl = 'https://www.paypal.com/cgi-bin/webscr'; $this->testurl = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; $this->method_title = __( 'PayPal', 'woocommerce' ); - $this->notify_url = str_replace( 'https:', 'http:', add_query_arg( 'wc-api', 'WC_Gateway_Paypal', home_url( '/' ) ) ); + $this->notify_url = WC()->api_request_url( 'WC_Gateway_Paypal' ); // Load the settings. $this->init_form_fields();