public function _build($payment, $type)
        {
            $order    = $payment->getOrder();
            $billing  = $order->getBillingAddress();
            $shipping = $order->getShippingAddress();

            # Should be only used in the developement environment
            # without it we get duplicate order id.
            $token = $this->getConfigData('order_token');
            $token = (empty($token)) ? "" : "-" . $token;


            $transaction = array(
                'type'       => $type,
                'order_id'   => $order->getIncrementId() . $token,
                'crypt_type' => self::CRYPT_TYPE,
            );


            switch($type) {
                case self::TRANSACTION_PREAUTH :
                    $transaction = $transaction + array(
                        'cust_id'    => $billing->getCustomerId(),
                        'amount'     => sprintf("%01.2f", $payment->getAmount()),
                        'pan'        => $this->_cleanCC($payment->getCcNumber()),
                        'expdate'    => $this->_formatExpirationDate($payment->getCcExpYear(), $payment->getCcExpMonth()),
                        'cvd_value'  => $payment->getCcCid(),
                        'cvd_indicator' => 1
                    );

                    break;
                case self::TRANSACTION_COMPLETION :
                    $transaction = $transaction + array(
                        'comp_amount' => sprintf("%01.2f", $payment->getAmount()),
                        'txn_number'  => $payment->getCcTransId(),
                    );

                    break;
                case self::TRANSACTION_VOID :
                    $transaction = $transaction + array(
                        'comp_amount' => sprintf("%01.2f", $payment->getAmount()),
                        'txn_number'  => $payment->getCcTransId(),
                    );
                    break;

            }

            return new mpgTransaction($transaction);
        }