Skip to content

Commit 3cb1485

Browse files
authored
feat: Addition of stripe test client id (#3392)
* Addition of stripe test client id * Using Translational Helpers
1 parent d6114bc commit 3cb1485

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

app/components/forms/admin/settings/payment-gateway-form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export default Component.extend(FormMixin, {
202202
},
203203

204204
isCheckedStripe: computed(function() {
205-
return this.get('settings.stripeClientId');
205+
return this.get('settings.stripeClientId') || this.get('settings.stripeTestClientId');
206206
}),
207207

208208
stripeMode: computed(function() {

app/models/setting.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export default ModelBase.extend({
4848
stripeClientId : attr('string'),
4949
stripeSecretKey : attr('string'),
5050
stripePublishableKey : attr('string'),
51+
stripeTestCliendId : attr('string'),
5152
stripeTestSecretKey : attr('string'),
5253
stripeTestPublishableKey : attr('string'),
5354
isAliPayActivated : attr('boolean'),

app/templates/components/forms/admin/settings/payment-gateway-form.hbs

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@
1616
{{t 'on how to obtain these keys.'}}
1717
</div>
1818
</h3>
19-
<div class="field">
20-
<label>
21-
{{t 'Client ID'}}
22-
</label>
23-
{{input type='text' name='stripe_client_id' value=settings.stripeClientId}}
24-
</div>
2519
<h5 class="ui header">
2620
{{t 'Stripe Integration Mode'}}
2721
</h5>
@@ -33,15 +27,24 @@
3327
onChange=(action (mut stripeMode))}}
3428
</div>
3529
{{#if (eq stripeMode 'debug')}}
30+
<div class="field">
31+
<label>
32+
{{t 'Client Test ID'}}
33+
{{ui-popup tagName="i" class="info icon" content=(t 'This client id will be used for testing mode')}}
34+
</label>
35+
{{input type='text' name='stripe_test_client_id' value=settings.stripeTestClientId}}
36+
</div>
3637
<div class="field">
3738
<label>
3839
{{t 'Secret Test Key'}}
40+
{{ui-popup tagName="i" class="info icon" content=(t 'This secret key will be used for testing mode')}}
3941
</label>
4042
{{input type='text' name='stripe_test_secret_key' value=settings.stripeTestSecretKey}}
4143
</div>
4244
<div class="field">
4345
<label>
4446
{{t 'Publishable Test Key'}}
47+
{{ui-popup tagName="i" class="info icon" content=(t 'This publishable key will be used for testing mode')}}
4548
</label>
4649
{{input type='text' name='stripe_test_publishable_key' value=settings.stripeTestPublishableKey}}
4750
</div>
@@ -55,15 +58,24 @@
5558
onChange=(action (mut stripeMode))}}
5659
</div>
5760
{{#if (eq stripeMode 'production')}}
61+
<div class="field">
62+
<label>
63+
{{t 'Client ID'}}
64+
{{ui-popup tagName="i" class="info icon" content=(t 'This client id will be used during live (production) mode')}}
65+
</label>
66+
{{input type='text' name='stripe_client_id' value=settings.stripeClientId}}
67+
</div>
5868
<div class="field">
5969
<label>
6070
{{t 'Secret Key'}}
71+
{{ui-popup tagName="i" class="info icon" content=(t 'This Secret Key will be used during live (production) mode')}}
6172
</label>
6273
{{input type='text' name='stripe_secret_key' value=settings.stripeSecretKey}}
6374
</div>
6475
<div class="field">
6576
<label>
6677
{{t 'Publishable Key'}}
78+
{{ui-popup tagName="i" class="info icon" content=(t 'This Publishable Key will be used during live (production) mode')}}
6779
</label>
6880
{{input type='text' name='stripe_publishable_key' value=settings.stripePublishableKey}}
6981
</div>
@@ -133,14 +145,14 @@
133145
<div class="field">
134146
<label>
135147
{{t 'Paypal Sandbox Client Id'}}
136-
{{ui-popup tagName="i" class="info icon" content="This client id will be used for testing mode"}}
148+
{{ui-popup tagName="i" class="info icon" content=(t 'This client id will be used for testing mode')}}
137149
</label>
138150
{{input type='text' name='sandbox_client_id' value=settings.paypalSandboxClient}}
139151
</div>
140152
<div class="field">
141153
<label>
142154
{{t 'Paypal Sandbox Secret Token'}}
143-
{{ui-popup tagName="i" class="info icon" content="This secret token will be used during testing mode"}}
155+
{{ui-popup tagName="i" class="info icon" content=(t 'This secret token will be used during testing mode')}}
144156
</label>
145157
{{input type='text' name='sandbox_secret_token' value=settings.paypalSandboxSecret}}
146158
</div>
@@ -156,14 +168,14 @@
156168
<div class="field">
157169
<label>
158170
{{t 'Paypal Client Id'}}
159-
{{ui-popup tagName="i" class="info icon" content="This client id will be used during live (production) mode"}}
171+
{{ui-popup tagName="i" class="info icon" content=(t 'This client id will be used during live (production) mode')}}
160172
</label>
161173
{{input type='text' name='client_id' value=settings.paypalClient}}
162174
</div>
163175
<div class="field">
164176
<label>
165177
{{t 'Paypal Secret Token'}}
166-
{{ui-popup tagName="i" class="info icon" content="This secret tocken will be used during live (production) mode"}}
178+
{{ui-popup tagName="i" class="info icon" content=(t 'This secret tocken will be used during live (production) mode')}}
167179
</label>
168180
{{input type='text' name='secret_token' value=settings.paypalSecret}}
169181
</div>
@@ -223,7 +235,7 @@
223235
<div class="field">
224236
<label>
225237
{{t 'Omise Live Public Key'}}
226-
{{ui-popup tagName="i" class="info icon" content=(t 'This pucliv key will be used during live (production) mode') }}
238+
{{ui-popup tagName="i" class="info icon" content=(t 'This public key will be used during live (production) mode') }}
227239
</label>
228240
{{input type='text' name='live_public_key' value=settings.omiseLivePublic}}
229241
</div>

0 commit comments

Comments
 (0)