Answer the question
In order to leave comments, you need to log in
How to connect Stripe to Yii2?
Tell me how to tie https://github.com/ruskid/yii2-stripe to Yii2 so that all form data and stripe data are on the same page and can be validated.
<?php
$form = ActiveForm::begin([]);
?>
<div class="sectionBlock">
<h2 class="form-section-title bordered">Basic Information</h2>
<div class="formRow flex wrap">
<div class="formBlock col-xs-12 col-md-6">
<?= $form->field($model, 'university_id')->dropDownList(common\models\University::getUniversityList()) ?>
</div>
<?=
StripeCheckoutCustom::widget([
'action' => '/',
'name' => 'Demo test',
'description' => '2 widgets ($20.00)',
'amount' => 2000,
'image' => '/128x128.png',
'buttonOptions' => [
'class' => 'btn btn-lg btn-success',
],
'tokenFunction' => new JsExpression('function(token) {
alert("Here you should control your token.");
}'),
'openedFunction' => new JsExpression('function() {
alert("Model opened");
}'),
'closedFunction' => new JsExpression('function() {
alert("Model closed");
}'),
]);
?>
<?php ActiveForm::end(); ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question