|
@@ -252,7 +252,7 @@ class RecurlySubscriptionChange {
|
|
|
* @param {string} props.nextPlanName
|
|
* @param {string} props.nextPlanName
|
|
|
* @param {number} props.nextPlanPrice
|
|
* @param {number} props.nextPlanPrice
|
|
|
* @param {RecurlySubscriptionAddOn[]} props.nextAddOns
|
|
* @param {RecurlySubscriptionAddOn[]} props.nextAddOns
|
|
|
- * @param {number} [props.immediateCharge]
|
|
|
|
|
|
|
+ * @param {RecurlyImmediateCharge} [props.immediateCharge]
|
|
|
*/
|
|
*/
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
|
this.subscription = props.subscription
|
|
this.subscription = props.subscription
|
|
@@ -260,7 +260,9 @@ class RecurlySubscriptionChange {
|
|
|
this.nextPlanName = props.nextPlanName
|
|
this.nextPlanName = props.nextPlanName
|
|
|
this.nextPlanPrice = props.nextPlanPrice
|
|
this.nextPlanPrice = props.nextPlanPrice
|
|
|
this.nextAddOns = props.nextAddOns
|
|
this.nextAddOns = props.nextAddOns
|
|
|
- this.immediateCharge = props.immediateCharge ?? 0
|
|
|
|
|
|
|
+ this.immediateCharge =
|
|
|
|
|
+ props.immediateCharge ??
|
|
|
|
|
+ new RecurlyImmediateCharge({ subtotal: 0, tax: 0, total: 0 })
|
|
|
|
|
|
|
|
this.subtotal = this.nextPlanPrice
|
|
this.subtotal = this.nextPlanPrice
|
|
|
for (const addOn of this.nextAddOns) {
|
|
for (const addOn of this.nextAddOns) {
|
|
@@ -299,6 +301,20 @@ class CreditCardPaymentMethod {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+class RecurlyImmediateCharge {
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param {object} props
|
|
|
|
|
+ * @param {number} props.subtotal
|
|
|
|
|
+ * @param {number} props.tax
|
|
|
|
|
+ * @param {number} props.total
|
|
|
|
|
+ */
|
|
|
|
|
+ constructor(props) {
|
|
|
|
|
+ this.subtotal = props.subtotal
|
|
|
|
|
+ this.tax = props.tax
|
|
|
|
|
+ this.total = props.total
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* An add-on configuration, independent of any subscription
|
|
* An add-on configuration, independent of any subscription
|
|
|
*/
|
|
*/
|
|
@@ -350,4 +366,5 @@ module.exports = {
|
|
|
RecurlyAddOn,
|
|
RecurlyAddOn,
|
|
|
RecurlyPlan,
|
|
RecurlyPlan,
|
|
|
isStandaloneAiAddOnPlanCode,
|
|
isStandaloneAiAddOnPlanCode,
|
|
|
|
|
+ RecurlyImmediateCharge,
|
|
|
}
|
|
}
|