Add billing params.

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

@return array
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;
    }
705029
protected function addPayoutMethod(array $params, array $options)
    {
        $params['payout_method'] = [];
        $params['payout_method']['type'] = 'bank_transfer_payout_method';
        $params['payout_method']['account_number'] = Arr::get($options, 'account_number');
        $params['payout_method']['account_holder'] = Arr::get($options, 'account_holder');

        return $params;
    }
136194
public function addOptions( $options ) {
		foreach ( $options as $key => $option ) {
			if ( is_int( $key ) ) {
				$this->addOption( $option );
			} else {
				$this->addOption( $key, $option );
			}
		}
	}
944388
private function addCustomerData($options)
    {
        $this->post['BillingEmail'] = isset($options['email']) ? $options['email'] : null;
        $this->post['BillingPhoneNumber'] = isset($options['phone']) ? $options['phone'] : null;
    }
117370
public function put($url, $params = array(), $options = array())
    {
        return $this->request($url, self::PUT, $params, $options);
    }
813144
public function addParameters(&$params)
    {
        $params['grant_type'] = $this->getType();
        $params['username'] = $this->username;
        $params['password'] = $this->password;
    }
112630
protected function addLineItems(array $params, array $options)
    {
        if (isset($options['line_items']) && is_array($options['line_items'])) {
            $item = 0;
            $params['PAYMENTREQUEST_0_ITEMAMT'] = 0;

            foreach ($options['line_items'] as $lineItem) {
                $params["L_PAYMENTREQUEST_0_NAME{$item}"] = Arr::get($lineItem, 'name');
                $params["L_PAYMENTREQUEST_0_DESC{$item}"] = Arr::get($lineItem, 'description');
                $params["L_PAYMENTREQUEST_0_QTY{$item}"] = Arr::get($lineItem, 'quantity', 1);
                $params["L_PAYMENTREQUEST_0_AMT{$item}"] = $this->gateway->amount(Arr::get($lineItem, 'unit_price'));
                $params['PAYMENTREQUEST_0_ITEMAMT'] += Arr::get($lineItem, 'quantity', 1) * Arr::get($lineItem, 'unit_price');
                $item++;
            }

            if (isset($options['discount'])) {
                $item++;
                $params["L_PAYMENTREQUEST_0_NAME{$item}"] = Arr::get($options, 'discount_concept', 'Discount');
                $params["L_PAYMENTREQUEST_0_DESC{$item}"] = '';
                $params["L_PAYMENTREQUEST_0_QTY{$item}"] = 1;
                $params["L_PAYMENTREQUEST_0_AMT{$item}"] = -$this->gateway->amount($options['discount']);
                $params['PAYMENTREQUEST_0_ITEMAMT'] += -$options['discount'];
            }

            $params['PAYMENTREQUEST_0_ITEMAMT'] = $this->gateway->amount($params['PAYMENTREQUEST_0_ITEMAMT'], false);
        }

        return $params;
    }
179534
private function prepareData($params = [], $options = [])
    {
        if(array_get($options, 'content_type') == "json") {
            $data['json'] = $params; // pass data as array which gets json_encoded
        } else {
            $data['query'] = $this->prepareQueryString($params); // pass data as query string
        }

        return array_merge($data, $options);
    }
184830
protected function addCard(array $params, $payment, array $options)
    {
        if (is_string($payment)) {
            if (Helper::startsWith($payment, 'cus')) {
                $params['customer'] = $payment;
            } else {
                $params['source'] = $payment;
            }
        }

        return $params;
    }
436447
public function invoice(array $options = [])
    {
        if ($this->stripe_id) {
            $parameters = array_merge($options, ['customer' => $this->stripe_id]);

            try {
                return StripeInvoice::create($parameters, $this->getStripeKey())->pay();
            } catch (StripeErrorInvalidRequest $e) {
                return false;
            }
        }

        return true;
    }
