@drawbridge/drawbridge-stripe 0.1.11 → 0.1.12
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 +12 -18
- package/dist/index.mjs +12 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -284,8 +284,8 @@ var require_subscription = __commonJS({
|
|
|
284
284
|
const options = {
|
|
285
285
|
headers: {
|
|
286
286
|
"Authorization": "Bearer " + process.env.STRIPE_API_KEY,
|
|
287
|
-
"Content-Type": "application/
|
|
288
|
-
"Stripe-Version": "2026-
|
|
287
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
288
|
+
"Stripe-Version": "2026-03-25.preview"
|
|
289
289
|
}
|
|
290
290
|
};
|
|
291
291
|
const createMeter = async ({
|
|
@@ -591,20 +591,14 @@ var require_subscription = __commonJS({
|
|
|
591
591
|
stripeSubscriptionId
|
|
592
592
|
}) => {
|
|
593
593
|
try {
|
|
594
|
+
const body = new URLSearchParams();
|
|
595
|
+
body.append("type", "subscription");
|
|
596
|
+
body.append("bill_for[unused_time_from][type]", "now");
|
|
597
|
+
body.append("bill_for[outstanding_usage_through][type]", "now");
|
|
598
|
+
body.append("invoicing_behavior", "pending_invoice_item");
|
|
594
599
|
const { data } = await axios.post(
|
|
595
600
|
subscriptions + "/" + stripeSubscriptionId + "/pause",
|
|
596
|
-
|
|
597
|
-
type: "subscription",
|
|
598
|
-
bill_for: {
|
|
599
|
-
unused_time_from: {
|
|
600
|
-
type: "now"
|
|
601
|
-
},
|
|
602
|
-
outstanding_usage_through: {
|
|
603
|
-
type: "now"
|
|
604
|
-
}
|
|
605
|
-
},
|
|
606
|
-
invoicing_behavior: "pending_invoice_item"
|
|
607
|
-
},
|
|
601
|
+
body,
|
|
608
602
|
options
|
|
609
603
|
);
|
|
610
604
|
return data;
|
|
@@ -616,12 +610,12 @@ var require_subscription = __commonJS({
|
|
|
616
610
|
stripeSubscriptionId
|
|
617
611
|
}) => {
|
|
618
612
|
try {
|
|
613
|
+
const body = new URLSearchParams();
|
|
614
|
+
body.append("billing_cycle_anchor", "unchanged");
|
|
615
|
+
body.append("proration_behavior", "create_prorations");
|
|
619
616
|
const { data } = await axios.post(
|
|
620
617
|
subscriptions + "/" + stripeSubscriptionId + "/resume",
|
|
621
|
-
|
|
622
|
-
billing_cycle_anchor: "unchanged",
|
|
623
|
-
proration_behavior: "create_prorations"
|
|
624
|
-
},
|
|
618
|
+
body,
|
|
625
619
|
options
|
|
626
620
|
);
|
|
627
621
|
return data;
|
package/dist/index.mjs
CHANGED
|
@@ -290,8 +290,8 @@ var require_subscription = __commonJS({
|
|
|
290
290
|
const options = {
|
|
291
291
|
headers: {
|
|
292
292
|
"Authorization": "Bearer " + process.env.STRIPE_API_KEY,
|
|
293
|
-
"Content-Type": "application/
|
|
294
|
-
"Stripe-Version": "2026-
|
|
293
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
294
|
+
"Stripe-Version": "2026-03-25.preview"
|
|
295
295
|
}
|
|
296
296
|
};
|
|
297
297
|
const createMeter = async ({
|
|
@@ -597,20 +597,14 @@ var require_subscription = __commonJS({
|
|
|
597
597
|
stripeSubscriptionId
|
|
598
598
|
}) => {
|
|
599
599
|
try {
|
|
600
|
+
const body = new URLSearchParams();
|
|
601
|
+
body.append("type", "subscription");
|
|
602
|
+
body.append("bill_for[unused_time_from][type]", "now");
|
|
603
|
+
body.append("bill_for[outstanding_usage_through][type]", "now");
|
|
604
|
+
body.append("invoicing_behavior", "pending_invoice_item");
|
|
600
605
|
const { data } = await axios.post(
|
|
601
606
|
subscriptions + "/" + stripeSubscriptionId + "/pause",
|
|
602
|
-
|
|
603
|
-
type: "subscription",
|
|
604
|
-
bill_for: {
|
|
605
|
-
unused_time_from: {
|
|
606
|
-
type: "now"
|
|
607
|
-
},
|
|
608
|
-
outstanding_usage_through: {
|
|
609
|
-
type: "now"
|
|
610
|
-
}
|
|
611
|
-
},
|
|
612
|
-
invoicing_behavior: "pending_invoice_item"
|
|
613
|
-
},
|
|
607
|
+
body,
|
|
614
608
|
options
|
|
615
609
|
);
|
|
616
610
|
return data;
|
|
@@ -622,12 +616,12 @@ var require_subscription = __commonJS({
|
|
|
622
616
|
stripeSubscriptionId
|
|
623
617
|
}) => {
|
|
624
618
|
try {
|
|
619
|
+
const body = new URLSearchParams();
|
|
620
|
+
body.append("billing_cycle_anchor", "unchanged");
|
|
621
|
+
body.append("proration_behavior", "create_prorations");
|
|
625
622
|
const { data } = await axios.post(
|
|
626
623
|
subscriptions + "/" + stripeSubscriptionId + "/resume",
|
|
627
|
-
|
|
628
|
-
billing_cycle_anchor: "unchanged",
|
|
629
|
-
proration_behavior: "create_prorations"
|
|
630
|
-
},
|
|
624
|
+
body,
|
|
631
625
|
options
|
|
632
626
|
);
|
|
633
627
|
return data;
|
package/package.json
CHANGED