PHPackages                             andrewblake1/yii2-credit-card - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. andrewblake1/yii2-credit-card

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

andrewblake1/yii2-credit-card
=============================

Yii2 credit card widget with client validation

v1.1.1(9y ago)434.7k↓50%4[3 issues](https://github.com/andrewblake1/yii2-credit-card/issues)MITPHP

Since Aug 27Pushed 9y ago3 watchersCompare

[ Source](https://github.com/andrewblake1/yii2-credit-card)[ Packagist](https://packagist.org/packages/andrewblake1/yii2-credit-card)[ Docs](https://github.com/andrewblake1/yii2-credit-card)[ RSS](/packages/andrewblake1-yii2-credit-card/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (7)Used By (0)

yii2-credit-card
================

[](#yii2-credit-card)

[![Latest Stable Version](https://camo.githubusercontent.com/3c3f4713405b3c484209b9eb8411a87edc34b8d7275bd109931e0b4c30c533a2/68747470733a2f2f706f7365722e707567782e6f72672f616e64726577626c616b65312f796969322d6372656469742d636172642f762f737461626c65)](https://packagist.org/packages/andrewblake1/yii2-credit-card)[![License](https://camo.githubusercontent.com/d83cb20a6116b85751f2fa8c11be6dc0d4dc1dead80f5f80436cd8d4c7e314a4/68747470733a2f2f706f7365722e707567782e6f72672f616e64726577626c616b65312f796969322d6372656469742d636172642f6c6963656e7365)](https://packagist.org/packages/andrewblake1/yii2-credit-card)

Yii2 Bootstrap 3 components, providing client validated and masked credit card number, expiry and cvc fields with credit card icon changing to match credit card type when detectable.

Uses client validation courtesy of Stripe () and works with validation in ActiveForm.

For PCI compliance, there is the ability to prevent submit of these fields via the `submit` property by excluding the name attribute from the rendered input element.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/). Check the [composer.json](https://github.com/andrewblake1/yii2-credit-card/blob/master/composer.json) for this extension's requirements and dependencies. Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json.

To install

```
$ php composer.phar require andrewblake1/yii2-credit-card "@dev"

```

or add

```
"andrewblake1/yii2-credit-card": "@dev"

```

to the `require` section of your `composer.json` file.

Latest Release
--------------

[](#latest-release)

> NOTE: The latest version of the module is v1.1.0. Refer the [CHANGE LOG](https://github.com/andrewblake1/yii2-credit-card/blob/master/CHANGE.md) for details.

Usage in view
-------------

[](#usage-in-view)

Note that the input names here have been chosen to fit work with the tuyakhov\\braintree extension

```
