Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/api/schema/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class Meta:
#
# Online Payment Flags
#
is_paytm_activated = fields.Bool(dump_only=True, allow_none=False, default=False)
is_paypal_activated = fields.Bool(dump_only=True)
is_stripe_activated = fields.Bool(dump_only=True)
is_omise_activated = fields.Bool(dump_only=True)
Expand Down Expand Up @@ -185,6 +186,12 @@ class Meta:
alipay_publishable_key = fields.Str(allow_none=True)
alipay_secret_key = fields.Str(allow_none=True)

# payTM credentials

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unexpected indentation (comment)

paytm_mode = fields.Str(allow_none=True)
paytm_live_merchant = fields.Str(allow_none=True)
paytm_live_secret = fields.Str(allow_none=True)
paytm_sandbox_merchant = fields.Str(allow_none=True)
paytm_sandbox_secret = fields.Str(allow_none=True)
#
# EMAIL
#
Expand Down
23 changes: 23 additions & 0 deletions app/models/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ class Setting(db.Model):
omise_test_public = db.Column(db.String)
omise_test_secret = db.Column(db.String)

# payTM credentials

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unexpected indentation (comment)

is_paytm_activated = db.Column(db.Boolean, default=False, nullable=False)
paytm_mode = db.Column(db.String)
paytm_live_merchant = db.Column(db.String)
paytm_live_secret = db.Column(db.String)
paytm_sandbox_merchant = db.Column(db.String)
paytm_sandbox_secret = db.Column(db.String)

#
# EMAIL
#
Expand Down Expand Up @@ -222,6 +230,12 @@ def __init__(self,
omise_live_secret=None,
alipay_publishable_key=None,
alipay_secret_key=None,
is_paytm_activated=False,
paytm_mode=None,
paytm_live_merchant=None,
paytm_live_secret=None,
paytm_sandbox_merchant=None,
paytm_sandbox_secret=None,
invoice_sending_day=None,
invoice_sending_timezone=None,
admin_billing_contact_name=None,
Expand Down Expand Up @@ -297,6 +311,7 @@ def __init__(self,
self.paypal_sandbox_client = paypal_sandbox_client
self.paypal_sandbox_secret = paypal_sandbox_secret


# Omise Credentials
self.omise_mode = omise_mode
self.omise_test_public = omise_test_public
Expand All @@ -308,6 +323,14 @@ def __init__(self,
self.alipay_publishable_key = alipay_publishable_key
self.alipay_secret_key = alipay_secret_key

# payTM Credentials
self.is_paytm_activated = is_paytm_activated
self.paytm_mode = paytm_mode
self.paytm_live_merchant = paytm_live_merchant
self.paytm_live_secret = paytm_live_secret
self.paytm_sandbox_merchant = paytm_sandbox_merchant
self.paytm_sandbox_secret = paytm_sandbox_secret

# Event Invoice settings
self.invoice_sending_timezone = invoice_sending_timezone
self.invoice_sending_day = invoice_sending_day
Expand Down
37 changes: 37 additions & 0 deletions migrations/versions/rev-2019-08-09-19:41:03-246b5b6123af_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""empty message

Revision ID: 246b5b6123af
Revises: 9d5753192ac9
Create Date: 2019-08-09 19:41:03.995657

"""

from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils


# revision identifiers, used by Alembic.
revision = '246b5b6123af'
down_revision = '9d5753192ac9'


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('settings', sa.Column('paytm_live_merchant', sa.String(), nullable=True))
op.add_column('settings', sa.Column('paytm_live_secret', sa.String(), nullable=True))
op.add_column('settings', sa.Column('paytm_mode', sa.String(), nullable=True))
op.add_column('settings', sa.Column('paytm_sandbox_merchant', sa.String(), nullable=True))
op.add_column('settings', sa.Column('paytm_sandbox_secret', sa.String(), nullable=True))
op.add_column('settings', sa.Column('is_paytm_activated', sa.Boolean(), server_default='False', nullable=False))
# ### end Alembic commands ###


def downgrade():
op.drop_column('settings', 'paytm_sandbox_secret')
op.drop_column('settings', 'paytm_sandbox_merchant')
op.drop_column('settings', 'paytm_mode')
op.drop_column('settings', 'paytm_live_secret')
op.drop_column('settings', 'paytm_live_merchant')
op.drop_column('settings', 'is_paytm_activated')
# ### end Alembic commands ###