@forklaunch/implementation-billing-stripe 1.1.29 → 1.1.31
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/lib/eject/services/plan.service.ts +4 -1
- package/lib/eject/services/webhook.service.ts +31 -6
- package/lib/persistence/entities/index.js +107 -0
- package/lib/persistence/entities/index.mjs +77 -0
- package/lib/services/index.js +10 -75
- package/lib/services/index.mjs +10 -75
- package/lib/services/plan.service.d.ts.map +1 -1
- package/lib/services/webhook.service.d.ts.map +1 -1
- package/package.json +22 -11
|
@@ -155,7 +155,10 @@ export class StripePlanService<
|
|
|
155
155
|
await this.stripeClient.plans.del(planEntity.externalId);
|
|
156
156
|
let updatedPlan = await this.stripeClient.plans.create({
|
|
157
157
|
...planDto.stripeFields,
|
|
158
|
-
interval:
|
|
158
|
+
interval:
|
|
159
|
+
planDto.cadence ??
|
|
160
|
+
// a fetched plan's interval was valid at creation, so it round-trips
|
|
161
|
+
(existingPlan.interval as Stripe.PlanCreateParams.Interval),
|
|
159
162
|
currency: planDto.currency ?? existingPlan.currency,
|
|
160
163
|
amount: planDto.price ?? existingPlan.amount ?? undefined,
|
|
161
164
|
product: productId
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
OpenTelemetryCollector
|
|
4
4
|
} from '@forklaunch/core/http';
|
|
5
5
|
import { AnySchemaValidator } from '@forklaunch/validator';
|
|
6
|
-
import { EntityManager } from '@mikro-orm/core';
|
|
6
|
+
import { EntityManager, EntityName, InferEntity } from '@mikro-orm/core';
|
|
7
7
|
import Stripe from 'stripe';
|
|
8
8
|
import { BillingProviderEnum } from '../domain/enum/billingProvider.enum';
|
|
9
9
|
import { CurrencyEnum } from '../domain/enum/currency.enum';
|
|
@@ -18,11 +18,30 @@ import {
|
|
|
18
18
|
} from '../domain/types/stripe.entity.types';
|
|
19
19
|
import { StripeWebhookEvent } from '../persistence/entities';
|
|
20
20
|
import { StripeBillingPortalService } from './billingPortal.service';
|
|
21
|
+
|
|
21
22
|
import { StripeCheckoutSessionService } from './checkoutSession.service';
|
|
22
23
|
import { StripePaymentLinkService } from './paymentLink.service';
|
|
23
24
|
import { StripePlanService } from './plan.service';
|
|
24
25
|
import { StripeSubscriptionService } from './subscription.service';
|
|
25
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Webhook idempotency records are looked up and written BY NAME so they
|
|
29
|
+
* resolve against the consuming application's discovered metadata. Passing
|
|
30
|
+
* this package's internal `StripeWebhookEvent` object to the EntityManager
|
|
31
|
+
* queries an entity the app's ORM never discovered, which mikro-orm 7.1.x
|
|
32
|
+
* rejects deep in EntityLoader (`meta.relations` is undefined for
|
|
33
|
+
* undiscovered entities). Applications must discover an entity named
|
|
34
|
+
* `StripeWebhookEvent` — either their own definition (the blueprint app
|
|
35
|
+
* ships one) or this package's, importable from
|
|
36
|
+
* `@forklaunch/implementation-billing-stripe/persistence`.
|
|
37
|
+
*/
|
|
38
|
+
type StripeWebhookEventEntity = InferEntity<typeof StripeWebhookEvent>;
|
|
39
|
+
// mikro-orm 7 narrowed EntityName's type to exclude strings, but the runtime
|
|
40
|
+
// resolves registered entity names as it always has — and name resolution is
|
|
41
|
+
// exactly what we need here (see above).
|
|
42
|
+
const STRIPE_WEBHOOK_EVENT_ENTITY =
|
|
43
|
+
'StripeWebhookEvent' as unknown as EntityName<StripeWebhookEventEntity>;
|
|
44
|
+
|
|
26
45
|
export class StripeWebhookService<
|
|
27
46
|
SchemaValidator extends AnySchemaValidator,
|
|
28
47
|
StatusEnum,
|
|
@@ -154,9 +173,12 @@ export class StripeWebhookService<
|
|
|
154
173
|
}
|
|
155
174
|
|
|
156
175
|
if (
|
|
157
|
-
await this.em.findOne(
|
|
158
|
-
|
|
159
|
-
|
|
176
|
+
await this.em.findOne<StripeWebhookEventEntity>(
|
|
177
|
+
STRIPE_WEBHOOK_EVENT_ENTITY,
|
|
178
|
+
{
|
|
179
|
+
idempotencyKey: event.request?.idempotency_key
|
|
180
|
+
}
|
|
181
|
+
)
|
|
160
182
|
) {
|
|
161
183
|
this.openTelemetryCollector.info(
|
|
162
184
|
'Webhook event already processed',
|
|
@@ -472,12 +494,15 @@ export class StripeWebhookService<
|
|
|
472
494
|
break;
|
|
473
495
|
}
|
|
474
496
|
|
|
475
|
-
|
|
497
|
+
// em.create (not native em.insert): the app's entity generates its id and
|
|
498
|
+
// timestamps via onCreate hooks, which native inserts bypass — a native
|
|
499
|
+
// insert fails NOT NULL on id for sqlBaseProperties-style entities.
|
|
500
|
+
this.em.create<StripeWebhookEventEntity>(STRIPE_WEBHOOK_EVENT_ENTITY, {
|
|
476
501
|
stripeId: event.id,
|
|
477
502
|
idempotencyKey: event.request?.idempotency_key,
|
|
478
503
|
eventType: event.type,
|
|
479
504
|
eventData: event.data
|
|
480
|
-
});
|
|
505
|
+
} as never);
|
|
481
506
|
await this.em.flush();
|
|
482
507
|
}
|
|
483
508
|
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// persistence/entities/index.ts
|
|
21
|
+
var entities_exports = {};
|
|
22
|
+
__export(entities_exports, {
|
|
23
|
+
BillingPortal: () => BillingPortal,
|
|
24
|
+
CheckoutSession: () => CheckoutSession,
|
|
25
|
+
PaymentLink: () => PaymentLink,
|
|
26
|
+
Plan: () => Plan,
|
|
27
|
+
StripeWebhookEvent: () => StripeWebhookEvent,
|
|
28
|
+
Subscription: () => Subscription
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(entities_exports);
|
|
31
|
+
var import_persistence = require("@forklaunch/core/persistence");
|
|
32
|
+
var BillingPortal = (0, import_persistence.defineComplianceEntity)({
|
|
33
|
+
name: "BillingPortal",
|
|
34
|
+
properties: {
|
|
35
|
+
id: import_persistence.fp.string().primary().compliance("none"),
|
|
36
|
+
customerId: import_persistence.fp.string().compliance("none"),
|
|
37
|
+
providerFields: import_persistence.fp.json().compliance("pci")
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
var CheckoutSession = (0, import_persistence.defineComplianceEntity)({
|
|
41
|
+
name: "CheckoutSession",
|
|
42
|
+
properties: {
|
|
43
|
+
id: import_persistence.fp.string().primary().compliance("none"),
|
|
44
|
+
customerId: import_persistence.fp.string().compliance("none"),
|
|
45
|
+
paymentMethods: import_persistence.fp.enum().array().compliance("none"),
|
|
46
|
+
currency: import_persistence.fp.enum().compliance("none"),
|
|
47
|
+
status: import_persistence.fp.enum().compliance("none"),
|
|
48
|
+
providerFields: import_persistence.fp.json().compliance("pci")
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
var PaymentLink = (0, import_persistence.defineComplianceEntity)({
|
|
52
|
+
name: "PaymentLink",
|
|
53
|
+
properties: {
|
|
54
|
+
id: import_persistence.fp.string().primary().compliance("none"),
|
|
55
|
+
amount: import_persistence.fp.double().compliance("none"),
|
|
56
|
+
paymentMethods: import_persistence.fp.enum().array().compliance("none"),
|
|
57
|
+
currency: import_persistence.fp.enum().compliance("none"),
|
|
58
|
+
status: import_persistence.fp.enum().compliance("none"),
|
|
59
|
+
providerFields: import_persistence.fp.json().compliance("pci")
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
var Plan = (0, import_persistence.defineComplianceEntity)({
|
|
63
|
+
name: "Plan",
|
|
64
|
+
properties: {
|
|
65
|
+
id: import_persistence.fp.string().primary().compliance("none"),
|
|
66
|
+
name: import_persistence.fp.string().compliance("none"),
|
|
67
|
+
price: import_persistence.fp.double().compliance("none"),
|
|
68
|
+
externalId: import_persistence.fp.string().compliance("none"),
|
|
69
|
+
cadence: import_persistence.fp.enum().compliance("none"),
|
|
70
|
+
currency: import_persistence.fp.enum().compliance("none"),
|
|
71
|
+
billingProvider: import_persistence.fp.enum().nullable().compliance("none"),
|
|
72
|
+
providerFields: import_persistence.fp.json().compliance("pci")
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
var Subscription = (0, import_persistence.defineComplianceEntity)({
|
|
76
|
+
name: "Subscription",
|
|
77
|
+
properties: {
|
|
78
|
+
id: import_persistence.fp.string().primary().compliance("none"),
|
|
79
|
+
partyId: import_persistence.fp.string().compliance("none"),
|
|
80
|
+
externalId: import_persistence.fp.string().compliance("none"),
|
|
81
|
+
partyType: import_persistence.fp.enum().compliance("none"),
|
|
82
|
+
billingProvider: import_persistence.fp.enum().nullable().compliance("none"),
|
|
83
|
+
active: import_persistence.fp.boolean().compliance("none"),
|
|
84
|
+
providerFields: import_persistence.fp.json().compliance("pci")
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
var StripeWebhookEvent = (0, import_persistence.defineComplianceEntity)({
|
|
88
|
+
name: "StripeWebhookEvent",
|
|
89
|
+
properties: {
|
|
90
|
+
id: import_persistence.fp.uuid().primary().compliance("none"),
|
|
91
|
+
createdAt: import_persistence.fp.datetime().onCreate(() => /* @__PURE__ */ new Date()).compliance("none"),
|
|
92
|
+
updatedAt: import_persistence.fp.datetime().onCreate(() => /* @__PURE__ */ new Date()).onUpdate(() => /* @__PURE__ */ new Date()).compliance("none"),
|
|
93
|
+
stripeId: import_persistence.fp.string().compliance("none"),
|
|
94
|
+
idempotencyKey: import_persistence.fp.string().nullable().compliance("none"),
|
|
95
|
+
eventType: import_persistence.fp.string().compliance("none"),
|
|
96
|
+
eventData: import_persistence.fp.json().compliance("pci")
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
100
|
+
0 && (module.exports = {
|
|
101
|
+
BillingPortal,
|
|
102
|
+
CheckoutSession,
|
|
103
|
+
PaymentLink,
|
|
104
|
+
Plan,
|
|
105
|
+
StripeWebhookEvent,
|
|
106
|
+
Subscription
|
|
107
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// persistence/entities/index.ts
|
|
2
|
+
import { defineComplianceEntity, fp } from "@forklaunch/core/persistence";
|
|
3
|
+
var BillingPortal = defineComplianceEntity({
|
|
4
|
+
name: "BillingPortal",
|
|
5
|
+
properties: {
|
|
6
|
+
id: fp.string().primary().compliance("none"),
|
|
7
|
+
customerId: fp.string().compliance("none"),
|
|
8
|
+
providerFields: fp.json().compliance("pci")
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var CheckoutSession = defineComplianceEntity({
|
|
12
|
+
name: "CheckoutSession",
|
|
13
|
+
properties: {
|
|
14
|
+
id: fp.string().primary().compliance("none"),
|
|
15
|
+
customerId: fp.string().compliance("none"),
|
|
16
|
+
paymentMethods: fp.enum().array().compliance("none"),
|
|
17
|
+
currency: fp.enum().compliance("none"),
|
|
18
|
+
status: fp.enum().compliance("none"),
|
|
19
|
+
providerFields: fp.json().compliance("pci")
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
var PaymentLink = defineComplianceEntity({
|
|
23
|
+
name: "PaymentLink",
|
|
24
|
+
properties: {
|
|
25
|
+
id: fp.string().primary().compliance("none"),
|
|
26
|
+
amount: fp.double().compliance("none"),
|
|
27
|
+
paymentMethods: fp.enum().array().compliance("none"),
|
|
28
|
+
currency: fp.enum().compliance("none"),
|
|
29
|
+
status: fp.enum().compliance("none"),
|
|
30
|
+
providerFields: fp.json().compliance("pci")
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
var Plan = defineComplianceEntity({
|
|
34
|
+
name: "Plan",
|
|
35
|
+
properties: {
|
|
36
|
+
id: fp.string().primary().compliance("none"),
|
|
37
|
+
name: fp.string().compliance("none"),
|
|
38
|
+
price: fp.double().compliance("none"),
|
|
39
|
+
externalId: fp.string().compliance("none"),
|
|
40
|
+
cadence: fp.enum().compliance("none"),
|
|
41
|
+
currency: fp.enum().compliance("none"),
|
|
42
|
+
billingProvider: fp.enum().nullable().compliance("none"),
|
|
43
|
+
providerFields: fp.json().compliance("pci")
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
var Subscription = defineComplianceEntity({
|
|
47
|
+
name: "Subscription",
|
|
48
|
+
properties: {
|
|
49
|
+
id: fp.string().primary().compliance("none"),
|
|
50
|
+
partyId: fp.string().compliance("none"),
|
|
51
|
+
externalId: fp.string().compliance("none"),
|
|
52
|
+
partyType: fp.enum().compliance("none"),
|
|
53
|
+
billingProvider: fp.enum().nullable().compliance("none"),
|
|
54
|
+
active: fp.boolean().compliance("none"),
|
|
55
|
+
providerFields: fp.json().compliance("pci")
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
var StripeWebhookEvent = defineComplianceEntity({
|
|
59
|
+
name: "StripeWebhookEvent",
|
|
60
|
+
properties: {
|
|
61
|
+
id: fp.uuid().primary().compliance("none"),
|
|
62
|
+
createdAt: fp.datetime().onCreate(() => /* @__PURE__ */ new Date()).compliance("none"),
|
|
63
|
+
updatedAt: fp.datetime().onCreate(() => /* @__PURE__ */ new Date()).onUpdate(() => /* @__PURE__ */ new Date()).compliance("none"),
|
|
64
|
+
stripeId: fp.string().compliance("none"),
|
|
65
|
+
idempotencyKey: fp.string().nullable().compliance("none"),
|
|
66
|
+
eventType: fp.string().compliance("none"),
|
|
67
|
+
eventData: fp.json().compliance("pci")
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
export {
|
|
71
|
+
BillingPortal,
|
|
72
|
+
CheckoutSession,
|
|
73
|
+
PaymentLink,
|
|
74
|
+
Plan,
|
|
75
|
+
StripeWebhookEvent,
|
|
76
|
+
Subscription
|
|
77
|
+
};
|
package/lib/services/index.js
CHANGED
|
@@ -392,7 +392,8 @@ var StripePlanService = class {
|
|
|
392
392
|
await this.stripeClient.plans.del(planEntity.externalId);
|
|
393
393
|
let updatedPlan = await this.stripeClient.plans.create({
|
|
394
394
|
...planDto.stripeFields,
|
|
395
|
-
interval: planDto.cadence ??
|
|
395
|
+
interval: planDto.cadence ?? // a fetched plan's interval was valid at creation, so it round-trips
|
|
396
|
+
existingPlan.interval,
|
|
396
397
|
currency: planDto.currency ?? existingPlan.currency,
|
|
397
398
|
amount: planDto.price ?? existingPlan.amount ?? void 0,
|
|
398
399
|
product: productId
|
|
@@ -625,77 +626,8 @@ var BillingProviderEnum = {
|
|
|
625
626
|
STRIPE: "stripe"
|
|
626
627
|
};
|
|
627
628
|
|
|
628
|
-
// persistence/entities/index.ts
|
|
629
|
-
var import_persistence = require("@forklaunch/core/persistence");
|
|
630
|
-
var BillingPortal = (0, import_persistence.defineComplianceEntity)({
|
|
631
|
-
name: "BillingPortal",
|
|
632
|
-
properties: {
|
|
633
|
-
id: import_persistence.fp.string().primary().compliance("none"),
|
|
634
|
-
customerId: import_persistence.fp.string().compliance("none"),
|
|
635
|
-
providerFields: import_persistence.fp.json().compliance("pci")
|
|
636
|
-
}
|
|
637
|
-
});
|
|
638
|
-
var CheckoutSession = (0, import_persistence.defineComplianceEntity)({
|
|
639
|
-
name: "CheckoutSession",
|
|
640
|
-
properties: {
|
|
641
|
-
id: import_persistence.fp.string().primary().compliance("none"),
|
|
642
|
-
customerId: import_persistence.fp.string().compliance("none"),
|
|
643
|
-
paymentMethods: import_persistence.fp.enum().array().compliance("none"),
|
|
644
|
-
currency: import_persistence.fp.enum().compliance("none"),
|
|
645
|
-
status: import_persistence.fp.enum().compliance("none"),
|
|
646
|
-
providerFields: import_persistence.fp.json().compliance("pci")
|
|
647
|
-
}
|
|
648
|
-
});
|
|
649
|
-
var PaymentLink = (0, import_persistence.defineComplianceEntity)({
|
|
650
|
-
name: "PaymentLink",
|
|
651
|
-
properties: {
|
|
652
|
-
id: import_persistence.fp.string().primary().compliance("none"),
|
|
653
|
-
amount: import_persistence.fp.double().compliance("none"),
|
|
654
|
-
paymentMethods: import_persistence.fp.enum().array().compliance("none"),
|
|
655
|
-
currency: import_persistence.fp.enum().compliance("none"),
|
|
656
|
-
status: import_persistence.fp.enum().compliance("none"),
|
|
657
|
-
providerFields: import_persistence.fp.json().compliance("pci")
|
|
658
|
-
}
|
|
659
|
-
});
|
|
660
|
-
var Plan = (0, import_persistence.defineComplianceEntity)({
|
|
661
|
-
name: "Plan",
|
|
662
|
-
properties: {
|
|
663
|
-
id: import_persistence.fp.string().primary().compliance("none"),
|
|
664
|
-
name: import_persistence.fp.string().compliance("none"),
|
|
665
|
-
price: import_persistence.fp.double().compliance("none"),
|
|
666
|
-
externalId: import_persistence.fp.string().compliance("none"),
|
|
667
|
-
cadence: import_persistence.fp.enum().compliance("none"),
|
|
668
|
-
currency: import_persistence.fp.enum().compliance("none"),
|
|
669
|
-
billingProvider: import_persistence.fp.enum().nullable().compliance("none"),
|
|
670
|
-
providerFields: import_persistence.fp.json().compliance("pci")
|
|
671
|
-
}
|
|
672
|
-
});
|
|
673
|
-
var Subscription = (0, import_persistence.defineComplianceEntity)({
|
|
674
|
-
name: "Subscription",
|
|
675
|
-
properties: {
|
|
676
|
-
id: import_persistence.fp.string().primary().compliance("none"),
|
|
677
|
-
partyId: import_persistence.fp.string().compliance("none"),
|
|
678
|
-
externalId: import_persistence.fp.string().compliance("none"),
|
|
679
|
-
partyType: import_persistence.fp.enum().compliance("none"),
|
|
680
|
-
billingProvider: import_persistence.fp.enum().nullable().compliance("none"),
|
|
681
|
-
active: import_persistence.fp.boolean().compliance("none"),
|
|
682
|
-
providerFields: import_persistence.fp.json().compliance("pci")
|
|
683
|
-
}
|
|
684
|
-
});
|
|
685
|
-
var StripeWebhookEvent = (0, import_persistence.defineComplianceEntity)({
|
|
686
|
-
name: "StripeWebhookEvent",
|
|
687
|
-
properties: {
|
|
688
|
-
id: import_persistence.fp.uuid().primary().compliance("none"),
|
|
689
|
-
createdAt: import_persistence.fp.datetime().onCreate(() => /* @__PURE__ */ new Date()).compliance("none"),
|
|
690
|
-
updatedAt: import_persistence.fp.datetime().onCreate(() => /* @__PURE__ */ new Date()).onUpdate(() => /* @__PURE__ */ new Date()).compliance("none"),
|
|
691
|
-
stripeId: import_persistence.fp.string().compliance("none"),
|
|
692
|
-
idempotencyKey: import_persistence.fp.string().nullable().compliance("none"),
|
|
693
|
-
eventType: import_persistence.fp.string().compliance("none"),
|
|
694
|
-
eventData: import_persistence.fp.json().compliance("pci")
|
|
695
|
-
}
|
|
696
|
-
});
|
|
697
|
-
|
|
698
629
|
// services/webhook.service.ts
|
|
630
|
+
var STRIPE_WEBHOOK_EVENT_ENTITY = "StripeWebhookEvent";
|
|
699
631
|
var StripeWebhookService = class {
|
|
700
632
|
partyEnum;
|
|
701
633
|
stripeClient;
|
|
@@ -753,9 +685,12 @@ var StripeWebhookService = class {
|
|
|
753
685
|
if (this.openTelemetryCollector) {
|
|
754
686
|
this.openTelemetryCollector.info("Handling webhook event", event);
|
|
755
687
|
}
|
|
756
|
-
if (await this.em.findOne(
|
|
757
|
-
|
|
758
|
-
|
|
688
|
+
if (await this.em.findOne(
|
|
689
|
+
STRIPE_WEBHOOK_EVENT_ENTITY,
|
|
690
|
+
{
|
|
691
|
+
idempotencyKey: event.request?.idempotency_key
|
|
692
|
+
}
|
|
693
|
+
)) {
|
|
759
694
|
this.openTelemetryCollector.info(
|
|
760
695
|
"Webhook event already processed",
|
|
761
696
|
event
|
|
@@ -998,7 +933,7 @@ var StripeWebhookService = class {
|
|
|
998
933
|
);
|
|
999
934
|
break;
|
|
1000
935
|
}
|
|
1001
|
-
|
|
936
|
+
this.em.create(STRIPE_WEBHOOK_EVENT_ENTITY, {
|
|
1002
937
|
stripeId: event.id,
|
|
1003
938
|
idempotencyKey: event.request?.idempotency_key,
|
|
1004
939
|
eventType: event.type,
|
package/lib/services/index.mjs
CHANGED
|
@@ -360,7 +360,8 @@ var StripePlanService = class {
|
|
|
360
360
|
await this.stripeClient.plans.del(planEntity.externalId);
|
|
361
361
|
let updatedPlan = await this.stripeClient.plans.create({
|
|
362
362
|
...planDto.stripeFields,
|
|
363
|
-
interval: planDto.cadence ??
|
|
363
|
+
interval: planDto.cadence ?? // a fetched plan's interval was valid at creation, so it round-trips
|
|
364
|
+
existingPlan.interval,
|
|
364
365
|
currency: planDto.currency ?? existingPlan.currency,
|
|
365
366
|
amount: planDto.price ?? existingPlan.amount ?? void 0,
|
|
366
367
|
product: productId
|
|
@@ -593,77 +594,8 @@ var BillingProviderEnum = {
|
|
|
593
594
|
STRIPE: "stripe"
|
|
594
595
|
};
|
|
595
596
|
|
|
596
|
-
// persistence/entities/index.ts
|
|
597
|
-
import { defineComplianceEntity, fp } from "@forklaunch/core/persistence";
|
|
598
|
-
var BillingPortal = defineComplianceEntity({
|
|
599
|
-
name: "BillingPortal",
|
|
600
|
-
properties: {
|
|
601
|
-
id: fp.string().primary().compliance("none"),
|
|
602
|
-
customerId: fp.string().compliance("none"),
|
|
603
|
-
providerFields: fp.json().compliance("pci")
|
|
604
|
-
}
|
|
605
|
-
});
|
|
606
|
-
var CheckoutSession = defineComplianceEntity({
|
|
607
|
-
name: "CheckoutSession",
|
|
608
|
-
properties: {
|
|
609
|
-
id: fp.string().primary().compliance("none"),
|
|
610
|
-
customerId: fp.string().compliance("none"),
|
|
611
|
-
paymentMethods: fp.enum().array().compliance("none"),
|
|
612
|
-
currency: fp.enum().compliance("none"),
|
|
613
|
-
status: fp.enum().compliance("none"),
|
|
614
|
-
providerFields: fp.json().compliance("pci")
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
|
-
var PaymentLink = defineComplianceEntity({
|
|
618
|
-
name: "PaymentLink",
|
|
619
|
-
properties: {
|
|
620
|
-
id: fp.string().primary().compliance("none"),
|
|
621
|
-
amount: fp.double().compliance("none"),
|
|
622
|
-
paymentMethods: fp.enum().array().compliance("none"),
|
|
623
|
-
currency: fp.enum().compliance("none"),
|
|
624
|
-
status: fp.enum().compliance("none"),
|
|
625
|
-
providerFields: fp.json().compliance("pci")
|
|
626
|
-
}
|
|
627
|
-
});
|
|
628
|
-
var Plan = defineComplianceEntity({
|
|
629
|
-
name: "Plan",
|
|
630
|
-
properties: {
|
|
631
|
-
id: fp.string().primary().compliance("none"),
|
|
632
|
-
name: fp.string().compliance("none"),
|
|
633
|
-
price: fp.double().compliance("none"),
|
|
634
|
-
externalId: fp.string().compliance("none"),
|
|
635
|
-
cadence: fp.enum().compliance("none"),
|
|
636
|
-
currency: fp.enum().compliance("none"),
|
|
637
|
-
billingProvider: fp.enum().nullable().compliance("none"),
|
|
638
|
-
providerFields: fp.json().compliance("pci")
|
|
639
|
-
}
|
|
640
|
-
});
|
|
641
|
-
var Subscription = defineComplianceEntity({
|
|
642
|
-
name: "Subscription",
|
|
643
|
-
properties: {
|
|
644
|
-
id: fp.string().primary().compliance("none"),
|
|
645
|
-
partyId: fp.string().compliance("none"),
|
|
646
|
-
externalId: fp.string().compliance("none"),
|
|
647
|
-
partyType: fp.enum().compliance("none"),
|
|
648
|
-
billingProvider: fp.enum().nullable().compliance("none"),
|
|
649
|
-
active: fp.boolean().compliance("none"),
|
|
650
|
-
providerFields: fp.json().compliance("pci")
|
|
651
|
-
}
|
|
652
|
-
});
|
|
653
|
-
var StripeWebhookEvent = defineComplianceEntity({
|
|
654
|
-
name: "StripeWebhookEvent",
|
|
655
|
-
properties: {
|
|
656
|
-
id: fp.uuid().primary().compliance("none"),
|
|
657
|
-
createdAt: fp.datetime().onCreate(() => /* @__PURE__ */ new Date()).compliance("none"),
|
|
658
|
-
updatedAt: fp.datetime().onCreate(() => /* @__PURE__ */ new Date()).onUpdate(() => /* @__PURE__ */ new Date()).compliance("none"),
|
|
659
|
-
stripeId: fp.string().compliance("none"),
|
|
660
|
-
idempotencyKey: fp.string().nullable().compliance("none"),
|
|
661
|
-
eventType: fp.string().compliance("none"),
|
|
662
|
-
eventData: fp.json().compliance("pci")
|
|
663
|
-
}
|
|
664
|
-
});
|
|
665
|
-
|
|
666
597
|
// services/webhook.service.ts
|
|
598
|
+
var STRIPE_WEBHOOK_EVENT_ENTITY = "StripeWebhookEvent";
|
|
667
599
|
var StripeWebhookService = class {
|
|
668
600
|
partyEnum;
|
|
669
601
|
stripeClient;
|
|
@@ -721,9 +653,12 @@ var StripeWebhookService = class {
|
|
|
721
653
|
if (this.openTelemetryCollector) {
|
|
722
654
|
this.openTelemetryCollector.info("Handling webhook event", event);
|
|
723
655
|
}
|
|
724
|
-
if (await this.em.findOne(
|
|
725
|
-
|
|
726
|
-
|
|
656
|
+
if (await this.em.findOne(
|
|
657
|
+
STRIPE_WEBHOOK_EVENT_ENTITY,
|
|
658
|
+
{
|
|
659
|
+
idempotencyKey: event.request?.idempotency_key
|
|
660
|
+
}
|
|
661
|
+
)) {
|
|
727
662
|
this.openTelemetryCollector.info(
|
|
728
663
|
"Webhook event already processed",
|
|
729
664
|
event
|
|
@@ -966,7 +901,7 @@ var StripeWebhookService = class {
|
|
|
966
901
|
);
|
|
967
902
|
break;
|
|
968
903
|
}
|
|
969
|
-
|
|
904
|
+
this.em.create(STRIPE_WEBHOOK_EVENT_ENTITY, {
|
|
970
905
|
stripeId: event.id,
|
|
971
906
|
idempotencyKey: event.request?.idempotency_key,
|
|
972
907
|
eventType: event.type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.service.d.ts","sourceRoot":"","sources":["../../services/plan.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,oBA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Y,CAAC,EAAE,CAAC,CA6B9B;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.service.d.ts","sourceRoot":"","sources":["../../services/webhook.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"webhook.service.d.ts","sourceRoot":"","sources":["../../services/webhook.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAA2B,MAAM,iBAAiB,CAAC;AACzE,OAAO,MAAM,MAAM,QAAQ,CAAC;AAK5B,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,kBAAkB,EAClB,0BAA0B,EAC3B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAoBnE,qBAAa,oBAAoB,CAC/B,eAAe,SAAS,kBAAkB,EAC1C,UAAU,EACV,SAAS,EACT,qBAAqB,SACnB,2BAA2B,GAAG,2BAA2B,EAC3D,uBAAuB,SACrB,6BAA6B,CAAC,UAAU,CAAC,GAAG,6BAA6B,CAAC,UAAU,CAAC,EACvF,mBAAmB,SACjB,yBAAyB,CAAC,UAAU,CAAC,GAAG,yBAAyB,CAAC,UAAU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AAmB,CACpB,EACD,WAAW,EAAE,iBAAiB,CAAC,eAAe,EAAE,YAAY,CAAC,EAC7D,mBAAmB,EAAE,yBAAyB,CAC5C,eAAe,EACf,SAAS,EACT,oBAAoB,CACrB,EACD,SAAS,EAAE,SAAS,EAYrB;IAED;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC,MAAM,SAAS,CAAC,CAO3E;IAED;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;IAsB5B,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAiV3D;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forklaunch/implementation-billing-stripe",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.31",
|
|
4
4
|
"description": "Stripe implementation for forklaunch billing",
|
|
5
5
|
"homepage": "https://github.com/forklaunch/forklaunch-js#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -48,35 +48,46 @@
|
|
|
48
48
|
},
|
|
49
49
|
"./types/*": {
|
|
50
50
|
"types": "./lib/domain/types/*.d.ts"
|
|
51
|
+
},
|
|
52
|
+
"./persistence": {
|
|
53
|
+
"types": "./lib/persistence/entities/index.d.ts",
|
|
54
|
+
"import": "./lib/persistence/entities/index.mjs",
|
|
55
|
+
"require": "./lib/persistence/entities/index.js",
|
|
56
|
+
"default": "./lib/persistence/entities/index.js"
|
|
57
|
+
},
|
|
58
|
+
"./persistence/*": {
|
|
59
|
+
"types": "./lib/persistence/entities/*.d.ts"
|
|
51
60
|
}
|
|
52
61
|
},
|
|
53
62
|
"files": [
|
|
54
63
|
"lib/**"
|
|
55
64
|
],
|
|
56
65
|
"dependencies": {
|
|
57
|
-
"@forklaunch/common": "^1.2.
|
|
58
|
-
"@forklaunch/core": "^1.5.
|
|
59
|
-
"@forklaunch/internal": "^1.2.
|
|
60
|
-
"@forklaunch/validator": "^1.2.
|
|
61
|
-
"@mikro-orm/core": "7.1.
|
|
66
|
+
"@forklaunch/common": "^1.2.23",
|
|
67
|
+
"@forklaunch/core": "^1.5.12",
|
|
68
|
+
"@forklaunch/internal": "^1.2.24",
|
|
69
|
+
"@forklaunch/validator": "^1.2.24",
|
|
70
|
+
"@mikro-orm/core": "7.1.11",
|
|
62
71
|
"@sinclair/typebox": "^0.34.52",
|
|
63
72
|
"ajv": "^8.20.0",
|
|
64
|
-
"stripe": "^22.
|
|
73
|
+
"stripe": "^22.4.0",
|
|
65
74
|
"zod": "^4.4.3",
|
|
66
|
-
"@forklaunch/implementation-billing-base": "^1.0.
|
|
67
|
-
"@forklaunch/interfaces-billing": "^1.0.
|
|
75
|
+
"@forklaunch/implementation-billing-base": "^1.0.30",
|
|
76
|
+
"@forklaunch/interfaces-billing": "^1.0.30"
|
|
68
77
|
},
|
|
69
78
|
"devDependencies": {
|
|
70
79
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
71
80
|
"depcheck": "^1.4.7",
|
|
72
81
|
"prettier": "^3.9.6",
|
|
73
|
-
"typedoc": "^0.28.20"
|
|
82
|
+
"typedoc": "^0.28.20",
|
|
83
|
+
"@mikro-orm/sqlite": "7.1.11",
|
|
84
|
+
"uuid": "^14.0.1"
|
|
74
85
|
},
|
|
75
86
|
"publishConfig": {
|
|
76
87
|
"access": "public"
|
|
77
88
|
},
|
|
78
89
|
"scripts": {
|
|
79
|
-
"build": "tsgo --noEmit && tsup domain/schemas/index.ts services/index.ts domain/enum/index.ts domain/types/index.ts --format cjs,esm --no-splitting --tsconfig tsconfig.json --out-dir lib --clean && tsgo -p tsconfig.build.json --emitDeclarationOnly && if [ -f eject-package.bash ]; then pnpm package:eject; fi",
|
|
90
|
+
"build": "tsgo --noEmit && tsup persistence/entities/index.ts domain/schemas/index.ts services/index.ts domain/enum/index.ts domain/types/index.ts --format cjs,esm --no-splitting --tsconfig tsconfig.json --out-dir lib --clean && tsgo -p tsconfig.build.json --emitDeclarationOnly && if [ -f eject-package.bash ]; then pnpm package:eject; fi",
|
|
80
91
|
"clean": "rm -rf lib pnpm.lock.yaml node_modules",
|
|
81
92
|
"docs": "typedoc --out docs *",
|
|
82
93
|
"format": "prettier --ignore-path=.prettierignore --config .prettierrc '**/*.{ts,tsx,json}' --write",
|