@drawbridge/drawbridge-stripe 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -159,6 +159,24 @@ var require_billing = __commonJS({
159
159
  throw new Error("Stripe billing intent did not return a pricing plan subscription ID for customer: " + customer);
160
160
  }
161
161
  ;
162
+ let stripePricingPlanSubscriptionNextBillingDate;
163
+ if (!default_payment_method) {
164
+ const { data: subscription } = await axios.get(
165
+ billing + "/pricing_plan_subscriptions/" + stripePricingPlanSubscriptionId,
166
+ options
167
+ );
168
+ if (subscription == null ? void 0 : subscription.billing_cadence) {
169
+ const { data: cadence } = await axios.get(
170
+ billing + "/cadences/" + subscription.billing_cadence,
171
+ options
172
+ );
173
+ if (cadence == null ? void 0 : cadence.next_billing_date) {
174
+ stripePricingPlanSubscriptionNextBillingDate = cadence.next_billing_date;
175
+ }
176
+ }
177
+ ;
178
+ }
179
+ ;
162
180
  return {
163
181
  stripeAlerts: {
164
182
  ai: {
@@ -166,7 +184,8 @@ var require_billing = __commonJS({
166
184
  replenish: replenish == null ? void 0 : replenish.id
167
185
  }
168
186
  },
169
- stripePricingPlanSubscriptionId
187
+ stripePricingPlanSubscriptionId,
188
+ stripePricingPlanSubscriptionNextBillingDate
170
189
  };
171
190
  } catch (error) {
172
191
  throw error;
package/dist/index.mjs CHANGED
@@ -165,6 +165,24 @@ var require_billing = __commonJS({
165
165
  throw new Error("Stripe billing intent did not return a pricing plan subscription ID for customer: " + customer);
166
166
  }
167
167
  ;
168
+ let stripePricingPlanSubscriptionNextBillingDate;
169
+ if (!default_payment_method) {
170
+ const { data: subscription } = await axios.get(
171
+ billing + "/pricing_plan_subscriptions/" + stripePricingPlanSubscriptionId,
172
+ options
173
+ );
174
+ if (subscription == null ? void 0 : subscription.billing_cadence) {
175
+ const { data: cadence } = await axios.get(
176
+ billing + "/cadences/" + subscription.billing_cadence,
177
+ options
178
+ );
179
+ if (cadence == null ? void 0 : cadence.next_billing_date) {
180
+ stripePricingPlanSubscriptionNextBillingDate = cadence.next_billing_date;
181
+ }
182
+ }
183
+ ;
184
+ }
185
+ ;
168
186
  return {
169
187
  stripeAlerts: {
170
188
  ai: {
@@ -172,7 +190,8 @@ var require_billing = __commonJS({
172
190
  replenish: replenish == null ? void 0 : replenish.id
173
191
  }
174
192
  },
175
- stripePricingPlanSubscriptionId
193
+ stripePricingPlanSubscriptionId,
194
+ stripePricingPlanSubscriptionNextBillingDate
176
195
  };
177
196
  } catch (error) {
178
197
  throw error;
package/package.json CHANGED
@@ -24,5 +24,5 @@
24
24
  "build": "tsup ./index.js && npm publish"
25
25
  },
26
26
  "types": "dist/index.d.ts",
27
- "version": "0.1.4"
27
+ "version": "0.1.6"
28
28
  }