Plugin Directory

Changeset 2141697


Ignore:
Timestamp:
08/19/2019 07:15:44 AM (6 years ago)
Author:
foloosi
Message:

Version 1.0.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • foloosi-for-woocommerce/trunk/foloosi-payments.php

    r2114644 r2141697  
    291291            $this->redirectUser($order);
    292292        }
     293        public function getCustomerInfo($order)
     294        {
     295            if (version_compare(WOOCOMMERCE_VERSION, '2.7.0', '>=')) {
     296                $args = array(
     297                    'name'    => $order->get_billing_first_name() . ' ' . $order->get_billing_last_name(),
     298                    'email'   => $order->get_billing_email(),
     299                    'contact' => $order->get_billing_phone(),
     300                );
     301            } else {
     302                $args = array(
     303                    'name'    => $order->billing_first_name . ' ' . $order->billing_last_name,
     304                    'email'   => $order->billing_email,
     305                    'contact' => $order->billing_phone,
     306                );
     307            }
     308
     309            return $args;
     310        }
    293311
    294312        protected function handleErrorCase(&$order)
     
    435453     * Array with parameters for API interaction
    436454     */
     455            $customer_info = $this->getCustomerInfo($order);
     456
    437457            $args = array(
    438458                'headers' => array(
     
    443463                    'transaction_amount' => $order->get_total(),
    444464                    'currency' => $this->getOrderCurrency($order),
    445                     'optional1' => $order_id
     465                    'optional1' => $order_id,
     466                    'customer_name'=>$customer_info['name'],
     467                    'customer_email'=>$customer_info['email'],
     468                    'customer_mobile'=>$customer_info['contact'],
     469                    'source'=>'woocommerce'
    446470                )
    447471
Note: See TracChangeset for help on using the changeset viewer.