HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux vm8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: afleverb (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //var/www/drakkar_site/wp-content/plugins/woocommerce-mercadopago/src/Order/OrderShipping.php
<?php

namespace MercadoPago\Woocommerce\Order;

use WC_Order;

if (!defined('ABSPATH')) {
    exit;
}

class OrderShipping
{
    /**
     * @param WC_Order $order
     *
     * @return string
     */
    public function getFirstName(WC_Order $order): string
    {
        return $order->get_shipping_first_name() ?? '';
    }

    /**
     * @param WC_Order $order
     *
     * @return string
     */
    public function getLastName(WC_Order $order): string
    {
        return $order->get_shipping_last_name() ?? '';
    }

    /**
     * @param WC_Order $order
     *
     * @return string
     */
    public function getPhone(WC_Order $order): string
    {
        return $order->get_shipping_phone() ?? '';
    }

    /**
     * @param WC_Order $order
     *
     * @return string
     */
    public function getZipcode(WC_Order $order): string
    {
        return $order->get_shipping_postcode() ?? '';
    }

    /**
     * @param WC_Order $order
     *
     * @return string
     */
    public function getAddress1(WC_Order $order): string
    {
        return $order->get_shipping_address_1() ?? '';
    }

    /**
     * @param WC_Order $order
     *
     * @return string
     */
    public function getAddress2(WC_Order $order): string
    {
        return $order->get_shipping_address_2() ?? '';
    }

    /**
     * @param WC_Order $order
     *
     * @return string
     */
    public function getCity(WC_Order $order): string
    {
        return $order->get_shipping_city() ?? '';
    }

    /**
     * @param WC_Order $order
     *
     * @return string
     */
    public function getState(WC_Order $order): string
    {
        return $order->get_shipping_state() ?? '';
    }

    /**
     * @param WC_Order $order
     *
     * @return string
     */
    public function getCountry(WC_Order $order): string
    {
        return $order->get_shipping_country() ?? '';
    }

    /**
     * @param WC_Order $order
     *
     * @return string
     */
    public function getFullAddress(WC_Order $order): string
    {
        return "{$this->getAddress1($order)} / {$this->getAddress2($order)} - {$this->getCity($order)} - {$this->getState($order)} - {$this->getCountry($order)}";
    }

    /**
     * @param WC_Order $order
     *
     * @return string
     */
    public function getShippingMethod(WC_Order $order): string
    {
        return $order->get_shipping_method();
    }

    /**
     * @param WC_Order $order
     *
     * @return float
     */
    public function getTotal(WC_Order $order): float
    {
        return (float) $order->get_shipping_total();
    }
}