protected function composeDetails(PaymentInterface $payment, TokenInterface $token)
    {
        if ($payment->getDetails()) {
            return;
        }

        $order = $payment->getOrder();

        $details = array();

		$details['payment_method'] = $this->apiMethod(strtolower($payment->getMethod()->getName()));
		$details['payment_type'] = self::DEFAULT_PAYMENT_TYPE;

        $details['order_code'] = $order->getNumber().'-'.$payment->getId();
        $details['cur_code'] = $order->getCurrency();
        $details['total_amount'] = round($order->getTotal() / 100, 2);
		$details['total_item'] = count($order->getItems());

        $m = 0;
        foreach ($order->getItems() as $item) 
		{
            $details['item_name'.$m] = $item->getId();
            $details['item_amount'.$m] = round($item->getTotal()/$item->getQuantity()/100, 2);
            $details['item_quantity'.$m] = $item->getQuantity();

            $m++;
        }

        if (0 !== $taxTotal = $this->calculateNonNeutralTaxTotal($order)) {
            $details['tax_amount']  = $taxTotal;
        }

        if (0 !== $promotionTotal = $order->getAdjustmentsTotal(AdjustmentInterface::PROMOTION_ADJUSTMENT)) {
            $details['discount_amount']  = $promotionTotal;
        }

        if (0 !== $shippingTotal = $order->getAdjustmentsTotal(AdjustmentInterface::SHIPPING_ADJUSTMENT)) {
            $details['fee_shipping']  = $shippingTotal;
        }

        $payment->setDetails($details);
    }
protected function composeDetails(PaymentInterface $payment, TokenInterface $token)
    {
        if ($payment->getDetails()) {
            return;
        }

        $order = $payment->getOrder();

        $details = array();

		$details['payment_method'] = $this->apiMethod(strtolower($payment->getMethod()->getName()));
		$details['payment_type'] = self::DEFAULT_PAYMENT_TYPE;

        $details['order_code'] = $order->getNumber().'-'.$payment->getId();
        $details['cur_code'] = $order->getCurrency();
        $details['total_amount'] = round($order->getTotal() / 100, 2);
		$details['total_item'] = count($order->getItems());

        $m = 0;
        foreach ($order->getItems() as $item) 
		{
            $details['item_name'.$m] = $item->getId();
            $details['item_amount'.$m] = round($item->getTotal()/$item->getQuantity()/100, 2);
            $details['item_quantity'.$m] = $item->getQuantity();

            $m++;
        }

        if (0 !== $taxTotal = $this->calculateNonNeutralTaxTotal($order)) {
            $details['tax_amount']  = $taxTotal;
        }

        if (0 !== $promotionTotal = $order->getAdjustmentsTotal(AdjustmentInterface::PROMOTION_ADJUSTMENT)) {
            $details['discount_amount']  = $promotionTotal;
        }

        if (0 !== $shippingTotal = $order->getAdjustmentsTotal(AdjustmentInterface::SHIPPING_ADJUSTMENT)) {
            $details['fee_shipping']  = $shippingTotal;
        }

        $payment->setDetails($details);
    }
{@inheritdoc}