@param null $amount

@return \HpsGiftCardServiceSaleBuilder
191452
public function sale($amount = null)
    {
        $builder = new HpsGiftCardServiceSaleBuilder($this);
        return $builder
            ->withAmount($amount)
            ->withCurrency('usd');
    }
1049819
public function capture(Varien_Object $payment, $amount)
    {
        parent::capture($payment, $amount);
        $payment->setStatus(self::STATUS_APPROVED)
            ->setTransactionId($this->getTransactionId())
            ->setIsTransactionClosed(0);
        $order = $payment->getOrder();
        $currency = $order->getOrderCurrencyCode();

        if ($payment->hasCurrentInvoice() && $currency != $order->getBaseCurrencyCode()) {
            $invoice = $payment->getCurrentInvoice();
            $amount = $invoice->getGrandTotal();
        }

        // do capture request to adyen
        $order = $payment->getOrder();
        $pspReference = Mage::getModel('adyen/event')->getOriginalPspReference($order->getIncrementId());
        $order->getPayment()->getMethodInstance()->sendCaptureRequest($payment, $amount, $pspReference);

        return $this;
    }
38531
public function refund($amount = null)
    {
        return (new ManagementBuilder(TransactionType::REFUND))
            ->withPaymentMethod($this->transactionReference)
            ->withAmount($amount);
    }
248450
public function createFromValues($amount, $taxAmount)
    {
        return new TaxedPrice(
            $this->moneyFactory->createFromValue($amount),
            $this->moneyFactory->createFromValue($taxAmount)
        );
    }
525145
public function execute()
    {
        parent::execute();

        $rewardSvc = new HpsGiftCardService($this->service->servicesConfig());
        if ($this->token != null && ($this->token instanceof HpsTokenData)) {
            if ($this->card == null) {
                $this->card = new HpsGiftCard();
            }
            $this->card->tokenValue = $this->token->tokenValue;
        }
        return $rewardSvc->reward(
            $this->card,
            $this->amount,
            $this->currency,
            $this->gratuity,
            $this->tax
        );
    }
1061504
public function authorize($amount = null)
    {
        $builder = new HpsCreditServiceAuthorizeBuilder($this);
        return $builder
            ->withAmount($amount)
            ->withCurrency('usd');
    }
1337320
public function validateMax($amount)
    {
        $this->validator_attributes[] = 'data-parsley-max="' . (float)$amount . '"';

        $this->validator_checks['max'] = (float)$amount;

        return $this;
    }
1185961
public function offlineCharge($amount = null)
    {
        $builder = new HpsCreditServiceOfflineChargeBuilder($this);
        return $builder
            ->withAmount($amount)
            ->withCurrency('usd');
    }
745399
public function reverse($giftCard, $amount, $currency = 'usd')
    {
        $txnType = 'GiftCardReversal';

        HpsInputValidation::checkCurrency($currency);
        $amount = HpsInputValidation::checkAmount($amount);

        $xml = new DOMDocument();
        $hpsTransaction = $xml->createElement('hps:Transaction');
        $hpsGiftCard = $xml->createElement('hps:'. $txnType);
        $hpsBlock1 = $xml->createElement('hps:Block1');

        $hpsBlock1->appendChild($xml->createElement('hps:Amt', $amount));
        if ($giftCard instanceof HpsGiftCard) {
            $hpsBlock1->appendChild($this->_hydrateGiftCardData($giftCard, $xml));
        } else if ( $giftCard instanceof HpsTokenData ) {
            $cardData = new HpsGiftCard();
            $cardData->tokenValue = $giftCard->tokenValue;
        } else {
            $hpsBlock1->appendChild($xml->createElement('hps:GatewayTxnId', $giftCard));
        }

        $hpsGiftCard->appendChild($hpsBlock1);
        $hpsTransaction->appendChild($hpsGiftCard);

        return $this->_submitTransaction($hpsTransaction, $txnType);
    }
1302507
public function refund($amount = null)
    {
        $builder = new HpsCreditServiceRefundBuilder($this);
        return $builder
            ->withAmount($amount)
            ->withCurrency('usd');
    }
156834
public function get($number=null)
    {
      $url = URIResource::Make($this->path, array($number));
      $data = $this->client->get($url, array(), true, false);

      return Constructor::Make($this, $data);
    }
219566
public function getAmount($amount)
    {
        if (!is_float($amount) &&
            $this->getCurrencyDecimalPlaces() > 0 &&
            false === strpos((string) $amount, '.')) {
            throw new InvalidArgumentException(
                'Please specify amount as a string or float, '.
                'with decimal places (e.g. \'10.00\' to represent $10.00).'
            );
        }

        return $this->formatCurrency($amount);
    }
983215
public function format($money = null)
    {
        if (!$money) {
            return null;
        } else {
            return $this->numberFormatter->formatCurrency(
                $money->amount,
                $money->currency->code
            );
        }

    }
243108
public function additionalAuth($amount = null)
    {
        return (new AuthorizationBuilder(TransactionType::AUTH))
            ->withPaymentMethod($this->transactionReference)
            ->withAmount($amount);
    }
367397
public function creditCardPartial($amount)
    {
        $data = new stdClass();
        $data->amount = $amount;

        return $this->execute($data);
    }
1004333
public function offlineAuth($amount = null)
    {
        $builder = new HpsCreditServiceOfflineAuthBuilder($this);
        return $builder
            ->withAmount($amount)
            ->withCurrency('usd');
    }
1151945
public function setAmount($amount)
    {
        if ($amount === null) {
            $this->amount = 0;
            return $this;
        }
        
        if (!is_int($amount)) {
            throw new InvalidArgumentException(sprintf(
                'Amount must be an integer, "%s" given',
                is_object($amount) ? get_class($amount) : gettype($amount)
            ));
        }
        
        // Overflow check is not necessary because we have an integer
        $this->amount = $amount;
        return $this;
    }