Browse Source

Stripe : mode test

dev
Guillaume 3 years ago
parent
commit
8f9573e47c
4 changed files with 49 additions and 2 deletions
  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 View File

], []); ?> ], []); ?>


<?= $form->field($model, 'option_stripe_public_key')->textInput(); ?> <?= $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_private_key')->textInput(); ?>
<?= $form->field($model, 'option_stripe_endpoint_secret')->textInput(); ?> <?= $form->field($model, 'option_stripe_endpoint_secret')->textInput(); ?>
</div> </div>

+ 3
- 1
common/models/Producer.php View File

'option_export_display_product_reference', 'option_export_display_product_reference',
'option_allow_order_guest', 'option_allow_order_guest',
'option_delivery', 'option_delivery',
'option_display_export_grid'
'option_display_export_grid',
'option_stripe_mode_test'
], ],
'boolean' 'boolean'
], ],
'type' => 'Type de producteur', 'type' => 'Type de producteur',
'credit_limit_reminder' => 'Seuil de crédit limite avant relance', 'credit_limit_reminder' => 'Seuil de crédit limite avant relance',
'online_payment' => 'Activer le paiement en ligne (Stripe)', 'online_payment' => 'Activer le paiement en ligne (Stripe)',
'option_stripe_mode_test' => 'Mode test',
'option_stripe_public_key' => 'Clé publique', 'option_stripe_public_key' => 'Clé publique',
'option_stripe_private_key' => 'Clé secrète', 'option_stripe_private_key' => 'Clé secrète',
'option_stripe_endpoint_secret' => 'Clé secrète (endpoint)', 'option_stripe_endpoint_secret' => 'Clé secrète (endpoint)',

+ 41
- 0
console/migrations/m210915_083421_add_option_stripe_mode_test.php View File

<?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 View File

{ {
$producer = $this->getProducer(); $producer = $this->getProducer();


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


$creditForm = new CreditForm; $creditForm = new CreditForm;



Loading…
Cancel
Save