Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
40 changes: 40 additions & 0 deletions app/components/forms/admin/settings/payment-gateway-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,46 @@ export default Component.extend(FormMixin, {
prompt : this.l10n.t('Please enter the secret live key')
}
]
},

paytmLiveMerchant: {
identifier : 'paytm_live_merchant',
rules : [
{
type : 'empty',
prompt : this.l10n.t('Please enter the live merchant ID')
}
]
},

paytmLiveSecret: {
identifier : 'paytm_live_secret',
rules : [
{
type : 'empty',
prompt : this.l10n.t('Please enter the secret live key')
}
]
},

paytmSandboxMerchant: {
identifier : 'paytm_sandbox_merchant',
rules : [
{
type : 'empty',
prompt : this.l10n.t('Please enter the test merchant ID')
}
]
},

paytmSandboxSecret: {
identifier : 'paytm_sandbox_secret',
rules : [
{
type : 'empty',
prompt : this.l10n.t('Please enter the secret test key')
}
]
}
}
};
Expand Down
6 changes: 6 additions & 0 deletions app/models/setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ export default ModelBase.extend({
omiseTestSecret : attr('string'),
omiseLivePublic : attr('string'),
omiseLiveSecret : attr('string'),
paytmMode : attr('string'),
paytmLiveMerchant : attr('string'),
paytmLiveSecret : attr('string'),
paytmSandboxMerchant : attr('string'),
paytmSandboxSecret : attr('string'),
stripeClientId : attr('string'),
stripeSecretKey : attr('string'),
stripePublishableKey : attr('string'),
Expand All @@ -49,6 +54,7 @@ export default ModelBase.extend({
isPaypalActivated : attr('boolean'),
isStripeActivated : attr('boolean'),
isOmiseActivated : attr('boolean'),
isPaytmActivated : attr('boolean'),
emailService : attr('string'),
emailFrom : attr('string'),
emailFromName : attr('string'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
</div>
{{/if}}
{{/if}}
<div class="ui hidden divider"></div>
<div class="inline field">
<label>
{{t 'Enable Omise'}}
Expand Down Expand Up @@ -237,6 +236,73 @@
</div>
{{/if}}
{{/if}}
<div class="inline field">
<label>
{{t 'Enable PayTM'}}
</label>
{{ui-checkbox class='toggle' checked=isPaytmActivated onChange=(action (mut isPaytmActivated))}}
</div>
{{#if isPaytmActivated}}
<h3 class="ui header">
{{t 'PayTM Credentials'}}
<div class="sub header">
{{t 'See'}}
<a href="https://dashboard.paytm.com/next/apikeys" target="_blank" rel="noopener nofollow">
{{t 'here'}}
</a>
{{t 'on how to obtain these keys.'}}
</div>
</h3>
<h5 class="ui header">
{{t 'PayTM Integration Mode'}}
</h5>
<div class="field">
{{ui-radio label=(t 'Test mode - Used during development and testing')
name='paytm_integration_mode'
value='test'
current=settings.paytmMode
onChange=(action (mut settings.paytmMode))}}
</div>
{{#if (eq settings.paytmMode 'test')}}
<div class="field">
<label>
{{t 'PayTM Test Merchant ID'}}
{{ui-popup tagName="i" class="info icon" content=(t 'This Merchant ID will be used for testing mode') }}
</label>
{{input type='text' name='paytm_sandbox_merchant' value=settings.paytmSandboxMerchant}}
</div>
<div class="field">
<label>
{{t 'PayTM Test Secret Key'}}
{{ui-popup tagName="i" class="info icon" content=(t 'This secret key will be used during testing mode') }}
</label>
{{input type='text' name='paytm_sandbox_secret' value=settings.paytmSandboxSecret}}
</div>
{{/if}}
<div class="field">
{{ui-radio label=(t 'Live mode - Used during production')
name='paytm_integration_mode'
value='live'
current=settings.paytmMode
onChange=(action (mut settings.paytmMode))}}
</div>
{{#if (eq settings.paytmMode 'live')}}
<div class="field">
<label>
{{t 'PayTM Live Merchant ID'}}
{{ui-popup tagName="i" class="info icon" content=(t 'This Merchant ID will be used during live (production) mode') }}
</label>
{{input type='text' name='paytm_live_merchant' value=settings.paytmLiveMerchant}}
</div>
<div class="field">
<label>
{{t 'PayTM Live Secret Key'}}
{{ui-popup tagName="i" class="info icon" content=(t 'This secret key will be used during live (production) mode' )}}
</label>
{{input type='text' name='paytm_live_secret' value=settings.paytmLiveSecret}}
</div>
{{/if}}
{{/if}}
<button class="ui teal button" type="submit">
{{t 'Save'}}
</button>
Expand Down