@drawbridge/drawbridge-stripe 0.1.5 → 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
@@ -161,8 +161,20 @@ var require_billing = __commonJS({
161
161
  ;
162
162
  let stripePricingPlanSubscriptionNextBillingDate;
163
163
  if (!default_payment_method) {
164
- const { billing_cadence: billingCadenceId } = await stripe2.v2.billing.pricingPlanSubscriptions.retrieve(stripePricingPlanSubscriptionId);
165
- ({ next_billing_date: stripePricingPlanSubscriptionNextBillingDate } = await stripe2.v2.billing.cadences.retrieve(billingCadenceId));
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
+ ;
166
178
  }
167
179
  ;
168
180
  return {
package/dist/index.mjs CHANGED
@@ -167,8 +167,20 @@ var require_billing = __commonJS({
167
167
  ;
168
168
  let stripePricingPlanSubscriptionNextBillingDate;
169
169
  if (!default_payment_method) {
170
- const { billing_cadence: billingCadenceId } = await stripe.v2.billing.pricingPlanSubscriptions.retrieve(stripePricingPlanSubscriptionId);
171
- ({ next_billing_date: stripePricingPlanSubscriptionNextBillingDate } = await stripe.v2.billing.cadences.retrieve(billingCadenceId));
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
+ ;
172
184
  }
173
185
  ;
174
186
  return {
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.5"
27
+ "version": "0.1.6"
28
28
  }