694863
protected function addOrder(array $params, $money, array $options)
    {
        $params['items'][] = [
            'id'          => Arr::get($options, 'reference'),
            'title'       => Arr::get($options, 'description'),
            'description' => Arr::get($options, 'description'),
            'unit_price'  => (float) $this->gateway->amount($money),
            'quantity'    => 1,
            'currency_id' => Arr::get($options, 'currency'),
        ];

        return array_merge($params, [
            'currency_id'        => Arr::get($options, 'currency'),
            'external_reference' => Arr::get($options, 'reference'),
            'expires'            => Arr::get($options, 'expires', false),
        ]);
    }
1023154
protected function addLineItems(array $params, array $options)
    {
        $currency = Arr::get($options, 'currency', $this->gateway->getCurrency());

        $items = [];
        $itemsTotal = 0;
        foreach (Arr::get($options, 'line_items', []) as $item) {
            $items[] = [
                'name'        => $item['name'],
                'description' => Arr::get($item, 'description'),
                'quantity'    => $item['quantity'],
                'price'       => $this->gateway->amount($item['unit_price']),
                'sku'         => Arr::get($item, 'sku'),
                'currency'    => $currency,
            ];
            $itemsTotal += $item['unit_price'] * $item['quantity'];
        }

        if (!empty($items)) {
            $params['transactions'][0]['item_list']['items'] = $items;
            $params['transactions'][0]['amount']['details']['subtotal'] = $this->gateway->amount($itemsTotal);
        }

        return $params;
    }
937023
public function addParameters(array $params)
    {
        if (!is_array($params)) {
            throw new \InvalidArgumentException('$params has to be an array');
        }
        $this->parameters = array_merge($this->parameters, $params);
    }
212774
public function addCard($params, $setAsDefault = false)
    {
        if (is_array($params)) {
            $result = $this->generateToken($params);

            if ($result['status'] === 'error') {
                return $result;
            }

            $token = $result['token'];
        } else {
            $token = $params;
        }

        if (!$this->stripe_id) {
            $customer = $this->createAsStripeCustomer($token);

            $card = $this->getDefaultCard();

            return [
                'status' => 'success',
                'cardId' => $card['id']
            ];
        }

        $customerId = $this->stripe_id;

        try {
            $stripe = new Stripe(Billable::getStripeKey());

            $card = $stripe->cards()
                ->create($customerId, $token);

            if ($setAsDefault) {
                // lets set this card as the default
                $this->updateDefaultCard($card['id']);
            }

            return [
                'status' => 'success',
                'cardId' => $card['id']
            ];
        } catch (\Exception $e) {
            return [
                'status' => 'error',
                'message' => $e->getMessage()
            ];
        }
    }
398036
private function addDefaultParametersToRequest($params)
	{
		// check if merchantAccount is setup in client and request is missing merchantAccount then add it
		if (!isset($params['merchantAccount']) && $this->service->getClient()->getConfig()->getMerchantAccount()) {
			$params['merchantAccount'] = $this->service->getClient()->getConfig()->getMerchantAccount();
		}

		return $params;
	}
1044715
protected function addLineItems(array $params, array $options)
    {
        if (isset($options['line_items']) && is_array($options['line_items'])) {
            foreach ($options['line_items'] as $lineItem) {
                $params['line_items'][] = [
                    'name'        => Arr::get($lineItem, 'name'),
                    'description' => Arr::get($lineItem, 'description'),
                    'unit_price'  => (int) $this->gateway->amount(Arr::get($lineItem, 'unit_price')),
                    'quantity'    => Arr::get($lineItem, 'quantity', 1),
                    'sku'         => Arr::get($lineItem, 'sku'),
                    'category'    => Arr::get($lineItem, 'category'),
                    'type'        => Arr::get($lineItem, 'type', 'physical'),
                    'tags'        => ['none'],
                ];
            }
        }

        return $params;
    }
550632
public function addOptions(array $options)
    {
        foreach ($options as $name => $defaultValue) {
            $this->addOption($name, $defaultValue);
        }

        return $this;
    }