Skip to content

Commit dadc0c7

Browse files
uds5501abhinavk96
authored andcommitted
feat: add paytm credentials and setup in admin/settings (#3371)
1 parent 3525ed5 commit dadc0c7

File tree

3 files changed

+113
-1
lines changed

3 files changed

+113
-1
lines changed

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,46 @@ export default Component.extend(FormMixin, {
156156
prompt : this.l10n.t('Please enter the secret live key')
157157
}
158158
]
159+
},
160+
161+
paytmLiveMerchant: {
162+
identifier : 'paytm_live_merchant',
163+
rules : [
164+
{
165+
type : 'empty',
166+
prompt : this.l10n.t('Please enter the live merchant ID')
167+
}
168+
]
169+
},
170+
171+
paytmLiveSecret: {
172+
identifier : 'paytm_live_secret',
173+
rules : [
174+
{
175+
type : 'empty',
176+
prompt : this.l10n.t('Please enter the secret live key')
177+
}
178+
]
179+
},
180+
181+
paytmSandboxMerchant: {
182+
identifier : 'paytm_sandbox_merchant',
183+
rules : [
184+
{
185+
type : 'empty',
186+
prompt : this.l10n.t('Please enter the test merchant ID')
187+
}
188+
]
189+
},
190+
191+
paytmSandboxSecret: {
192+
identifier : 'paytm_sandbox_secret',
193+
rules : [
194+
{
195+
type : 'empty',
196+
prompt : this.l10n.t('Please enter the secret test key')
197+
}
198+
]
159199
}
160200
}
161201
};

app/models/setting.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ export default ModelBase.extend({
4040
omiseTestSecret : attr('string'),
4141
omiseLivePublic : attr('string'),
4242
omiseLiveSecret : attr('string'),
43+
paytmMode : attr('string'),
44+
paytmLiveMerchant : attr('string'),
45+
paytmLiveSecret : attr('string'),
46+
paytmSandboxMerchant : attr('string'),
47+
paytmSandboxSecret : attr('string'),
4348
stripeClientId : attr('string'),
4449
stripeSecretKey : attr('string'),
4550
stripePublishableKey : attr('string'),
@@ -49,6 +54,7 @@ export default ModelBase.extend({
4954
isPaypalActivated : attr('boolean'),
5055
isStripeActivated : attr('boolean'),
5156
isOmiseActivated : attr('boolean'),
57+
isPaytmActivated : attr('boolean'),
5258
emailService : attr('string'),
5359
emailFrom : attr('string'),
5460
emailFromName : attr('string'),

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

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@
169169
</div>
170170
{{/if}}
171171
{{/if}}
172-
<div class="ui hidden divider"></div>
173172
<div class="inline field">
174173
<label>
175174
{{t 'Enable Omise'}}
@@ -237,6 +236,73 @@
237236
</div>
238237
{{/if}}
239238
{{/if}}
239+
<div class="inline field">
240+
<label>
241+
{{t 'Enable PayTM'}}
242+
</label>
243+
{{ui-checkbox class='toggle' checked=isPaytmActivated onChange=(action (mut isPaytmActivated))}}
244+
</div>
245+
{{#if isPaytmActivated}}
246+
<h3 class="ui header">
247+
{{t 'PayTM Credentials'}}
248+
<div class="sub header">
249+
{{t 'See'}}
250+
<a href="https://dashboard.paytm.com/next/apikeys" target="_blank" rel="noopener nofollow">
251+
{{t 'here'}}
252+
</a>
253+
{{t 'on how to obtain these keys.'}}
254+
</div>
255+
</h3>
256+
<h5 class="ui header">
257+
{{t 'PayTM Integration Mode'}}
258+
</h5>
259+
<div class="field">
260+
{{ui-radio label=(t 'Test mode - Used during development and testing')
261+
name='paytm_integration_mode'
262+
value='test'
263+
current=settings.paytmMode
264+
onChange=(action (mut settings.paytmMode))}}
265+
</div>
266+
{{#if (eq settings.paytmMode 'test')}}
267+
<div class="field">
268+
<label>
269+
{{t 'PayTM Test Merchant ID'}}
270+
{{ui-popup tagName="i" class="info icon" content=(t 'This Merchant ID will be used for testing mode') }}
271+
</label>
272+
{{input type='text' name='paytm_sandbox_merchant' value=settings.paytmSandboxMerchant}}
273+
</div>
274+
<div class="field">
275+
<label>
276+
{{t 'PayTM Test Secret Key'}}
277+
{{ui-popup tagName="i" class="info icon" content=(t 'This secret key will be used during testing mode') }}
278+
</label>
279+
{{input type='text' name='paytm_sandbox_secret' value=settings.paytmSandboxSecret}}
280+
</div>
281+
{{/if}}
282+
<div class="field">
283+
{{ui-radio label=(t 'Live mode - Used during production')
284+
name='paytm_integration_mode'
285+
value='live'
286+
current=settings.paytmMode
287+
onChange=(action (mut settings.paytmMode))}}
288+
</div>
289+
{{#if (eq settings.paytmMode 'live')}}
290+
<div class="field">
291+
<label>
292+
{{t 'PayTM Live Merchant ID'}}
293+
{{ui-popup tagName="i" class="info icon" content=(t 'This Merchant ID will be used during live (production) mode') }}
294+
</label>
295+
{{input type='text' name='paytm_live_merchant' value=settings.paytmLiveMerchant}}
296+
</div>
297+
<div class="field">
298+
<label>
299+
{{t 'PayTM Live Secret Key'}}
300+
{{ui-popup tagName="i" class="info icon" content=(t 'This secret key will be used during live (production) mode' )}}
301+
</label>
302+
{{input type='text' name='paytm_live_secret' value=settings.paytmLiveSecret}}
303+
</div>
304+
{{/if}}
305+
{{/if}}
240306
<button class="ui teal button" type="submit">
241307
{{t 'Save'}}
242308
</button>

0 commit comments

Comments
 (0)