/** * @param array $qs * * @return array */ public static function get_history($qs) { $orders = array(); foreach ($qs as $item => $values) { $order = new WC_Order($qs[$item]->ID); $orderDate = new DateTime($order->order_date); $orders[] = array('id' => (string) $order->id, 'amount' => Aplazame_Filters::decimals($order->get_total()), 'due' => '', 'status' => $order->get_status(), 'type' => Aplazame_Helpers::get_payment_method($order->id), 'order_date' => $orderDate->format(DATE_ISO8601), 'currency' => $order->get_order_currency(), 'billing' => self::get_address($order, 'billing'), 'shipping' => self::get_shipping_info($order)); } return $orders; }
/** * @param int $order_id * * @return bool */ protected static function is_aplazame_order($order_id) { return Aplazame_Helpers::get_payment_method($order_id) === self::METHOD_ID; }