@paykit-sdk/stripe 1.1.96 → 1.1.98

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
@@ -4166,7 +4166,9 @@ var paykitPayment$InboundSchema = (intent) => {
4166
4166
  customer: intent.customer ?? "",
4167
4167
  status: stripeToPaykitStatus(intent.status),
4168
4168
  metadata: core.omitInternalMetadata(intent.metadata ?? {}),
4169
- item_id: itemId
4169
+ item_id: itemId,
4170
+ requires_action: intent.status === "requires_action" || intent.status === "requires_confirmation",
4171
+ payment_url: intent.next_action?.redirect_to_url?.url ?? null
4170
4172
  };
4171
4173
  };
4172
4174
  var paykitRefund$InboundSchema = (refund) => {
@@ -4377,6 +4379,7 @@ var StripeProvider = class extends core.AbstractPayKitProvider {
4377
4379
  throw core.ValidationError.fromZodError(error, this.providerName, "updateSubscription");
4378
4380
  }
4379
4381
  const updatedSubscription = await this.stripe.subscriptions.update(id, {
4382
+ ...data.provider_metadata && { ...data.provider_metadata },
4380
4383
  metadata: core.stringifyMetadataValues(data.metadata ?? {})
4381
4384
  });
4382
4385
  return paykitSubscription$InboundSchema(updatedSubscription);
@@ -4766,10 +4769,12 @@ var StripeProvider = class extends core.AbstractPayKitProvider {
4766
4769
  provider: this.providerName
4767
4770
  });
4768
4771
  const result = await handler(event);
4769
- if (!result)
4770
- throw new core.WebhookError(`Unhandled event type: ${event.type}`, {
4771
- provider: this.providerName
4772
- });
4772
+ if (!result) {
4773
+ console.log(
4774
+ `Skipping event ${event.type} for provider: ${this.providerName} as no action needed`
4775
+ );
4776
+ return [];
4777
+ }
4773
4778
  return result;
4774
4779
  };
4775
4780
  const { debug = true, apiKey, ...rest } = opts;
package/dist/index.mjs CHANGED
@@ -4160,7 +4160,9 @@ var paykitPayment$InboundSchema = (intent) => {
4160
4160
  customer: intent.customer ?? "",
4161
4161
  status: stripeToPaykitStatus(intent.status),
4162
4162
  metadata: omitInternalMetadata(intent.metadata ?? {}),
4163
- item_id: itemId
4163
+ item_id: itemId,
4164
+ requires_action: intent.status === "requires_action" || intent.status === "requires_confirmation",
4165
+ payment_url: intent.next_action?.redirect_to_url?.url ?? null
4164
4166
  };
4165
4167
  };
4166
4168
  var paykitRefund$InboundSchema = (refund) => {
@@ -4371,6 +4373,7 @@ var StripeProvider = class extends AbstractPayKitProvider {
4371
4373
  throw ValidationError.fromZodError(error, this.providerName, "updateSubscription");
4372
4374
  }
4373
4375
  const updatedSubscription = await this.stripe.subscriptions.update(id, {
4376
+ ...data.provider_metadata && { ...data.provider_metadata },
4374
4377
  metadata: stringifyMetadataValues(data.metadata ?? {})
4375
4378
  });
4376
4379
  return paykitSubscription$InboundSchema(updatedSubscription);
@@ -4760,10 +4763,12 @@ var StripeProvider = class extends AbstractPayKitProvider {
4760
4763
  provider: this.providerName
4761
4764
  });
4762
4765
  const result = await handler(event);
4763
- if (!result)
4764
- throw new WebhookError(`Unhandled event type: ${event.type}`, {
4765
- provider: this.providerName
4766
- });
4766
+ if (!result) {
4767
+ console.log(
4768
+ `Skipping event ${event.type} for provider: ${this.providerName} as no action needed`
4769
+ );
4770
+ return [];
4771
+ }
4767
4772
  return result;
4768
4773
  };
4769
4774
  const { debug = true, apiKey, ...rest } = opts;
@@ -4166,7 +4166,9 @@ var paykitPayment$InboundSchema = (intent) => {
4166
4166
  customer: intent.customer ?? "",
4167
4167
  status: stripeToPaykitStatus(intent.status),
4168
4168
  metadata: core.omitInternalMetadata(intent.metadata ?? {}),
4169
- item_id: itemId
4169
+ item_id: itemId,
4170
+ requires_action: intent.status === "requires_action" || intent.status === "requires_confirmation",
4171
+ payment_url: intent.next_action?.redirect_to_url?.url ?? null
4170
4172
  };
