Преглед на файлове

Stripe : mode test

refactoring
Guillaume преди 3 години
родител
ревизия
8f9573e47c
променени са 4 файла, в които са добавени 49 реда и са изтрити 2 реда
  1. +4
    -0
      backend/views/producer/update.php
  2. +3
    -1
      common/models/Producer.php
  3. +41
    -0
      console/migrations/m210915_083421_add_option_stripe_mode_test.php
  4. +1
    -1
      producer/controllers/CreditController.php

+ 4
- 0
backend/views/producer/update.php Целия файл

@@ -370,6 +370,10 @@ $this->addBreadcrumb($this->getTitle()) ;
], []); ?>

<?= $form->field($model, 'option_stripe_public_key')->textInput(); ?>
<?= $form->field($model, 'option_stripe_mode_test')->dropDownList([
0 => 'Non',
1 => 'Oui'
], []); ?>
<?= $form->field($model, 'option_stripe_private_key')->textInput(); ?>
<?= $form->field($model, 'option_stripe_endpoint_secret')->textInput(); ?>
</div>

+ 3
- 1
common/models/Producer.php Целия файл

@@ -228,7 +228,8 @@ class Producer extends ActiveRecordCommon
'option_export_display_product_reference',
'option_allow_order_guest',
'option_delivery',
'option_display_export_grid'
'option_display_export_grid',
'option_stripe_mode_test'
],
'boolean'
],
@@ -308,6 +309,7 @@ class Producer extends ActiveRecordCommon
'type' => 'Type de producteur',
'credit_limit_reminder' => 'Seuil de crédit limite avant relance',
'online_payment' => 'Activer le paiement en ligne (Stripe)',
'option_stripe_mode_test' => 'Mode test',
'option_stripe_public_key' => 'Clé publique',
'option_stripe_private_key' => 'Clé secrète',
'option_stripe_endpoint_secret' => 'Clé secrète (endpoint)',

+ 41
- 0
console/migrations/m210915_083421_add_option_stripe_mode_test.php Целия файл

@@ -0,0 +1,41 @@
<?php

use yii\db\Migration;
use yii\db\Schema;

/**
* Class m210915_083421_add_option_stripe_mode_test
*/
class m210915_083421_add_option_stripe_mode_test extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('producer', 'option_stripe_mode_test', Schema::TYPE_BOOLEAN.' DEFAULT 1');
}

/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropColumn('producer', 'option_stripe_mode_test');
}

/*
// Use up()/down() to run migration code without a transaction.
public function up()
{

}

public function down()
{
echo "m210915_083421_add_option_stripe_mode_test cannot be reverted.\n";

return false;
}
*/
}

+ 1
- 1
producer/controllers/CreditController.php Целия файл

@@ -117,7 +117,7 @@ class CreditController extends ProducerBaseController
{
$producer = $this->getProducer();

if ($producer->online_payment) {
if ($producer->online_payment || $producer->option_stripe_mode_test) {

$creditForm = new CreditForm;


Loading…
Отказ
Запис