Skip to content

Commit 28fe009

Browse files
committed
remove unn changes
1 parent 78fb877 commit 28fe009

File tree

4 files changed

+71
-1
lines changed

4 files changed

+71
-1
lines changed

app/api/schema/orders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def initial_values(self, data):
6161
payment_mode = fields.Str(
6262
default="free",
6363
validate=validate.OneOf(choices=["free", "stripe", "paypal", "bank",
64-
"cheque", "onsite", "omise", "alipay"]),
64+
"cheque", "onsite", "omise", "alipay", "paytm"]),
6565
allow_none=True)
6666
paid_via = fields.Str(dump_only=True)
6767
is_billing_enabled = fields.Boolean(default=False)

app/api/schema/settings.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ class Meta:
183183
alipay_publishable_key = fields.Str(allow_none=True)
184184
alipay_secret_key = fields.Str(allow_none=True)
185185

186+
# payTM credentials
187+
paytm_mode = fields.Str(allow_none=True)
188+
paytm_live_merchant = fields.Str(allow_none=True)
189+
paytm_live_secret = fields.Str(allow_none=True)
190+
paypal_sandbox_merchant = fields.Str(allow_none=True)
191+
paypal_sandbox_secret = fields.Str(allow_none=True)
186192
#
187193
# EMAIL
188194
#

app/models/setting.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ class Setting(db.Model):
102102
omise_test_public = db.Column(db.String)
103103
omise_test_secret = db.Column(db.String)
104104

105+
# payTM credentials
106+
paytm_mode = db.Column(db.String)
107+
paytm_live_merchant = db.Column(db.String)
108+
paytm_live_secret = db.Column(db.String)
109+
paytm_sandbox_merchant = db.Column(db.String)
110+
paytm_sandbox_secret = db.Column(db.String)
111+
105112
#
106113
# EMAIL
107114
#
@@ -219,6 +226,11 @@ def __init__(self,
219226
omise_live_secret=None,
220227
alipay_publishable_key=None,
221228
alipay_secret_key=None,
229+
paytm_mode=None,
230+
paytm_live_merchant=None,
231+
paytm_live_secret=None,
232+
paytm_sandbox_merchant=None,
233+
paytm_sandbox_secret=None,
222234
invoice_sending_day=None,
223235
invoice_sending_timezone=None,
224236
admin_billing_contact_name=None,
@@ -303,6 +315,13 @@ def __init__(self,
303315
self.alipay_publishable_key = alipay_publishable_key
304316
self.alipay_secret_key = alipay_secret_key
305317

318+
# Paytm Credentials
319+
self.paytm_mode = paytm_mode
320+
self.paytm_sandbox_merchant = paytm_sandbox_merchant
321+
self.paytm_sandbox_secret = paytm_sandbox_secret
322+
self.paytm_live_merchant = paytm_live_merchant
323+
self.paytm_live_secret = paytm_live_secret
324+
306325
# Event Invoice settings
307326
self.invoice_sending_timezone = invoice_sending_timezone
308327
self.invoice_sending_day = invoice_sending_day
@@ -356,3 +375,12 @@ def is_omise_activated(self):
356375
return True
357376
else:
358377
return False
378+
379+
@hybrid_property
380+
def is_paytm_activated(self):
381+
if self.paytm_mode == 'sandbox' and self.paytm_sandbox_merchant and self.paytm_sandbox_secret:
382+
return True
383+
elif self.paytm_live_secret and self.paytm_live_merchant:
384+
return True
385+
else:
386+
return False
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""empty message
2+
3+
Revision ID: 8eecd0406101
4+
Revises: 96bca587b3ca
5+
Create Date: 2019-07-29 16:21:30.237899
6+
7+
"""
8+
9+
from alembic import op
10+
import sqlalchemy as sa
11+
import sqlalchemy_utils
12+
13+
14+
# revision identifiers, used by Alembic.
15+
revision = '8eecd0406101'
16+
down_revision = '96bca587b3ca'
17+
18+
19+
def upgrade():
20+
# ### commands auto generated by Alembic - please adjust! ###
21+
op.add_column('settings', sa.Column('paytm_live_merchant', sa.String(), nullable=True))
22+
op.add_column('settings', sa.Column('paytm_live_secret', sa.String(), nullable=True))
23+
op.add_column('settings', sa.Column('paytm_mode', sa.String(), nullable=True))
24+
op.add_column('settings', sa.Column('paytm_sandbox_merchant', sa.String(), nullable=True))
25+
op.add_column('settings', sa.Column('paytm_sandbox_secret', sa.String(), nullable=True))
26+
# ### end Alembic commands ###
27+
28+
29+
def downgrade():
30+
# ### commands auto generated by Alembic - please adjust! ###
31+
op.drop_column('settings', 'paytm_sandbox_secret')
32+
op.drop_column('settings', 'paytm_sandbox_merchant')
33+
op.drop_column('settings', 'paytm_mode')
34+
op.drop_column('settings', 'paytm_live_secret')
35+
op.drop_column('settings', 'paytm_live_merchant')
36+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)