Commit 022973c0 by Clinton Blackburn Committed by Clinton Blackburn

Added switch to toggle global activation of Stripe payment processor

parent f1d34114
...@@ -90,6 +90,9 @@ processors they control. ...@@ -90,6 +90,9 @@ processors they control.
* - CyberSource * - CyberSource
- payment_processor_active_cybersource - payment_processor_active_cybersource
- True - True
* - Stripe
- payment_processor_active_stripe
- True
In the unlikely event that all payment processors are disabled, the LMS will display an informative error message In the unlikely event that all payment processors are disabled, the LMS will display an informative error message
explaining why payment is not currently possible. explaining why payment is not currently possible.
......
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-11-07 15:50
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
from ecommerce.extensions.payment.processors.stripe import Stripe
def create_switch(apps, schema_editor):
Switch = apps.get_model('waffle', 'Switch')
Switch(name=settings.PAYMENT_PROCESSOR_SWITCH_PREFIX + Stripe.NAME, active=True).save()
def delete_switch(apps, schema_editor):
Switch = apps.get_model('waffle', 'Switch')
Switch.objects.get(name=settings.PAYMENT_PROCESSOR_SWITCH_PREFIX + Stripe.NAME).delete()
class Migration(migrations.Migration):
dependencies = [
('payment', '0017_auto_20170328_1445'),
]
operations = [
migrations.RunPython(create_switch, delete_switch)
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment