From 5076f528bfa1899050236db08848ddc7beed8db0 Mon Sep 17 00:00:00 2001 From: Mayur Kathale Date: Mon, 14 Sep 2020 08:31:40 +0700 Subject: [PATCH] updating deprecated function since woocommerce v3 --- includes/class-omise-callback.php | 4 ++-- includes/gateway/abstract-omise-payment-offline.php | 2 +- includes/gateway/class-omise-payment-alipay.php | 4 ++-- includes/gateway/class-omise-payment-creditcard.php | 10 +++++----- includes/gateway/class-omise-payment-installment.php | 4 ++-- .../gateway/class-omise-payment-internetbanking.php | 4 ++-- includes/gateway/class-omise-payment-truemoney.php | 2 +- includes/gateway/class-omise-payment.php | 6 +++--- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/includes/class-omise-callback.php b/includes/class-omise-callback.php index 2bc88ef9..991620ba 100644 --- a/includes/class-omise-callback.php +++ b/includes/class-omise-callback.php @@ -88,7 +88,7 @@ protected function payment_successful() { sprintf( wp_kses( $message, array( 'br' => array() ) ), $this->order->get_total(), - $this->order->get_order_currency() + $this->order->get_currency() ) ); @@ -116,7 +116,7 @@ protected function payment_pending() { sprintf( wp_kses( $message, array( 'br' => array() ) ), $this->order->get_total(), - $this->order->get_order_currency() + $this->order->get_currency() ) ); $this->order->payment_complete(); diff --git a/includes/gateway/abstract-omise-payment-offline.php b/includes/gateway/abstract-omise-payment-offline.php index 19cba2fd..ab1aa2b8 100644 --- a/includes/gateway/abstract-omise-payment-offline.php +++ b/includes/gateway/abstract-omise-payment-offline.php @@ -21,7 +21,7 @@ abstract class Omise_Payment_Offline extends Omise_Payment { */ public function charge( $order_id, $order ) { $total = $order->get_total(); - $currency = $order->get_order_currency(); + $currency = $order->get_currency(); $metadata = array_merge( apply_filters( 'omise_charge_params_metadata', array(), $order ), array( 'order_id' => $order_id ) // override order_id as a reference for webhook handlers. diff --git a/includes/gateway/class-omise-payment-alipay.php b/includes/gateway/class-omise-payment-alipay.php index 0574b0f8..078a1a6e 100644 --- a/includes/gateway/class-omise-payment-alipay.php +++ b/includes/gateway/class-omise-payment-alipay.php @@ -68,8 +68,8 @@ public function charge( $order_id, $order ) { ); return OmiseCharge::create( array( - 'amount' => Omise_Money::to_subunit( $order->get_total(), $order->get_order_currency() ), - 'currency' => $order->get_order_currency(), + 'amount' => Omise_Money::to_subunit( $order->get_total(), $order->get_currency() ), + 'currency' => $order->get_currency(), 'description' => apply_filters( 'omise_charge_params_description', 'WooCommerce Order id ' . $order_id, $order ), 'source' => array( 'type' => 'alipay' ), 'return_uri' => $return_uri, diff --git a/includes/gateway/class-omise-payment-creditcard.php b/includes/gateway/class-omise-payment-creditcard.php index 5ae3de49..f4ad6b8e 100644 --- a/includes/gateway/class-omise-payment-creditcard.php +++ b/includes/gateway/class-omise-payment-creditcard.php @@ -232,8 +232,8 @@ public function charge( $order_id, $order ) { home_url() ); $data = array( - 'amount' => Omise_Money::to_subunit( $order->get_total(), $order->get_order_currency() ), - 'currency' => $order->get_order_currency(), + 'amount' => Omise_Money::to_subunit( $order->get_total(), $order->get_currency() ), + 'currency' => $order->get_currency(), 'description' => apply_filters( 'omise_charge_params_description', 'WooCommerce Order id ' . $order_id, $order ), 'return_uri' => $return_uri ); @@ -296,7 +296,7 @@ public function result( $order_id, $order, $charge ) { array( 'br' => array() ) ), $order->get_total(), - $order->get_order_currency() + $order->get_currency() ) ); $order->payment_complete(); @@ -314,7 +314,7 @@ public function result( $order_id, $order, $charge ) { array( 'br' => array() ) ), $order->get_total(), - $order->get_order_currency() + $order->get_currency() ) ); $order->payment_complete(); @@ -373,7 +373,7 @@ public function process_capture( $order ) { array( 'br' => array() ) ), $this->order()->get_total(), - $this->order()->get_order_currency() + $this->order()->get_currency() ) ); $this->order()->payment_complete(); diff --git a/includes/gateway/class-omise-payment-installment.php b/includes/gateway/class-omise-payment-installment.php index 8775d0e3..07836eb5 100644 --- a/includes/gateway/class-omise-payment-installment.php +++ b/includes/gateway/class-omise-payment-installment.php @@ -94,8 +94,8 @@ public function charge( $order_id, $order ) { ); return OmiseCharge::create( array( - 'amount' => Omise_Money::to_subunit( $order->get_total(), $order->get_order_currency() ), - 'currency' => $order->get_order_currency(), + 'amount' => Omise_Money::to_subunit( $order->get_total(), $order->get_currency() ), + 'currency' => $order->get_currency(), 'description' => apply_filters( 'omise_charge_params_description', 'WooCommerce Order id ' . $order_id, $order ), 'source' => array( 'type' => sanitize_text_field( $source_type ), diff --git a/includes/gateway/class-omise-payment-internetbanking.php b/includes/gateway/class-omise-payment-internetbanking.php index d569a63f..65e12b82 100644 --- a/includes/gateway/class-omise-payment-internetbanking.php +++ b/includes/gateway/class-omise-payment-internetbanking.php @@ -82,8 +82,8 @@ public function charge( $order_id, $order ) { ); return OmiseCharge::create( array( - 'amount' => Omise_Money::to_subunit( $order->get_total(), $order->get_order_currency() ), - 'currency' => $order->get_order_currency(), + 'amount' => Omise_Money::to_subunit( $order->get_total(), $order->get_currency() ), + 'currency' => $order->get_currency(), 'description' => apply_filters('omise_charge_params_description', 'WooCommerce Order id ' . $order_id, $order), 'source' => array( 'type' => sanitize_text_field( $_POST['omise-offsite'] ) ), 'return_uri' => $return_uri, diff --git a/includes/gateway/class-omise-payment-truemoney.php b/includes/gateway/class-omise-payment-truemoney.php index b8df9a45..5f356fb6 100644 --- a/includes/gateway/class-omise-payment-truemoney.php +++ b/includes/gateway/class-omise-payment-truemoney.php @@ -71,7 +71,7 @@ public function payment_fields() { public function charge( $order_id, $order ) { $phone_number = isset( $_POST['omise_phone_number_default'] ) && 1 == $_POST['omise_phone_number_default'] ? $order->get_billing_phone() : sanitize_text_field( $_POST['omise_phone_number'] ); $total = $order->get_total(); - $currency = $order->get_order_currency(); + $currency = $order->get_currency(); $return_uri = add_query_arg( array( 'wc-api' => 'omise_truemoney_callback', 'order_id' => $order_id ), home_url() ); diff --git a/includes/gateway/class-omise-payment.php b/includes/gateway/class-omise-payment.php index 2aaa26ac..b0516b69 100644 --- a/includes/gateway/class-omise-payment.php +++ b/includes/gateway/class-omise-payment.php @@ -253,7 +253,7 @@ public function process_refund( $order_id, $amount = null, $reason = '' ) { try { $charge = OmiseCharge::retrieve( $order->get_transaction_id() ); $refund = $charge->refunds()->create( array( - 'amount' => Omise_Money::to_subunit( $amount, $order->get_order_currency() ), + 'amount' => Omise_Money::to_subunit( $amount, $order->get_currency() ), 'metadata' => array( 'reason' => sanitize_text_field( $reason ) ) ) ); @@ -264,7 +264,7 @@ public function process_refund( $order_id, $amount = null, $reason = '' ) { array( 'br' => array() ) ), $amount, - $order->get_order_currency(), + $order->get_currency(), $refund['id'] ); } else { @@ -274,7 +274,7 @@ public function process_refund( $order_id, $amount = null, $reason = '' ) { array( 'br' => array() ) ), $amount, - $order->get_order_currency(), + $order->get_currency(), $refund['id'] ); }