File tree 5 files changed +19
-2
lines changed
5 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -827,6 +827,9 @@ type Plan {
827
827
"""Monthly charge currency for plan"""
828
828
monthlyChargeCurrency : String !
829
829
830
+ """How often to charge payment for the plan"""
831
+ paymentFrequency : String
832
+
830
833
"""Events limit for plan"""
831
834
eventsLimit : Int !
832
835
Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ export const WORKSPACE_PLAN = `
123
123
monthlyCharge
124
124
monthlyChargeCurrency
125
125
eventsLimit
126
+ paymentFrequency
126
127
}
127
128
}
128
129
` ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export const QUERY_PLANS = `
10
10
monthlyCharge
11
11
monthlyChargeCurrency
12
12
eventsLimit
13
+ paymentFrequency
13
14
}
14
15
}
15
16
` ;
Original file line number Diff line number Diff line change @@ -393,7 +393,11 @@ export default Vue.extend({
393
393
* Otherwise, we will debit money when the tariff plan expires
394
394
*/
395
395
if (this .isTariffPlanExpired ) {
396
- date .setMonth (date .getMonth () + 1 );
396
+ if (this .plan .paymentFrequency === ' daily' ) {
397
+ date .setDate (date .getDate () + 1 );
398
+ } else {
399
+ date .setMonth (date .getMonth () + 1 );
400
+ }
397
401
398
402
return date .toDateString ();
399
403
}
@@ -567,10 +571,12 @@ export default Vue.extend({
567
571
checksum: data .checksum ,
568
572
};
569
573
574
+ const interval = this .plan .paymentFrequency === ' daily' ? ' Day' : ' Month' ;
575
+
570
576
if (this .isRecurrent ) {
571
577
paymentData .cloudPayments = {
572
578
recurrent: {
573
- interval: ' Month ' ,
579
+ interval ,
574
580
period: 1 ,
575
581
},
576
582
};
Original file line number Diff line number Diff line change @@ -31,4 +31,10 @@ export interface Plan {
31
31
* Is plan default
32
32
*/
33
33
isDefault ?: boolean ;
34
+
35
+ /**
36
+ * How often to charge payment for the plan.
37
+ * Monthly by default.
38
+ */
39
+ paymentFrequency ?: 'monthly' | 'daily'
34
40
}
You can’t perform that action at this time.
0 commit comments