@param CreditCard $card

@return CreditCard
432
public function tokenizeCard(CreditCard $card)
    {
        $tokenizeCardRequest = new TokenizeCardRequest($this->merchant, $this->environment);

        return $tokenizeCardRequest->execute($card);
    }
659141
public function qrcode($card)
    {
        if (!is_array($card)) {
            $this->setError('参数缺失');

            return false;
        }

        $this->apitype = 'card';
        $this->module  = 'qrcode';

        $res = $this->_post('create', $card);

        return $res;
    }
19222
public function get($cardId)
    {
        $params = array('card_id' => $cardId);

        $result = $this->http->jsonPost(self::API_GET, $params);

        return new Bag($result['card']);
    }
963385
public function addSavedCreditCard(\HarvestCloud\CoreBundle\Entity\Payment\SavedCreditCard $savedCreditCard)
    {
        $this->savedCreditCards[] = $savedCreditCard;

        $savedCreditCard->setProfile($this);

        return $this;
    }
154474
public function create($creditcard, $options = [])
     {
         if (isset($options['customer'])) {
             $params['card'] = $creditcard;

             return $this->gateway->commit('post', $this->gateway->buildUrlFromString('customers/'.$options['customer'].'/cards'), $params);
         } else {
             $params['email'] = Arr::get($options, 'email');
             $params['description'] = Arr::get($options, 'name');
             $params['card'] = $creditcard;

             return $this->gateway->commit('post', $this->gateway->buildUrlFromString('customers'), $params);
         }
     }
964951
public function getCard($cardID)
    {
        $tokenContext = new TokenContext("", 'get');
        $token = $this->accessTokenProvider->getToken($tokenContext);

        $responseModel = $this->cardClient->getCard($cardID, (string)$token);
        if ($responseModel instanceof ErrorResponseModel) {
            throw new CardClientException(
                "error response from card service", $responseModel->getCode(), $responseModel->getMessage()
            );
        }

        $card = $this->parseRawCard($responseModel->getRawSignedModel(), $responseModel->isOutdated());

        if (!$this->cardVerifier->verifyCard($card)) {
            throw new CardVerificationException('Validation errors have been detected');
        }

        return $card;
    }
1155300
public function getCard($id)
    {
        return $this->auth(function () use ($id) {
            $data = json_encode([
                'card_id' => $id,
            ]);

            return $this->http->postJson($this->baseUrl . 'card/get?access_token=' . $this->accessToken, $data);
        });
    }
540311
public static function deleteCard($card, Payplug\Payplug $payplug = null)
    {
        if ($payplug === null) {
            $payplug = Payplug\Payplug::getDefaultConfiguration();
        }

        if ($card instanceof Card) {
            $card = $card->id;
        }

        $httpClient = new Payplug\Core\HttpClient($payplug);
        $response = $httpClient->delete(Payplug\Core\APIRoutes::getRoute(Payplug\Core\APIRoutes::CARD_RESOURCE, $card));

        return $response;
    }
150736
public function card(String $number, String $month, String $year, String $cvc)
    {
        $this->settings['pan'] = $number;
        $this->settings['Ecom_Payment_Card_ExpDate_Year']  = $year;
        $this->settings['Ecom_Payment_Card_ExpDate_Month'] = $month;
        $this->settings['cv2'] = $cvc;

        return $this;
    }
1332543
public function authorize($money, CreditCard $creditcard, $options = array())
    {
        $this->required_options('address,order_id', $options);

        $this->post = array();

        $this->addInvoice($options);
        $this->addCreditcard($creditcard);
        $this->addAddress($options);
        $this->addCustomerData($options);
        $this->addOptionalData();

        $this->post['TotalAmount'] = $this->amount($money);

        return $this->commit('xmlauth', $money, $options);
    }
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;
    }
69249
private static function hash($card) {
    /* We are encoding the password list just because we want to make
     * the file look nice, and to avoid bugs with special characters. */
    $card['list'] = base64_encode(json_encode($card['list']));
    $card['hash'] = hash(self::HASH_TYPE, $card['list']);
    $card['id']   = substr($card['hash'], 0, 12);

    return $card;
  }
645885
public function deleteCard( CustomerVault\Card $card )
    {
        $card->setRequiredFields(array(
            'profileID',
            'id'
        ));
        $card->checkRequiredFields();

        $request = new Request(array(
            'method' => Request::DELETE,
            'uri' => $this->prepareURI("/profiles/" . $card->profileID . "/cards/" . $card->id),
        ));
        $this->client->processRequest($request);

        return true;
    }
