], []); ?> | ], []); ?> | ||||
<?= $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> |
'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)', |
<?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; | |||||
} | |||||
*/ | |||||
} |
{ | { | ||||
$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; | ||||