@paykit-sdk/stripe 1.1.1-alpha.1 → 1.1.2

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
@@ -99,9 +99,10 @@ var StripeProvider = class {
99
99
  const { customer_id, item_id, metadata, session_type, provider_metadata } = params;
100
100
  const checkout = await this.stripe.checkout.sessions.create({
101
101
  customer: customer_id,
102
- metadata,
103
- line_items: [{ price: item_id }],
104
102
  mode: session_type === "one_time" ? "payment" : "subscription",
103
+ ...session_type == "one_time" && { metadata },
104
+ ...session_type == "recurring" && { subscription_data: { metadata } },
105
+ line_items: [{ price: item_id }],
105
106
  ...provider_metadata
106
107
  });
107
108
  return toPaykitCheckout(checkout);
package/dist/index.mjs CHANGED
@@ -66,9 +66,10 @@ var StripeProvider = class {
66
66
  const { customer_id, item_id, metadata, session_type, provider_metadata } = params;
67
67
  const checkout = await this.stripe.checkout.sessions.create({
68
68
  customer: customer_id,
69
- metadata,
70
- line_items: [{ price: item_id }],
71
69
  mode: session_type === "one_time" ? "payment" : "subscription",
70
+ ...session_type == "one_time" && { metadata },
71
+ ...session_type == "recurring" && { subscription_data: { metadata } },
72
+ line_items: [{ price: item_id }],
72
73
  ...provider_metadata
73
74
  });
74
75
  return toPaykitCheckout(checkout);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paykit-sdk/stripe",
3
- "version": "1.1.1-alpha.1",
3
+ "version": "1.1.2",
4
4
  "description": "Stripe provider for PayKit",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -24,7 +24,7 @@
24
24
  "stripe": "^18.2.1"
25
25
  },
26
26
  "peerDependencies": {
27
- "@paykit-sdk/core": "^1.1.1-alpha.1"
27
+ "@paykit-sdk/core": "^1.1.2"
28
28
  },
29
29
  "devDependencies": {
30
30
  "tsup": "^8.0.0",