context->getProducer(); $this->setTitle('Crédit : ' . number_format($creditUser, 2) . ' €'); $this->setPageTitle('Crédit'); if ($this->context->getProducer()->online_payment) { $this->addButton( [ 'label' => ' Créditer mon compte', 'url' => 'credit/add', 'class' => 'btn btn-primary' ] ); } ?>
'/', 'action' => Yii::$app->urlManagerProducer->createUrl(['credit/stripe-charge']), 'label' => 'Alimenter 20 €', 'panelLabel' => 'Payer', 'currency' => 'EUR', 'name' => $producer->name, 'description' => '20 €', 'amount' => 2000, //'image' => Yii::$app->urlManagerProducer->getBaseUrl() .'/img/logo-distrib.png', //'image' => Yii::$app->urlManager->baseUrl .'/uploads/'.$producer->logo, 'image' => null, 'userEmail' => Yii::$app->user->identity->email, 'tokenFunction' => new JsExpression( 'function(token) { console.log(token); $.post(opendistrib_base_url(true)+"credit/stripe-charge", { amount: 20, token_id: token.id }, function(data) { window.location.href = opendistrib_base_url(true)+"credit/history?returnPayment=success" ; }); }' ), ]); ?>
$searchModel, 'dataProvider' => $dataProvider, 'columns' => [ [ 'attribute' => 'date', 'value' => function ($model) { return $model->getDate(true); } ], [ 'attribute' => 'id_user_action', 'value' => function ($model) { return $model->strUserAction(); } ], [ 'label' => 'Type', 'format' => 'raw', 'value' => function ($model) { return $model->getStrWording(); } ], [ 'attribute' => 'mean_payment', 'value' => function ($model) { return $model->getStrMeanPayment(); } ], [ 'label' => '- Débit', 'format' => 'raw', 'value' => function ($model) { if ($model->isTypeDebit()) { return '- ' . $model->getAmount(true); } return ''; } ], [ 'label' => '+ Crédit', 'format' => 'raw', 'value' => function ($model) { if ($model->isTypeCredit()) { return '+ ' . $model->getAmount(true); } return ''; } ], ], ]); ?>