Adds a CreditCard object

@param CreditCard $creditcard
354769
private function addCreditcard(CreditCard $creditcard, $options, $action)
    {
        $xml = $this->xml;
        $year  = $this->cc_format($creditcard->year, 'two_digits');
        $month = $this->cc_format($creditcard->month, 'two_digits');

        $xml->PaymentInfo(null, $action)
            ->PayMethod(
                $this->CARD_MAPPINGS[CreditCard::type($creditcard->number)],
                'PaymentInfo'
            )
            ->CardPan($creditcard->number, 'PaymentInfo')
            ->CardExpDate("{$year}{$month}", 'PaymentInfo')
            ->CardCvv2($creditcard->verification_value, 'PaymentInfo')
            ->CardHolderName(trim($creditcard->name()), 'PaymentInfo');

        if ($options['installments']) {
            $xml->InstallmentParameters(null, 'PaymentInfo')
                ->ExtInstallmentoffset(0, 'InstallmentParameters')
                ->ExtInstallmentperiod($options['installments'], 'InstallmentParameters');
        }
    }
1014089
public function setCreditCard($params = null)
    {

        if ($params instanceof PagSeguroCreditCardCheckout) {
            $this->creditCard = $params;
        } elseif (isset($params) && is_array($params)) {
            $this->creditCard = new PagSeguroCreditCardCheckout();
            if (isset($params['token'])) {
                $this->creditCard->setToken($params['token']);
            }
            if (isset($params['installment']) && $params['installment'] instanceof PagSeguroInstallment) {
                $this->creditCard->setInstallment($params['installment']);
            }
            if (isset($params['holder']) && $params['holder'] instanceof PagSeguroCreditCardHolder) {
                $this->creditCard->setHolder($params['holder']);
            }
            if (isset($params['billing']) && $params['billing'] instanceof PagSeguroBilling) {
                $this->creditCard->setBilling($params['billing']);
            }
        }
    }
504111
public function removeSavedCreditCard(\HarvestCloud\CoreBundle\Entity\Payment\SavedCreditCard $savedCreditCard)
    {
        $this->savedCreditCards->removeElement($savedCreditCard);
    }
338840
public function populateCard($card, CreditCardPaymentForm $paymentForm)
    {
        if (!$card instanceof CreditCard) {
            return;
        }

        $card->setFirstName($paymentForm->firstName);
        $card->setLastName($paymentForm->lastName);
        $card->setNumber($paymentForm->number);
        $card->setExpiryMonth($paymentForm->month);
        $card->setExpiryYear($paymentForm->year);
        $card->setCvv($paymentForm->cvv);
    }
166182
public function addCredits($customerId, $amount)
    {
        $requestData = new AddCredits\RequestData($customerId, $amount);
        $request = new AddCredits\Request($requestData);

        return $this->sendRequest($request, AddCredits\ApiResponse::class);
    }
144589
public function create(array $card, $customerId = null) {
        $expiryMonth    = str_pad($card['expiryMonth'], 2, '0', STR_PAD_LEFT);
        $expiryYear     = $card['expiryYear'];
        $expiresAt      = $this->getExpirationDate($expiryMonth, $expiryYear);
        $ccType         = $this->ccTypeAdapter->getFromGateway($card['paymentMethod']);

        /** @var PaymentTokenInterface $paymentToken */
        $paymentToken = $this->creditCardTokenFactory->create();
        $paymentToken->setExpiresAt($expiresAt);

        if( array_key_exists('id', $card) ) {
            $paymentToken->setGatewayToken($card['id']);
        }

        $tokenDetails = [
            'type'              => $ccType,
            'maskedCC'          => $card['last4'],
            'expirationDate'    => $expiryMonth . '/' . $expiryYear,
        ];

        $paymentToken->setTokenDetails($this->convertDetailsToJSON($tokenDetails));
        $paymentToken->setIsActive(true);
        $paymentToken->setPaymentMethodCode(ConfigProvider::CODE);

        if($customerId) {
            $paymentToken->setCustomerId($customerId);
        }

        $paymentToken->setPublicHash($this->generatePublicHash($paymentToken));

        return $paymentToken;
    }
