Add order params to request.

@param string[] $params
@param int      $money
@param string[] $options

@return array
422604
protected function addOrder(array $params, $money, array $options)
    {
        return array_merge($params, [
            'amount'      => $this->gateway->amount($money),
            'currency'    => Arr::get($options, 'currency', $this->gateway->getCurrency()),
            'description' => Helper::ascii(Arr::get($options, 'description', 'PayMe Purchase')),
            'order_id'    => Arr::get($options, 'reference'),
        ]);
    }
550829
public function add(array $data, array $options = array())
    {
        $result = array();
        $this->hook->attach('order.submit.before', $data, $options, $result, $this);

        if (!empty($result)) {
            return (array) $result;
        }

        $data['order_id'] = $this->order->add($data);

        if (empty($data['order_id'])) {
            return $this->getResultError();
        }

        $order = $this->order->get($data['order_id']);
        $this->setBundledProducts($order, $data);

        if (empty($options['admin'])) {
            $this->setPriceRules($order);
            $this->updateCart($order, $data['cart']);
            $this->notifyCreated($order);
            $result = $this->getResultAdded($order);
        } else {
            $this->cloneCart($order, $data['cart']);
            $result = $this->getResultAddedAdmin($order);
        }

        $this->hook->attach('order.submit.after', $data, $options, $result, $this);
        return (array) $result;
    }
625541
public function provide($data = null, array $options = [])
    {
        $selectListItems = $this->config->getProvider('selectOptions');
        $selectListItems = new $selectListItems($this->config);
        $listName = $options['fieldDefinitions']->getLimit();

        $selectOptions = $selectListItems->provide($listName, ['symbol']);

        foreach ($selectOptions as $k => $v) {
            $selectOptions[$k] = CurrencyValueRenderer::getIcon($v, $v);
        }

        $options['selectOptions'] = $selectOptions;
        $options['element'] = 'CsvMigrations.FieldHandlers/CurrencyFieldHandler/input';

        return parent::provide($data, $options);
    }
876097
protected function addShipping(array $params, array $options)
    {
        if ($address = Arr::get($options, 'shipping_address')) {
            $params['application_context']['shipping_preference'] = 'SET_PROVIDED_ADDRESS';
            $params['transactions'][0]['amount']['details']['shipping'] = $this->gateway
                ->amount(Arr::get($address, 'price', 0));

            $params['transactions'][0]['item_list']['shipping_address'] = [
                'recipient_name' => trim(Arr::get($options, 'name')),
                'line1'          => Arr::get($address, 'address1', ''),
                'line2'          => Arr::get($address, 'address2', ''),
                'city'           => Arr::get($address, 'city', ''),
                'country_code'   => Arr::get($address, 'country', ''),
                'postal_code'    => Arr::get($address, 'zip', ''),
                'state'          => Arr::get($address, 'state', ''),
                'phone'          => Arr::get($options, 'phone', ''),
            ];
        } else {
            $params['application_context']['shipping_preference'] = 'NO_SHIPPING';
        }

        return $params;
    }
587667
public function toWords($amount, $currency, $options = null)
    {
        $dictionary = new PolishDictionary();
        $numberToTripletsConverter = new NumberToTripletsConverter();
        $tripletTransformer = new PolishTripletTransformer($dictionary);
        $nounGenderInflector = new PolishNounGenderInflector();
        $exponentInflector = new PolishExponentInflector($nounGenderInflector);

        $numberTransformer = (new NumberTransformerBuilder())
            ->withDictionary($dictionary)
            ->withWordsSeparatedBy(' ')
            ->transformNumbersBySplittingIntoTriplets($numberToTripletsConverter, $tripletTransformer)
            ->inflectExponentByNumbers($exponentInflector)
            ->build();

        $decimal = (int) ($amount / 100);
        $fraction = $amount % 100;

        if ($fraction === 0) {
            $fraction = null;
        }

        $currency = strtoupper($currency);

        if (!array_key_exists($currency, PolishDictionary::$currencyNames)) {
            throw new NumberToWordsException(
                sprintf('Currency "%s" is not available for "%s" language', $currency, get_class($this))
            );
        }

        $currencyNames = PolishDictionary::$currencyNames[$currency];

        $words = [];

        $words[] = $numberTransformer->toWords($decimal);
        $words[] = $nounGenderInflector->inflectNounByNumber(
            $decimal,
            $currencyNames[0][0],
            $currencyNames[0][1],
            $currencyNames[0][2]
        );

        if (null !== $fraction) {
            $words[] = $numberTransformer->toWords($fraction);
            $words[] = $nounGenderInflector->inflectNounByNumber(
                $fraction,
                $currencyNames[1][0],
                $currencyNames[1][1],
                $currencyNames[1][2]
            );
        }

        return implode(' ', $words);
    }
662055
private function factoryAmount($options)
    {
        $amount = new MonetaryAmount(null, $options['currency']);
        if ($options['value'] > 0) {
            $amount->setValue($options['value']);
        }

        return $amount;
    }
1184443
public function add($params) {
		OpenpayConsole::trace('OpenpayApiDerivedResource @add');
		
		// TODO: validate call when the parent has not a valid ID
		$resource = parent::_create($this->resourceName, $params, array('parent' => $this));
		$this->addResource($resource);
		return $resource;
	}
