Skip to content

Commit e7e537c

Browse files
Hieu Lam - TMAmariobehlingcweitat
authored
fix-7984: Show test/live key of Stripe under Payments section (#8888)
* fix-7984: Show test/live key of Stripe under Payments section * Update rev-2023-06-12-13:39:49-410e54b84481_.py --------- Co-authored-by: Mario Behling <[email protected]> Co-authored-by: cweitat <[email protected]>
1 parent 7e15728 commit e7e537c

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

app/api/schema/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class Meta:
9595
stripe_publishable_key = fields.Str(dump_only=True)
9696
stripe_test_client_id = fields.Str(dump_only=True)
9797
stripe_test_publishable_key = fields.Str(dump_only=True)
98+
stripe_mode = fields.Str(dump_only=True)
9899

99100
# PayPal Credentials
100101
paypal_mode = fields.Str(dump_only=True)
@@ -239,6 +240,7 @@ class Meta:
239240
stripe_test_client_id = fields.Str(allow_none=True)
240241
stripe_test_secret_key = fields.Str(allow_none=True)
241242
stripe_test_publishable_key = fields.Str(allow_none=True)
243+
stripe_mode = fields.Str(allow_none=True)
242244

243245
# PayPal Credentials
244246
paypal_mode = fields.Str(allow_none=True)

app/models/setting.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class Setting(db.Model):
9090
stripe_test_client_id = db.Column(db.String)
9191
stripe_test_secret_key = db.Column(db.String)
9292
stripe_test_publishable_key = db.Column(db.String)
93+
stripe_mode = db.Column(db.String)
9394

9495
# AliPay Keys - Stripe Sources
9596
alipay_secret_key = db.Column(db.String)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""empty message
2+
3+
Revision ID: 410e54b84481
4+
Revises: a45167cdc102
5+
Create Date: 2023-06-12 13:39:49.999962
6+
7+
"""
8+
9+
from alembic import op
10+
import sqlalchemy as sa
11+
12+
13+
# revision identifiers, used by Alembic.
14+
revision = '410e54b84481'
15+
down_revision = 'a45167cdc102'
16+
17+
18+
def upgrade():
19+
# ### commands auto generated by Alembic - please adjust! ###
20+
op.add_column('settings', sa.Column('stripe_mode', sa.String(), nullable=True))
21+
# ### end Alembic commands ###
22+
23+
24+
def downgrade():
25+
# ### commands auto generated by Alembic - please adjust! ###
26+
op.drop_column('settings', 'stripe_mode')
27+
# ### end Alembic commands ###

tests/factories/setting.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class Meta:
6060
stripe_publishable_key = common.string_
6161
stripe_test_secret_key = common.string_
6262
stripe_test_publishable_key = common.string_
63+
stripe_mode = 'development'
6364
# PayPal Credentials
6465
paypal_mode = 'development'
6566
paypal_client = common.string_

0 commit comments

Comments
 (0)