518497
private function createCreditCardForm()
    {
        $class = new CreditCardForm($this->get('validator'));
        $type = new CreditCardType(array());
        
        $form = $this->createForm($type, $class, array(
            'action' => $this->generateUrl('ecommerce_checkout_summary'),
            'method' => 'POST',
            'attr' => array('id' => 'payment-cc', 'class' => 'cc-form')
        ));
        $form->add('submit', 'submit', array('label' => 'Pagar'));
        
        return $form;
    }
929865
private function addCreditcard(CreditCard $creditcard, $complete = true)
    {
        $card = array(
            'number' => $creditcard->number,
            'name' => $creditcard->name(),
            'expiry_month' => $this->cc_format($creditcard->month, 'two_digits'),
            'expiry_year' => $this->cc_format($creditcard->year, 'two_digits'),
            'cvd' => $creditcard->verification_value,
            'complete' => $complete,
        );

        $this->post['card'] = $card;
    }
1357761
public function recurring($money, CreditCard $creditcard, $options = array())
    {
        $options = new Options($options);

        Options::required(
            'frequency, period, start_date, billing_address',
            $options
        );

        Options::required(
            'first_name, last_name',
            $options['billing_address']
        );

        if (null == $options->occurrences) {
            $options->occurrences = '9999';
        }

        if (null == $options->trial_occurrences) {
            $options->trial_occurrences = 0;
        }

        $amount = $this->amount($money);

        $ref_id = $options['order_id'];

        $this->xml = "<refId>$ref_id</refId>";
        $this->xml .= "<subscription>";
        $this->arbAddSubscription($amount, $options);
        $this->arbAddCreditcard($creditcard);
        $this->arbAddAddress($options['billing_address']);
        $this->xml .= "</subscription>";

        return $this->recurringCommit('create');
    }
926334
public function initialize()
    {
        parent::initialize();

        $this->data->installmentCount = 1;
        $this->data->fundingInstrument = new stdClass();
        $this->data->fundingInstrument->method = self::METHOD_CREDIT_CARD;
    }
236587
private function addCreditcard(CreditCard $creditcard)
    {

        $post['card_holder'] = $creditcard->name();
        $post['card_number'] = $creditcard->number;
        $post['card_expiry'] = $this->cc_format($creditcard->month, 'two_digits')
            . "/"
            . $this->cc_format($creditcard->year, 'four_digits');
        $post['cvv'] = $creditcard->verification_value;

        $this->post = array_merge($this->post, $post);
    }
113052
public function setCreditcardType($creditcardType)
    {
        if (!in_array($creditcardType, $this->creditcardTypes)) {
            throw new InvalidArgumentException('Invalid credit card type. Allowed types: ' . implode(', ', $this->creditcardTypes));
        }

        return $this->setData(self::CREDITCARD_TYPE, $creditcardType);
    }
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;
    }
568979
public function tokenizeCreditCard(CieloCreditCard $cieloCreditCard, CieloCustomer $cieloCustomer)
    {
        try {
            $sale = new Sale();
            $sale->CustomerName   = $cieloCustomer->getName();
            $sale->CardNumber     = $cieloCreditCard->getCardNumber();
            $sale->Holder         = $cieloCreditCard->getHolder();
            $sale->ExpirationDate = $cieloCreditCard->getExpirationDate();
            $sale->Brand          = $cieloCreditCard->getBrand();

            $token = (new TokenizeCardRequest($this->merchant, $this->environment))->execute($sale);

            $paymentData = $token;
            $paymentStatus = 1;
            $paymentMessage = 'Operation Successful';
        } catch (CieloRequestException $e) {
            $error = $e->getCieloError();
            throw new ResourceErrorException($error->getMessage(), $error->getCode());
        }

        return new ResourceResponse($paymentStatus, $paymentMessage, $paymentData);
    }
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;
        }
    }
257386
public function store(CreditCard $creditcard, $options = array())
    {
        $this->required_options('order_id', $options);
        $this->buildNewCardRequest($creditcard, $options);
        return $this->commit('recurring');
    }
1351669
public function setCreditCard(CreditCard $creditCard)
    {
        $creditCard->setContext(Moip::PAYMENT);
        $this->data->fundingInstrument->method = self::METHOD_CREDIT_CARD;
        $this->data->fundingInstrument->creditCard = $creditCard->getData();
        //$this->setCreditCardHolder($holder);

        return $this;
    }