Skip to content

Commit 56e9845

Browse files
feat: add paytm to create event and order-form page
1 parent d6114bc commit 56e9845

File tree

7 files changed

+29
-0
lines changed

7 files changed

+29
-0
lines changed

app/components/forms/wizard/basic-details-step.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ export default Component.extend(FormMixin, EventWizardMixin, {
4040
return this.get('settings.isPaypalActivated') && find(paymentCurrencies, ['code', this.get('data.event.paymentCurrency')]).paypal;
4141
}),
4242

43+
canAcceptPaytm: computed('data.event.paymentCurrency', 'settings.isPaytmActivated', function() {
44+
return this.get('settings.isPaytmActivated') && find(paymentCurrencies, ['code', this.get('data.event.paymentCurrency')]).paytm;
45+
}),
46+
4347
canAcceptStripe: computed('data.event.paymentCurrency', 'settings.isStripeActivated', function() {
4448
return this.get('settings.isStripeActivated') && find(paymentCurrencies, ['code', this.get('data.event.paymentCurrency')]).stripe;
4549
}),

app/controllers/orders/pending.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ export default Controller.extend({
1616
return this.get('model.order.paymentMode') === 'paypal';
1717
}),
1818

19+
isPaytm: computed('model.order.paymentMode', function() {
20+
return this.get('model.order.paymentMode') === 'paytm';
21+
}),
22+
1923
isOmise: computed('model.order.paymentMode', function() {
2024
return this.get('model.order.paymentMode') === 'omise';
2125
}),

app/models/event.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export default ModelBase.extend(CustomPrimaryKeyMixin, {
5454

5555
isTaxEnabled : attr('boolean', { defaultValue: false }),
5656
canPayByPaypal : attr('boolean', { defaultValue: false }),
57+
canPayByPaytm : attr('boolean', { defaultValue: false }),
5758
canPayByStripe : attr('boolean', { defaultValue: false }),
5859
isStripeLinked : attr('boolean'),
5960
canPayByCheque : attr('boolean', { defaultValue: false }),

app/models/setting.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export default ModelBase.extend({
5252
stripeTestPublishableKey : attr('string'),
5353
isAliPayActivated : attr('boolean'),
5454
isPaypalActivated : attr('boolean'),
55+
isPaytmActivated : attr('boolean'),
5556
isStripeActivated : attr('boolean'),
5657
isOmiseActivated : attr('boolean'),
5758
isPaytmActivated : attr('boolean'),

app/templates/components/forms/orders/order-form.hbs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@
150150
<label for="payment_mode"><img src="/images/payment-logos/paypal.png" alt="paypal"></label>
151151
</div>
152152
{{/if}}
153+
{{#if data.event.canPayByPaytm}}
154+
<div class="field">
155+
{{ui-radio name='payment_mode' label=(t 'Paytm') value='paytm' current=data.paymentMode
156+
onChange=(action (mut data.paymentMode))}}
157+
<label for="payment_mode"><img src="/images/payment-logos/paytm.png" alt="paytm"></label>
158+
</div>
159+
{{/if}}
153160
{{#if data.event.canPayByOmise}}
154161
<div class="field">
155162
{{ui-radio name='payment_mode' label=(t 'Omise') value='omise' current=data.paymentMode

app/templates/components/forms/wizard/basic-details-step.hbs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,18 @@
328328
</div>
329329
{{/if}}
330330
{{/if}}
331+
{{#if canAcceptPaytm}}
332+
<label>{{t 'Payment by Paytm'}}</label>
333+
<div class="field payments">
334+
<div class="ui checkbox">
335+
{{input type='checkbox' id='payment_by_paytm' checked=data.event.canPayByPaytm}}
336+
<label for="payment_by_paytm">
337+
<span>{{t 'YES, accept payment through Paytm'}}</span>
338+
<br>
339+
</label>
340+
</div>
341+
</div>
342+
{{/if}}
331343
{{#if canAcceptAliPay}}
332344
<label>{{t 'Payment with AliPay'}}</label>
333345
<div class="field payments">
2.98 KB
Loading

0 commit comments

Comments
 (0)