@param number                      $money      - Total order amount.       (REQUIRED)
@param Merchant_Billing_CreditCard $creditcard - A creditcard class object (REQUIRED)
@param array                       $options

@return Merchant_Billing_Response
7494
public function authorize($money, Merchant_Billing_CreditCard $creditcard, $options = array())
  {
      $this->required_options('customer_email', $options);
      $this->build_xml($money, 'PreAuth', $creditcard, $options);

      return $this->commit();
  }
485490
public function charge($amount, array $options = []): Successful
    {
        $response = BraintreeTransaction::sale(array_merge([
            'amount' => number_format($amount * (1 + ($this->taxPercentage() / 100)), 2, '.', ''),
            'paymentMethodToken' => $this->paymentMethod()->token,
            'options' => [
                'submitForSettlement' => true,
            ],
            'recurring' => true,
        ], $options));

        if (! $response->success) {
            throw new Exception('Braintree was unable to perform a charge: '.$response->message);
        }

        return $response;
    }
542529
public function setPurchase($amount, $currency)
    {
        $this->data['purchase']['checkout']['amount'] = $amount;
        $this->data['purchase']['checkout']['currency'] = $currency;

        return $this;
    }
1264907
public function create($amount, $payment, $options = [])
    {
        $params = [];

        $params = $this->addPayment($params, $amount, $payment, $options);

        $params = Encryption::encryptParametersWithString($params);
        $params = $this->addMetadata($params, $amount, $options);

        return $this->gateway->commit('post', $this->gateway->buildUrlFromString('payment/card'), $params);
    }
931157
public function refund($amount, $reference, array $options = [])
    {
        $params = [];

        if ($amount !== null) {
            $params['amount'] = $this->gateway->amount($amount);
        }

        if (array_key_exists('reason', $options)) {
            $params['reason'] = $options['reason'];
        }

        $url = sprintf($this->gateway->buildUrlFromString('orders').'/%s/refund', $reference);

        return $this->gateway->commit('post', $url, $params);
    }
367397
public function creditCardPartial($amount)
    {
        $data = new stdClass();
        $data->amount = $amount;

        return $this->execute($data);
    }
270331
public static function charge(array $options = array())
    {
        $api = new Api\Charge();

        if (isset($options['pincode'])) {
            $api->setPincode($options['pincode']);
        }
        if (isset($options['cardNumber'])) {
            $api->setCardNumber($options['cardNumber']);
        }
        if (isset($options['amount'])) {
            $api->setAmount(round($options['amount'] * 100));
        }
        $result = $api->doRequest();

        return $result['request']['result'] == 1;
    }
1159910
public function credit($money, $identification, $options = array())
  {
      $this->required_options('card_number', $options);
      $this->post = array(
         'trans_id' => $identification,
         'card_num' => $options['card_number'],
     );

      $this->add_invoice($options);

      return $this->commit('CREDIT', $money);
  }
147105
static function withOrderNumberAmountAndCurrency($orderNumber, $amount, $currency)
    {
        return (new static())
            ->setOrderNumber($orderNumber)
            ->setAmount($amount)
            ->setCurrency($currency)
            ;
    }
1140418
public function onCheckout($cart)
    {
        if (!isset($this->omnipay))
            throw new ShopException('Omnipay gateway not set.', 0);

        if ($this->isCreditCard && !isset($this->creditCard))
            throw new GatewayException('Credit Card not set.', 1);
        try {

            $response = $this->omnipay->authorize(array_merge([
                'amount'    => $cart->total,
                'currency'  => Config::get('shop.currency'),
                'card'      => $this->isCreditCard ? $this->creditCard : [],
                'returnUrl' => $this->callbackSuccess,
            ], $this->options))->send();

            if (!$response->isSuccessful()) {
                throw new CheckoutException($response->getMessage(), 1);
            }

        } catch (Exception $e) {

            throw new CheckoutException(
                'Exception caught while attempting authorize.' . "\n" . 
                $e->getMessage(),
                1
            );
        }
    }
529332
private function addCreditcard(CreditCard $creditcard)
    {
        $this->post['CardNumber'] = $creditcard->number;
        $this->post['CardExpiryMonth'] = $this->cc_format($creditcard->month, 'two_digits');
        $this->post['CardExpiryYear'] = $this->cc_format($creditcard->year, 'two_digits');
        $this->post['CustomerFirstName'] = $creditcard->first_name;
        $this->post['CustomerLastName'] = $creditcard->last_name;
        $this->post['CardHoldersName'] = $creditcard->name();

        if ($creditcard->verification_value) {
            $this->post['CVN'] = $creditcard->verification_value;
        }
    }
295939
public function setSalesDiscount(Money $money = null): OrderInterface
    {
        $this->salesDiscount = $money->getAmount();

        return $this;
    }
235606
public function charge($amount, array $options = array())
	{
		// $options = array_merge([
		// 	'currency' => $this->getCurrency(),
		// ], $options);
		
		$options['amount'] = $amount / 100;
		
		// if (! array_key_exists('source', $options) && $this->billable->hasBraintreeId()) {
		// 	$options['customer'] = $this->billable->getBraintreeId();
		// }
		
		// if (! array_key_exists('source', $options) && ! array_key_exists('customer', $options)) {
		// 	throw new InvalidArgumentException("No payment source provided.");
		// }
		
		// try {
			$response = BraintreeCharge::sale($options);
		// }
		// catch (StripeErrorCard $e) {
		// 	return false;
		// }
		
		return $response;
	}
1061707
public static function currency($number, array $options = []) {
        $g11n = G11n::registry();

        if ($g11n->isEnabled()) {
            $options = array_merge(
                $g11n->current()->getFormatPatterns('number'),
                $g11n->current()->getFormatPatterns('currency'),
                $options
            );
        }

        return parent::currency($number, $options);
    }
873342
public function refund($amount, $reference, array $options = [])
    {
        $url = sprintf($this->gateway->buildUrlFromString('charges').'/%s/refund', $reference);

        return $this->gateway->commit('post', $url, [
            'amount'      => $this->gateway->amount($amount),
            'description' => Arr::get($options, 'description'),
        ]);
    }
366441
public static function withSecure($amount, Currency $currency = null)
    {
        if(!is_long($amount))
            throw new InvalidAmountException;
        $money = self::withRaw(0, $currency);
        $money->setFraction($amount / 100);
        $money->setWhole($amount / 100);
        return $money;
    }
83133
public function refund($amount, $reference, array $options = [])
    {
        $params = [
            'type'   => 'refund',
            'amount' => $amount,
            'status' => new Status('refunded'),
        ];

        return $this->gateway->commit(null, null, $params);
    }