From b16c127042152df30c2dc45f3b874d84743e62bf Mon Sep 17 00:00:00 2001 From: Andre Starosta Date: Mon, 22 Apr 2019 15:35:01 -0300 Subject: [PATCH] Remove deprecated GetCountry usage --- gateways/class-wc-ebanx-new-gateway.php | 6 +++--- services/class-wc-ebanx-payment-adapter.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gateways/class-wc-ebanx-new-gateway.php b/gateways/class-wc-ebanx-new-gateway.php index bd3c5eeb..bd666732 100644 --- a/gateways/class-wc-ebanx-new-gateway.php +++ b/gateways/class-wc-ebanx-new-gateway.php @@ -265,12 +265,12 @@ public function get_transaction_address( $attr = '' ) { ! isset( WC()->customer ) || is_admin() || empty( WC_EBANX_Request::read( 'billing_country', null ) ) - && empty( WC()->customer->get_country() ) + && empty( WC()->customer->get_billing_country() ) ) { return false; } - $address['country'] = trim( strtolower( WC()->customer->get_country() ) ); + $address['country'] = trim( strtolower( WC()->customer->get_billing_country() ) ); if ( ! empty( WC_EBANX_Request::read( 'billing_country', null ) ) ) { $address['country'] = trim( strtolower( WC_EBANX_Request::read( 'billing_country' ) ) ); } @@ -561,7 +561,7 @@ public function checkout_rate_conversion( $currency, $template = true, $country } if ( null === $country ) { - $country = trim( strtolower( WC()->customer->get_country() ) ); + $country = trim( strtolower( WC()->customer->get_billing_country() ) ); } $exchange = $this->ebanx->exchange(); diff --git a/services/class-wc-ebanx-payment-adapter.php b/services/class-wc-ebanx-payment-adapter.php index 2fd39d7f..499d5f67 100644 --- a/services/class-wc-ebanx-payment-adapter.php +++ b/services/class-wc-ebanx-payment-adapter.php @@ -49,7 +49,7 @@ public static function transform( $order, $configs, $names, $gateway_id ) { */ public static function transform_card( $order, $configs, $names, $gateway_id ) { $payment = self::transform( $order, $configs, $names, $gateway_id ); - $country = trim( strtolower( WC()->customer->get_country() ) ); + $country = trim( strtolower( WC()->customer->get_billing_country() ) ); if ( in_array( $country, WC_EBANX_Constants::$credit_card_countries ) ) { $payment->instalments = '1'; @@ -179,7 +179,7 @@ private static function transform_person( $order, $configs, $names, $gateway_id * @throws Exception Throws parameter missing exception. */ private static function get_document( $configs, $names, $gateway_id ) { - $country = trim( strtolower( WC()->customer->get_country() ) ); + $country = trim( strtolower( WC()->customer->get_billing_country() ) ); switch ( $country ) { case WC_EBANX_Constants::COUNTRY_ARGENTINA: