The MosaicTransfer transaction type adds the `mosaics` offset
to the Transaction DTO and also adds all fields defined in the
Transfer::extend() overload.

@return array
350218
public function extend() 
    {
        $version = $this->getAttribute("version");
        $twoByOld = [
            Transaction::VERSION_1       => Transaction::VERSION_2,
            Transaction::VERSION_1_TEST  => Transaction::VERSION_2_TEST,
            Transaction::VERSION_1_MIJIN => Transaction::VERSION_2_MIJIN,
        ];

        // MosaicTransfer always use *VERSION 2 TRANSACTIONS*.
        // this small block will make sure to stay on the correct
        // network in case a version was set before.

        if (in_array($version, array_keys($twoByOld))) {
            // switch to v2
            $version = $twoByOld[$version];
        }
        elseif (!$version || !in_array($version, array_values($twoByOld))) {
            // invalid version provided, set default
            $version = Transaction::VERSION_2_TEST;
        }

        return [
            "amount"    => $this->amount()->toMicro(),
            "recipient" => $this->recipient()->address()->toClean(),
            "message"   => $this->message()->toDTO(),
            "mosaics"   => $this->mosaics()->toDTO(),
            // transaction type specialization
            "type"      => TransactionType::TRANSFER,
            "version"   => $version,
        ];
    }
994717
public function getOptions(AbstractTransfer $quoteTransfer)
    {
        return [
            CreditCardSubForm::OPTION_CARD_EXPIRES_CHOICES_MONTH => $this->getMonthChoices(),
            CreditCardSubForm::OPTION_CARD_EXPIRES_CHOICES_YEAR => $this->getYearChoices(),
            CreditCardSubForm::OPTION_CARD_TYPES => $this->getCardTypes(),
        ];
    }
1120897
private function getTransactionTypeObject($sTransactionType)
    {
        static $aTypeCache = array();
        if (false === isset($aTypeCache[$sTransactionType])) {
            $oTransactionType = TdbPkgShopPaymentTransactionType::GetNewInstance();
            if (false === $oTransactionType->LoadFromField('system_name', $sTransactionType)) {
                $sMessage = "transaction type {$sTransactionType} does not exists in DB";
                throw new TPkgShopPaymentTransactionException_InvalidTransactionType(
                    self::MESSAGE_ERROR, array('sMessage' => $sMessage),
                    $sMessage,
                    array(
                        'order' => $this->order->sqlData,
                        'type' => $sTransactionType,
                    ),
                    1,
                    self::LOG
                );
            }
            $aTypeCache[$sTransactionType] = $oTransactionType;
        }

        return $aTypeCache[$sTransactionType];
    }
378589
protected function transfer($objectOrArray): array
	{
		$data = [];
		$errors = [];
		if (\is_object($objectOrArray))
		{
			$errors = $this->dtService->transfer($objectOrArray, $data, $this->mapper);
		}
		elseif (\is_array($objectOrArray))
		{
			foreach ($objectOrArray as $index => $itemObjectOrArray)
			{
				[$data[$index], $itemErrors] = $this->transfer($itemObjectOrArray);
				if (!empty($itemErrors))
				{
					$errors[$index] = $itemErrors;
				}
			}
		}
		else
		{
			$data = $objectOrArray;
		}
		return [$data, $errors];
	}
119779
protected function getPaymentTransactionStructure()
    {
        return [
            'usage'              => $this->usage,
            'remote_ip'          => $this->remote_ip,
            'return_success_url' => $this->return_success_url,
            'return_failure_url' => $this->return_failure_url,
            'amount'             => $this->transformAmount($this->amount, $this->currency),
            'currency'           => $this->currency,
            'consumer_reference' => $this->consumer_reference,
            'national_id'        => $this->national_id,
            'birth_date'         => $this->birth_date,
            'customer_email'     => $this->customer_email,
            'billing_address'    => $this->getBillingAddressParamsStructure(),
            'shipping_address'   => $this->getShippingAddressParamsStructure()
        ];
    }
70931
public function alteredForeignKeys(): array
    {
        $difference = [];

        foreach ($this->current->getForeignKeys() as $name => $foreignKey) {
            if (!$this->initial->hasForeignKey($foreignKey->getColumn())) {
                //Added into schema
                continue;
            }

            $initial = $this->initial->findForeignKey($foreignKey->getColumn());
            if (!$foreignKey->compare($initial)) {
                $difference[] = [$foreignKey, $initial];
            }
        }

        return $difference;
    }
1267953
public function getExtraData()
    {
        if (! isset($this->_gemsData['gec_extra_data'])) {
            return [];
        }
        if (is_string($this->_gemsData['gec_extra_data'])) {
            $this->_gemsData['gec_extra_data'] = json_decode($this->_gemsData['gec_extra_data'], true);
        }

        return $this->_gemsData['gec_extra_data'];
    }
637155
protected function getPaymentTransactionStructure()
    {
        return [
            'usage'                  => $this->usage,
            'remote_ip'              => $this->remote_ip,
            'return_success_url'     => $this->return_success_url,
            'return_failure_url'     => $this->return_failure_url,
            'amount'                 => $this->transformAmount($this->amount, $this->currency),
            'currency'               => $this->currency,
            'customer_email'         => $this->customer_email,
            'crypto_address'         => $this->crypto_address,
            'crypto_wallet_provider' => $this->crypto_wallet_provider,
            'billing_address'        => $this->getBillingAddressParamsStructure(),
            'shipping_address'       => $this->getShippingAddressParamsStructure()
        ];
    }
