Пример #1
0
 public function checkout()
 {
     global $wp_query;
     $post_id = $wp_query->get_queried_object_id();
     if (!isset($_GET['order_id']) || (string) WC()->session->redirect_order_id !== $_GET['order_id'] || !$this->isRedirect($post_id)) {
         return;
     }
     Aplazame_Helpers::render_to_template('gateway/redirect.php');
 }
Пример #2
0
 /**
  * @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;
 }
Пример #3
0
 /**
  * @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;
 }
Пример #4
0
 public function payment_fields()
 {
     Aplazame_Helpers::render_to_template('gateway/payment-fields.php');
 }