/**
  * @see Init extension default
  */
 public function init()
 {
     StripeHelper::prepareBoolean($this->allowRemember);
     StripeHelper::prepareBoolean($this->validateZipCode);
     StripeHelper::prepareBoolean($this->collectBillingAddress);
     parent::init();
 }
Example #2
0
 /**
  * Will generate month and year input with 2 hidden inputs for month and year values.
  * @param array $options
  * @return string genetared input tag
  */
 public function monthAndYearInput($options = [])
 {
     $defaultOptions = ['id' => self::MONTH_YEAR_ID, 'class' => 'form-control', 'autocomplete' => self::AUTO_EXP_ATTR, 'placeholder' => '•• / ••', 'required' => true, 'type' => 'tel'];
     $mergedOptions = array_merge($defaultOptions, $options);
     StripeHelper::secCheck($mergedOptions);
     $mergedOptions['data-stripe'] = self::MONTH_YEAR_ID;
     $inputs = Html::input('text', null, null, $mergedOptions);
     //Append hidden year and month inputs that will get value from mixed and send to stripe
     $inputs = $inputs . $this->monthInput(['type' => 'hidden']);
     $inputs = $inputs . $this->yearInput(['type' => 'hidden']);
     return $inputs;
 }