@@ -245,16 +245,16 @@ public function registerJqueryPaymentScripts() {
245
245
* @return string genetared input tag
246
246
*/
247
247
public function numberInput ($ options = []) {
248
- $ mergedOptions = array_merge ( $ options , [
249
- 'id ' => self ::NUMBER_ID ,
250
- 'class ' => 'form-control ' ,
251
- 'autocomplete ' => self ::AUTO_CC_ATTR ,
252
- 'placeholder ' => '•••• •••• •••• •••• ' ,
253
- 'required ' => true ,
254
- 'type ' => 'tel ' ,
255
- 'size ' => 20
256
- ]) ;
257
-
248
+ $ defaultOptions = [
249
+ 'id ' => self ::NUMBER_ID ,
250
+ 'class ' => 'form-control ' ,
251
+ 'autocomplete ' => self ::AUTO_CC_ATTR ,
252
+ 'placeholder ' => '•••• •••• •••• •••• ' ,
253
+ 'required ' => true ,
254
+ 'type ' => 'tel ' ,
255
+ 'size ' => 20
256
+ ] ;
257
+ $ mergedOptions = array_merge ( $ defaultOptions , $ options );
258
258
StripeHelper::secCheck ($ mergedOptions );
259
259
$ mergedOptions ['data-stripe ' ] = self ::NUMBER_ID ;
260
260
return Html::input ('text ' , null , null , $ mergedOptions );
@@ -266,15 +266,16 @@ public function numberInput($options = []) {
266
266
* @return string genetared input tag
267
267
*/
268
268
public function cvcInput ($ options = []) {
269
- $ mergedOptions = array_merge ($ options , [
270
- 'id ' => self ::CVC_ID ,
271
- 'class ' => 'form-control ' ,
272
- 'autocomplete ' => 'off ' ,
273
- 'placeholder ' => '••• ' ,
274
- 'required ' => true ,
275
- 'type ' => 'tel ' ,
276
- 'size ' => 4
277
- ]);
269
+ $ defaultOptions = [
270
+ 'id ' => self ::CVC_ID ,
271
+ 'class ' => 'form-control ' ,
272
+ 'autocomplete ' => 'off ' ,
273
+ 'placeholder ' => '••• ' ,
274
+ 'required ' => true ,
275
+ 'type ' => 'tel ' ,
276
+ 'size ' => 4
277
+ ];
278
+ $ mergedOptions = array_merge ($ defaultOptions , $ options );
278
279
StripeHelper::secCheck ($ mergedOptions );
279
280
$ mergedOptions ['data-stripe ' ] = self ::CVC_ID ;
280
281
return Html::input ('text ' , null , null , $ mergedOptions );
@@ -286,16 +287,17 @@ public function cvcInput($options = []) {
286
287
* @return string genetared input tag
287
288
*/
288
289
public function yearInput ($ options = []) {
289
- $ mergedOptions = array_merge ($ options , [
290
- 'id ' => self ::YEAR_ID ,
291
- 'class ' => 'form-control ' ,
292
- 'autocomplete ' => self ::AUTO_YEAR_ATTR ,
293
- 'placeholder ' => '•••• ' ,
294
- 'required ' => true ,
295
- 'type ' => 'tel ' ,
296
- 'maxlength ' => 4 ,
297
- 'size ' => 4
298
- ]);
290
+ $ defaultOptions = [
291
+ 'id ' => self ::YEAR_ID ,
292
+ 'class ' => 'form-control ' ,
293
+ 'autocomplete ' => self ::AUTO_YEAR_ATTR ,
294
+ 'placeholder ' => '•••• ' ,
295
+ 'required ' => true ,
296
+ 'type ' => 'tel ' ,
297
+ 'maxlength ' => 4 ,
298
+ 'size ' => 4
299
+ ];
300
+ $ mergedOptions = array_merge ($ defaultOptions , $ options );
299
301
StripeHelper::secCheck ($ mergedOptions );
300
302
$ mergedOptions ['data-stripe ' ] = self ::YEAR_ID ;
301
303
return Html::input ('text ' , null , null , $ mergedOptions );
@@ -307,17 +309,17 @@ public function yearInput($options = []) {
307
309
* @return string genetared input tag
308
310
*/
309
311
public function monthInput ($ options = []) {
310
- $ mergedOptions = array_merge ( $ options , [
311
- 'id ' => self ::MONTH_ID ,
312
- 'class ' => 'form-control ' ,
313
- 'autocomplete ' => self ::AUTO_MONTH_ATTR ,
314
- 'placeholder ' => '•• ' ,
315
- 'required ' => true ,
316
- 'type ' => 'tel ' ,
317
- 'maxlength ' => 2 ,
318
- 'size ' => 2
319
- ]) ;
320
-
312
+ $ defaultOptions = [
313
+ 'id ' => self ::MONTH_ID ,
314
+ 'class ' => 'form-control ' ,
315
+ 'autocomplete ' => self ::AUTO_MONTH_ATTR ,
316
+ 'placeholder ' => '•• ' ,
317
+ 'required ' => true ,
318
+ 'type ' => 'tel ' ,
319
+ 'maxlength ' => 2 ,
320
+ 'size ' => 2
321
+ ] ;
322
+ $ mergedOptions = array_merge ( $ defaultOptions , $ options );
321
323
StripeHelper::secCheck ($ mergedOptions );
322
324
$ mergedOptions ['data-stripe ' ] = self ::MONTH_ID ;
323
325
return Html::input ('text ' , null , null , $ mergedOptions );
@@ -329,15 +331,15 @@ public function monthInput($options = []) {
329
331
* @return string genetared input tag
330
332
*/
331
333
public function monthAndYearInput ($ options = []) {
332
- $ mergedOptions = array_merge ( $ options , [
333
- 'id ' => self ::MONTH_YEAR_ID ,
334
- 'class ' => 'form-control ' ,
335
- 'autocomplete ' => self ::AUTO_EXP_ATTR ,
336
- 'placeholder ' => '•• / •• ' ,
337
- 'required ' => true ,
338
- 'type ' => 'tel ' ,
339
- ]) ;
340
-
334
+ $ defaultOptions = [
335
+ 'id ' => self ::MONTH_YEAR_ID ,
336
+ 'class ' => 'form-control ' ,
337
+ 'autocomplete ' => self ::AUTO_EXP_ATTR ,
338
+ 'placeholder ' => '•• / •• ' ,
339
+ 'required ' => true ,
340
+ 'type ' => 'tel ' ,
341
+ ] ;
342
+ $ mergedOptions = array_merge ( $ defaultOptions , $ options );
341
343
StripeHelper::secCheck ($ mergedOptions );
342
344
$ mergedOptions ['data-stripe ' ] = self ::MONTH_YEAR_ID ;
343
345
$ inputs = Html::input ('text ' , null , null , $ mergedOptions );
0 commit comments