2631
protected function addBilling(array $params, array $options)
    {
        if ($address = Arr::get($options, 'billing_address')) {
            $params['payer']['payer_info']['billing_address'] = [
                'line1'        => Arr::get($address, 'address1', ''),
                'line2'        => Arr::get($address, 'address2', ''),
                'city'         => Arr::get($address, 'city', ''),
                'country_code' => Arr::get($address, 'country', ''),
                'postal_code'  => Arr::get($address, 'zip', ''),
                'state'        => Arr::get($address, 'state', ''),
            ];
        }

        return $params;
    }
1303904
public function capture($money, $authorization, $options = array())
    {
        $this->required_options("order_id", $options);

        $this->post = array(
            "AuthTrxnNumber" => $authorization,
            "TotalAmount" => $this->amount($money)
        );

        $cc = new CreditCard(array());
        $this->addCreditcard($cc);
        #$this->addInvoice($options);
        $this->addOptionalData();
        return $this->commit("xmlauthcomplete", $money);
    }
36919
protected function addInvoice($money, $options)
    {
        $this->xml->TxnDetails(null, 'Transaction')
            ->merchantreference($options['order_id'], 'TxnDetails')
            ->amount(
                $this->amount($money),
                'TxnDetails',
                array('currency' => self::$default_currency)
            );
        $this->addThreeDSecure($options);
    }
943522
public function create($amount, $payment, $options = [])
    {
        $params = [];

        $params['METHOD'] = $payment;
        $params['PAYMENTREQUEST_0_PAYMENTACTION'] = 'Sale';
        $params['RETURNURL'] = Arr::get($options, 'return_url');
        $params['CANCELURL'] = Arr::get($options, 'cancel_url');

        $params = $this->addOrder($params, $amount, $options);
        $params = $this->addBN($params, $options);

        return $this->gateway->commit('post', $this->gateway->buildUrlFromString(''), $params, [
            'isRedirect' => true,
        ]);
    }
209297
public static String orderRefundQuery(boolean isSandbox, Map<String, String> params) {
		if (isSandbox)
			return doPost(REFUNDQUERY_SANDBOXNEW_URL, params);
		return doPost(REFUNDQUERY_URL, params);
	}
117370
public function put($url, $params = array(), $options = array())
    {
        return $this->request($url, self::PUT, $params, $options);
    }
782467
public static function hostedOrderForm($order, $params = array())
    {
        $orderFormUrl = OpenPayU_Configuration::getServiceUrl() . 'orders';

        $formFieldValuesAsArray = array();
        $htmlFormFields = OpenPayU_Util::convertArrayToHtmlForm($order, '', $formFieldValuesAsArray);

        $signature = OpenPayU_Util::generateSignData(
            $formFieldValuesAsArray,
            OpenPayU_Configuration::getHashAlgorithm(),
            OpenPayU_Configuration::getMerchantPosId(),
            OpenPayU_Configuration::getSignatureKey()
        );

        $formParams = array_merge(self::$defaultFormParams, $params);

        $htmlOutput = sprintf("<form method=\"POST\" action=\"%s\" id=\"%s\" class=\"%s\">\n", $orderFormUrl, $formParams['formId'], $formParams['formClass']);
        $htmlOutput .= $htmlFormFields;
        $htmlOutput .= sprintf("<input type=\"hidden\" name=\"OpenPayu-Signature\" value=\"%s\" />", $signature);
        $htmlOutput .= sprintf("<button type=\"submit\" formtarget=\"%s\" id=\"%s\" class=\"%s\">%s</button>", $formParams['submitTarget'], $formParams['submitId'], $formParams['submitClass'], $formParams['submitContent']);
        $htmlOutput .= "</form>\n";

        return $htmlOutput;
    }
227598
protected function addBillingAddress(array $params, array $options)
    {
        if ($address = Arr::get($options, 'billing_address') && $taxId = Arr::get($address, 'tax_id') && $companyName = Arr::get($address, 'company_name')) {
            $addressFiltered = Arr::filters([
                'street1'         => Arr::get($address, 'address1'),
                'street2'         => Arr::get($address, 'address2'),
                'street3'         => Arr::get($address, 'address3'),
                'external_number' => Arr::get($address, 'external_number'),
                'city'            => Arr::get($address, 'city'),
                'country'         => Arr::get($address, 'country'),
                'state'           => Arr::get($address, 'state'),
                'postal_code'     => Arr::get($address, 'zip'),
            ]);

            if (!empty($addressFiltered)) {
                $params['fiscal_entity']['address'] = $addressFiltered;
            }

            $params['fiscal_entity']['phone'] = Arr::get($address, 'phone', Arr::get($options, 'phone', 'none'));
            $params['fiscal_entity']['email'] = Arr::get($address, 'email', Arr::get($options, 'email', 'none'));
            $params['fiscal_entity']['tax_id'] = $taxId;
            $params['fiscal_entity']['company_name'] = $companyName;
        }

        return $params;
    }
720754
protected static function _staticRequest($method, $url, $params, $options)
    {
        $opts = \Stripe\Util\RequestOptions::parse($options);
        $baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl();
        $requestor = new \Stripe\ApiRequestor($opts->apiKey, $baseUrl);
        list($response, $opts->apiKey) = $requestor->request($method, $url, $params, $opts->headers);
        $opts->discardNonPersistentHeaders();
        return [$response, $opts];
    }
833919
public function retrieveOrder($requestParams)
    {
        $requiredParams = array("id");
        return $this->client->request($requestParams, $this->_mainTransactionEndpoint . "/" . self::ORDER, "get", $requiredParams, $options = NULL);
    }