andrewblake1/yii2-credit-card
最新稳定版本:v1.1.1
Composer 安装命令:
composer require andrewblake1/yii2-credit-card
包简介
Yii2 credit card widget with client validation
README 文档
README
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 (https://github.com/stripe/jquery.payment) 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
The preferred way to install this extension is through composer. Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki 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
NOTE: The latest version of the module is v1.1.0. Refer the CHANGE LOG for details.
Usage in view
Note that the input names here have been chosen to fit work with the tuyakhov\braintree extension
<?php use yii\bootstrap\ActiveForm; use andrewblake1\creditcard\CreditCardNumber; use andrewblake1\creditcard\CreditCardExpiry; use andrewblake1\creditcard\CreditCardCVCode; ?> <?php $form = ActiveForm::begin() ?> <div class="container"> <div id="card" class="row"> <div class="col-xs-7"> <?= $form->field($bookingForm, 'creditCard_number')->widget(CreditCardNumber::className(), ['submit' => false,]) ?> </div> <div class="col-xs-3"> <?= $form->field($bookingForm, 'creditCard_expirationDate')->widget(CreditCardExpiry::className(), ['submit' => false,]) ?> </div> <div class="col-xs-2"> <?= $form->field($bookingForm, 'creditCard_cvv')->widget(CreditCardCVCode::className(), ['submit' => false,]) ?> </div> </div> </div> <?php ActiveForm::end() ?>
License
yii2-credit-card is released under the MIT License. See the bundled LICENSE.md for details.
统计信息
- 总下载量: 34.07k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-27