755812
public function format(Card $card)
    {
        $tags = [];
        
        $name = $card->getName();
        $fullName = $card->getFullName();
        if ($name !== null) {
            $tags[] = '<dt>Name</dt><dd><span class="p-name">' . $this->nameFormatter->format($name) . '</span></dd>';
        } elseif (strlen($fullName) > 0) {
            $tags[] = '<dt>Name</dt><dd><span class="p-name">' . htmlspecialchars($fullName) . '</span></dd>';
        }
        
        $photo = $card->getPhoto();
        if ($photo !== null) {
            $tags[] = '<dt>Photo</dt><dd><img class="u-photo" src="' . htmlspecialchars($photo) . '" alt="Photo" /></dd></span>';
        }
        $logo = $card->getLogo();
        if ($logo !== null) {
            $tags[] = '<dt>Logo</dt><dd><img class="u-logo" src="' . htmlspecialchars($logo) . '" alt="Logo" /></dd></span>';
        }
        
        $address = $card->getAddress();
        if ($address !== null) {
            $tags[] = '<dt>Address</dt><dd class="p-adr">' . $this->addressFormatter->format($address) . '</dd>';
        }
        
        $tel = $card->getTel();
        if (strlen($tel) > 0) {
            $tags[] = '<dt>Phone</dt><dd><a href="tel:' . preg_replace('/[^0-9\+]/', '', $tel) . '" class="p-tel">' . htmlspecialchars($tel) .  '</a></dd>';
        }
        
        $email = $card->getEmail();
        if (strlen($email) > 0) {
            $tags[] = '<dt>Email</dt><dd><a href="mailto:' . htmlspecialchars($email) . '" class="u-email">' . htmlspecialchars($email) . '</a></dd>';
        }

        $url = $card->getUrl();
        if (strlen($url) > 0) {
            $tags[] = '<dt>Homepage</dt><dd><a href="' . htmlspecialchars($url) . '" class="u-url>' . htmlspecialchars($url) . '</a></dd>';
        }
        
        $impp = $card->getImpp();
        if (strlen($impp) > 0) {
            $tags[] = '<dt>IMPP</dt><dd><a href="' . htmlspecialchars($impp) . '" class="u-impp">' . htmlspecialchars($impp) . '</a></dd>';
        }
        
        $org = $card->getOrg();
        $orgName = $card->getOrgName();
        if ($org !== null) {
            $tags[] = '<dt>Organization</dt><dd class="p-org">' . $this->format($org) . '</dd>';
        } elseif (strlen($orgName) > 0) {
            $tags[] = '<dt>Organization</dt><dd><span class="p-org p-organization-name">' . htmlspecialchars($orgName) . '</span></dd>';
        }
        
        $title = $card->getTitle();
        if (strlen($title) > 0) {
            $tags[] = '<dt>Title</dt><dd><span class="p-job-title">' . htmlspecialchars($title) . '</span></dd>';
        }
        
        $role = $card->getRole();
        if (strlen($role) > 0) {
            $tags[] = '<dt>Role</dt><dd><span class="p-role">' . htmlspecialchars($role) . '</span></dd>';
        }
        
        $sex = $card->getSex();
        if (strlen($sex) > 0) {
            $tags[] = '<dt>Sex</dt><dd><span class="p-sex">' . htmlspecialchars($role) . '</span></dd>';
        }
        
        $gender = $card->getGender();
        if (strlen($gender) > 0) {
            $tags[] = '<dt>Gender</dt><dd><span class="p-gender">' . htmlspecialchars($gender) . '</span></dd>';
        }
        
        $birthday = $card->getBirthday();
        if ($birthday !== null) {
            $tags[] = '<dt>Birthday</dt><dd><time class="dt-bday" datetime="' . $birthday->format('Y-m-d') . '">' . $birthday->format('F j, Y') . '</time></dd>';
        }
        
        $anniversary = $card->getAnniversary();
        if ($anniversary !== null) {
            $tags[] = '<dt>Anniversary</dt><dd><time class="dt-anniversary" datetime="' . $anniversary->format('Y-m-d') . '">' . $anniversary->format('F j, Y') . '</time></dd>';
        }
        
        $key = $card->getKey();
        if (strlen($key) > 0) {
            $tags[] = '<dt>Public Key</dt><dd><span class="u-key">' . htmlspecialchars($key) . '</span></dd>';
        }

        $category = $card->getCategory();
        if (strlen($category) > 0) {
            $tags[] = '<dt>Category</dt><dd><span class="p-category">' . htmlspecialchars($category) . '</span></dd>';
        }
        
        $note = $card->getNote();
        if (strlen($note) > 0) {
            $tags[] = '<dt>Note</dt><dd><div class="p-note">' . htmlspecialchars($note) . '</div></dd>';
        }

        return '<dl class="h-card">' . implode(' ', $tags) . '</dl>';
    }
1004753
protected function card(array $array)
    {
        $card = new Card();
        if ($array) {
            foreach ($array as $k => $v) {
                if (array_key_exists($k, $card) && (strlen($v))) {
                    $card->$k = $v;
                }
            }
        }
        $card->paymentData = null;
        if (isset($array['paymentData'])) {
            $card->paymentData = $this->paymentData($array['paymentData']);
        }
        return new \SoapVar($card, SOAP_ENC_OBJECT, self::SOAP_CARD, self::PAYLINE_NAMESPACE);
    }
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;
    }
1186776
public function create($creditcard, $options = [])
    {
        $params = [];

        $params['transaction'] = 'fail';

        if ($creditcard === 'success') {
            $params['transaction'] = 'success';
        }

        return $this->gateway->commit('post', 'create', $params);
    }