diff --git a/CHANGE.md b/CHANGE.md index 4de6592..9c1622b 100644 --- a/CHANGE.md +++ b/CHANGE.md @@ -1,3 +1,10 @@ +version 1.0.3 +============= +**Date:** 23-Mar-2016 + +1. Added classes CreditCardCVCode, CreditCardExpiry, and CreditCardNumber. These extend from \kartik\base\InputWidget and + are used as per README documentation. + version 1.0.2 ============= **Date:** 29-Aug-2015 diff --git a/CreditCard.php b/CreditCard.php deleted file mode 100644 index 0460883..0000000 --- a/CreditCard.php +++ /dev/null @@ -1,168 +0,0 @@ - - */ -class CreditCard extends Widget -{ - /** @var ActiveForm the bootstrap/ActiveForm object */ - public $form; - - /** @var string Credit card number attribute name */ - public $numberAttribute = 'creditCard_number'; - - /** @var string Credit card expiry attribute name */ - public $expiryAttribute = 'creditCard_expirationDate'; - - /** @var string Credit card cvc/cvv/ccv attribute name */ - public $cvcAttribute = 'creditCard_cvv'; - - private $model; - - public function init() - { - parent::init(); - $this->model = new CreditCardModel([ - 'numberAttribute' => $this->numberAttribute, - 'expiryAttribute' => $this->expiryAttribute, - 'cvcAttribute' => $this->cvcAttribute, - ]); - $this->checkConfig(); - $this->registerTranslations(); - CreditCardAsset::register($this->view); - } - - public function registerTranslations() - { - Yii::setAlias("@creditcard", __DIR__); - Yii::$app->i18n->translations['creditcard'] = [ - 'class' => 'yii\i18n\PhpMessageSource', - 'sourceLanguage' => 'en-US', - 'basePath' => '@creditcard/messages', - ]; - } - - /** - * Generate credit card number form field - * @param array $fieldConfig any special config and overriding config for the form field - * @return $this form field html - */ - public function number($fieldConfig = []) - { - // default field configuration - $fieldConfig = ArrayHelper::merge([ - 'inputTemplate' => '