4171
4173
  };
4172
4174
  var paykitRefund$InboundSchema = (refund) => {
@@ -4377,6 +4379,7 @@ var StripeProvider = class extends core.AbstractPayKitProvider {
4377
4379
  throw core.ValidationError.fromZodError(error, this.providerName, "updateSubscription");
4378
4380
  }
4379
4381
  const updatedSubscription = await this.stripe.subscriptions.update(id, {
4382
+ ...data.provider_metadata && { ...data.provider_metadata },
4380
4383
  metadata: core.stringifyMetadataValues(data.metadata ?? {})
4381
4384
  });
4382
4385
  return paykitSubscription$InboundSchema(updatedSubscription);
@@ -4766,10 +4769,12 @@ var StripeProvider = class extends core.AbstractPayKitProvider {
4766
4769
  provider: this.providerName
4767
4770
  });
4768
4771
  const result = await handler(event);
4769
- if (!result)
4770
- throw new core.WebhookError(`Unhandled event type: ${event.type}`, {
4771
- provider: this.providerName
4772
- });
4772
+ if (!result) {
4773
+ console.log(
4774
+ `Skipping event ${event.type} for provider: ${this.providerName} as no action needed`
4775
+ );
4776
+ return [];
4777
+ }
4773
4778
  return result;
4774
4779
  };
4775
4780
  const { debug = true, apiKey, ...rest } = opts;
@@ -4160,7 +4160,9 @@ var paykitPayment$InboundSchema = (intent) => {
4160
4160
  customer: intent.customer ?? "",
4161
4161
  status: stripeToPaykitStatus(intent.status),
4162
4162
  metadata: omitInternalMetadata(intent.metadata ?? {}),
4163
- item_id: itemId
4163
+ item_id: itemId,
4164
+ requires_action: intent.status === "requires_action" || intent.status === "requires_confirmation",
4165
+ payment_url: intent.next_action?.redirect_to_url?.url ?? null
4164
4166
  };
4165
4167
  };
4166
4168
  var paykitRefund$InboundSchema = (refund) => {
@@ -4371,6 +4373,7 @@ var StripeProvider = class extends AbstractPayKitProvider {
4371
4373
  throw ValidationError.fromZodError(error, this.providerName, "updateSubscription");
4372
4374
  }
4373
4375
  const updatedSubscription = await this.stripe.subscriptions.update(id, {
4376
+ ...data.provider_metadata && { ...data.provider_metadata },
4374
4377
  metadata: stringifyMetadataValues(data.metadata ?? {})
4375
4378
  });
4376
4379
  return paykitSubscription$InboundSchema(updatedSubscription);
@@ -4760,10 +4763,12 @@ var StripeProvider = class extends AbstractPayKitProvider {
4760
4763
  provider: this.providerName
4761
4764
  });
4762
4765
  const result = await handler(event);
4763
- if (!result)
4764
- throw new WebhookError(`Unhandled event type: ${event.type}`, {
4765
- provider: this.providerName
4766
- });
4766
+ if (!result) {
4767
+ console.log(
4768
+ `Skipping event ${event.type} for provider: ${this.providerName} as no action needed`
4769
+ );
4770
+ return [];
4771
+ }
4767
4772
  return result;
4768
4773
  };
4769
4774
  const { debug = true, apiKey, ...rest } = opts;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paykit-sdk/stripe",
3
- "version": "1.1.96",
3
+ "version": "1.1.98",
4
4
  "description": "Stripe provider for PayKit",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -20,13 +20,13 @@
20
20
  "stripe": "^18.2.1"
21
21
  },
22
22
  "peerDependencies": {
23
- "@paykit-sdk/core": ">=1.1.96"
23
+ "@paykit-sdk/core": ">=1.1.98"
24
24
  },
25
25
  "devDependencies": {
26
26
  "tsup": "^8.0.0",
27
27
  "typescript": "^5.0.0",
28
28
  "zod": "^3.24.2",
29
- "@paykit-sdk/core": "1.1.96"
29
+ "@paykit-sdk/core": "1.1.98"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"