From ae728acc63150cc8c952b68dfc14b51e4801da38 Mon Sep 17 00:00:00 2001 From: mgiulio Date: Wed, 24 Sep 2014 17:30:14 +0200 Subject: [PATCH] Use wc_get_order in simplify-commerce --- .../class-wc-addons-gateway-simplify-commerce.php | 4 ++-- .../simplify-commerce/class-wc-gateway-simplify-commerce.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/gateways/simplify-commerce/class-wc-addons-gateway-simplify-commerce.php b/includes/gateways/simplify-commerce/class-wc-addons-gateway-simplify-commerce.php index c80a9cd93b2..ed9cb2acf15 100644 --- a/includes/gateways/simplify-commerce/class-wc-addons-gateway-simplify-commerce.php +++ b/includes/gateways/simplify-commerce/class-wc-addons-gateway-simplify-commerce.php @@ -40,7 +40,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce { * @return array */ public function process_subscription( $order_id ) { - $order = new WC_Order( $order_id ); + $order = wc_get_order( $order_id ); $token = isset( $_POST['simplify_token'] ) ? wc_clean( $_POST['simplify_token'] ) : ''; try { @@ -118,7 +118,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce { */ public function process_pre_order( $order_id ) { if ( WC_Pre_Orders_Order::order_requires_payment_tokenization( $order_id ) ) { - $order = new WC_Order( $order_id ); + $order = wc_get_order( $order_id ); $token = isset( $_POST['simplify_token'] ) ? wc_clean( $_POST['simplify_token'] ) : ''; try { diff --git a/includes/gateways/simplify-commerce/class-wc-gateway-simplify-commerce.php b/includes/gateways/simplify-commerce/class-wc-gateway-simplify-commerce.php index cce2376024e..0c184548688 100644 --- a/includes/gateways/simplify-commerce/class-wc-gateway-simplify-commerce.php +++ b/includes/gateways/simplify-commerce/class-wc-gateway-simplify-commerce.php @@ -269,7 +269,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway { * @param integer $order_id */ public function process_payment( $order_id ) { - $order = new WC_Order( $order_id ); + $order = wc_get_order( $order_id ); $token = isset( $_POST['simplify_token'] ) ? wc_clean( $_POST['simplify_token'] ) : ''; try {