1249287
protected function getExtensions()
    {
        if (null === $this->extensions) {
            $basename = $this->getBasename();

            # Avoid treating name of a dotfile as extension by
            # ignoring dots at the first offset in the string
            if (!$basename or false === ($pos = strpos($basename, '.', 1))) {
                return array();
            }

            $extensions = explode('.', substr($basename, $pos + 1));

            $this->extensions = array_map(function($ext) {
                return Path::normalizeExtension($ext);
            }, $extensions);
        }

        return $this->extensions;
    }
212859
public function extend() 
    {
        // set default mode in case its invalid
        $mode = $this->getAttribute("mode");
        if (! $mode || ! in_array($mode, [self::MODE_ACTIVATE, self::MODE_DEACTIVATE])) {
            $mode = self::MODE_ACTIVATE;
            $this->setAttribute("mode", $mode);
        }

        return [
            "remoteAccount" => $this->remoteAccount()->publicKey,
            "mode" => $this->mode,
            // transaction type specialization
            "type"      => TransactionType::IMPORTANCE_TRANSFER,
        ];
    }
601964
protected function getPaymentTransactionStructure()
    {
        return [
            'amount'              => $this->transformAmount($this->amount, $this->currency),
            'currency'            => $this->currency,
            'customer_email'      => $this->customer_email,
            'customer_phone'      => $this->customer_phone,
            'return_success_url'  => $this->return_success_url,
            'return_failure_url'  => $this->return_failure_url,
            'bank_code'           => $this->bank_code,
            'bank_name'           => $this->bank_name,
            'bank_branch'         => $this->bank_branch,
            'bank_account_name'   => $this->bank_account_name,
            'bank_account_number' => $this->bank_account_number,
            'billing_address'     => $this->getBillingAddressParamsStructure(),
            'shipping_address'    => $this->getShippingAddressParamsStructure()
        ];
    }
305059
public function deserialize(): Transaction
    {
        $transaction = new Transaction();
        $transaction->version = $this->buffer->readUInt8();
        $transaction->network = $this->buffer->readUInt8();
        $transaction->type = $this->buffer->readUInt8();
        $transaction->timestamp = $this->buffer->readUInt32();
        $transaction->senderPublicKey = $this->buffer->readHex(33);
        $transaction->fee = $this->buffer->readUInt64();

        $vendorFieldLength = $this->buffer->readUInt8();
        if ($vendorFieldLength > 0) {
            $transaction->vendorFieldHex = $this->buffer->readHex($vendorFieldLength);
        }

        $assetOffset = (41 + 8 + 1) * 2 + $vendorFieldLength * 2;

        $transaction = $this->handleType($assetOffset, $transaction);

        if (! isset($transaction->amount)) {
            $transaction->amount = 0;
        }

        if (! isset($transaction->version) || 1 === $transaction->version) {
            $transaction = $this->handleVersionOne($transaction);
        }

        if (2 === $transaction->version) {
            $transaction = $this->handleVersionTwo($transaction);
        }

        return $transaction;
    }
22275
protected function addTransaction()
    {
        /* @var $model \gplcart\core\models\Transaction */
        $model = gplcart_instance_model('Transaction');

        $transaction = array(
            'total' => $this->data_order['total'],
            'order_id' => $this->data_order['order_id'],
            'currency' => $this->data_order['currency'],
            'payment_method' => $this->data_order['payment'],
            'gateway_transaction_id' => $this->response->getTransactionReference()
        );

        return $model->add($transaction);
    }
444071
public function getExtensions()
    {
        if (null == $this->extensions_unserialized && null !== $this->extensions) {
            $this->extensions_unserialized = unserialize($this->extensions);
        }

        return $this->extensions_unserialized;
    }
441342
public function getData()
    {
        $this->validate('transactionReference', 'MD', 'PaRes');

        return [
            'opcode'     => 3,
            'payment_id' => $this->getTransactionReference(),
            'PaRes'      => $this->getPaRes(),
            'MD'         => $this->getMD(),
            'token'      => $this->getRequestToken(),
        ];
    }
944803
protected function getPaymentTransactionStructure()
    {
        return [
            'amount'             => $this->transformAmount($this->amount, $this->currency),
            'currency'           => $this->currency,
            'bank_code'          => $this->bank_code,
            'return_success_url' => $this->return_success_url,
            'return_failure_url' => $this->return_failure_url,
            'customer_email'     => $this->customer_email,
            'customer_phone'     => $this->customer_phone,
            'payment_type'       => $this->payment_type,
            'document_id'        => $this->document_id,
            'billing_address'    => $this->getBillingAddressParamsStructure(),
            'shipping_address'   => $this->getShippingAddressParamsStructure()
        ];
    }
285277
public function _buildTransfer($options)
    {
        $destinations = $options['destinations'];
        // Convert Monero amount to atomic units
        if(gettype($destinations) == "object"){
            $destinations->amount = $destinations->amount * 1e12;
            $destinations = array($destinations);
        } else {
            foreach ($destinations as &$destination){
                $destination->amount = $destination->amount * 1e12;
            }
        }
        // Define Mixin
        $mixin = (isset($options['mixin']) ? $options['mixin'] : 4);
        // Define Unlock Time
        $unlock_time = (isset($options['unlock_time']) ? $options['unlock_time'] : 0);
        // Define Payment ID
        $payment_id = (isset($options['payment_id']) ? $options['payment_id'] : null);
        // Build params array
        $params = [
            'destinations' => $destinations,
            'mixin' => $mixin,
            'unlock_time' => $unlock_time,
            'payment_id' => $payment_id
        ];
        // Set algorithm type if using transfer_split method
        if($options['method'] == "transfer_split"){
            $new_algorithm = (isset($options['new_algorithm']) ? $options['new_algorithm'] : false);
            $params['new_algorithm'] = $new_algorithm;
        }
        // Build request body
        $body = [
            'method' => $options['method'],
            'params' => $params
        ];
        return $body;
    }