Пример #1
0
$module = Yii::$app->getModule('account');
echo $this->render('@wartron/yii2account/views/_alert', ['module' => $module]);
?>

<div class="row">
    <div class="col-md-3">
        <?php 
echo $this->render('@wartron/yii2account/views/settings/_menu', ['module' => $module]);
?>
    </div>
    <div class="col-md-9">
        <div class="panel panel-default">
            <div class="panel-heading">New Card</div>
            <div class="panel-body">
                <?php 
$form = StripeForm::begin(['tokenInputName' => 'stripe_token', 'errorContainerId' => 'stripe-errors', 'brandContainerId' => 'cc-brand', 'errorClass' => 'has-error', 'applyJqueryPaymentFormat' => true, 'applyJqueryPaymentValidation' => true, 'options' => ['autocomplete' => 'on']]);
?>
                <div id="stripe-errors"></div>

                <div class="form-group">
                     <label for="name" class="control-label">Full Name</label>
                     <input id="name" name="full_name" class="form-control" required>
                </div>

                 <div class="form-group">
                     <label for="number" class="control-label">Card number</label>
                     <span id="cc-brand"></span>
                     <?php 
echo $form->numberInput();
?>
                 </div>
Пример #2
0
<?php

use yii\helpers\Html;
use yii\helpers\Url;
use ruskid\stripe\StripeForm;
/* @var $this yii\web\View */
/* @var $form yii\widgets\ActiveForm */
/* @var $model frontend\models\client\PaymentForm */
?>

<?php 
$form = StripeForm::begin(['id' => 'payment-form', 'method' => 'POST', 'action' => Url::toRoute(['credit/payment']), 'enableAjaxValidation' => false, 'enableClientValidation' => false, 'tokenInputName' => 'stripeToken', 'errorContainerId' => 'payment-errors', 'errorClass' => 'has-error', 'applyJqueryPaymentFormat' => true, 'applyJqueryPaymentValidation' => true, 'options' => ['novalidate' => '', 'autocomplete' => 'on']]);
?>

<?php 
echo $form->field($model, 'packId', ['template' => '{label}<div class="row-input custom-dropdown">{input}</div>{hint}{error}'])->dropDownList($model->getPacks(), ['prompt' => \Yii::t('app', '--- Elige un pack ---')])->label(Yii::t('app', 'Añadir creditos'));
?>

<div id="credit-card-container">
    <div class="form-group field-paymentform-number">
        <div class="row-input left-icon">
            <?php 
echo $form->numberInput(['id' => StripeForm::NUMBER_ID, 'class' => 'form-control', 'autocomplete' => StripeForm::AUTO_CC_ATTR, 'placeholder' => \Yii::t('app', 'Numero de tarjeta'), 'required' => true, 'type' => 'tel', 'size' => 20]);
?>
            <i class="fa fa-credit-card"></i>
        </div>
    </div>

    <div class="form-group field-paymentform-date">
        <div class="row-input left-icon">
            <?php