Payu\Serializer\PaymentRequestSerializer::serializeOrder PHP Method

serializeOrder() private method

private serializeOrder ( ) : array
return array
    private function serializeOrder()
    {
        /** @var $order \Payu\Component\Order */
        $order = $this->request->getOrder();
        $data = array('ORDER_REF' => $order->getCode(), 'ORDER_DATE' => $order->getDate(), 'PAY_METHOD' => $order->getPaymentMethod(), 'PRICES_CURRENCY' => $order->getCurrency(), 'SELECTED_INSTALLMENTS_NUMBER' => $order->getInstallment(), 'ORDER_TIMEOUT' => $order->getTimeout(), 'BACK_REF' => $this->configuration->getPaymentReturnPointUrl(), 'CLIENT_IP' => $order->getClientIp());
        if ((double) $order->getLoyaltyAmount() != 0) {
            $data['USE_LOYALTY_POINTS'] = 'YES';
            if ((double) $order->getLoyaltyAmount() != (double) $this->request->getBasket()->getTotalPrice()) {
                $data['LOYALTY_POINTS_AMOUNT'] = (double) $order->getLoyaltyAmount();
            }
        }
        if ($order->isRecurringPayment() === true) {
            $data['LU_ENABLE_TOKEN'] = 1;
        }
        return $data;
    }

Usage Example

 /**
  * @return array
  */
 protected function serializeOrder()
 {
     /** @var $order \Payu\Component\Order */
     $order = $this->request->getOrder();
     if (!$order) {
         return array();
     }
     return parent::serializeOrder();
 }