@darraghor/nest-backend-libs 5.7.4 → 6.0.0
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/README.md +87 -36
- package/dist/cli/commands/WriteApiClientCommand.js +1 -2
- package/dist/cli/commands/WriteApiClientCommand.js.map +1 -1
- package/dist/database-sqlite/SqliteTypeOrmConfigurationProvider.js +5 -4
- package/dist/database-sqlite/SqliteTypeOrmConfigurationProvider.js.map +1 -1
- package/dist/exports/authorization.d.ts +14 -0
- package/dist/exports/authorization.js +12 -0
- package/dist/exports/authorization.js.map +1 -0
- package/dist/exports/core.d.ts +11 -0
- package/dist/exports/core.js +10 -0
- package/dist/exports/core.js.map +1 -0
- package/dist/exports/database.d.ts +5 -0
- package/dist/exports/database.js +6 -0
- package/dist/exports/database.js.map +1 -0
- package/dist/exports/email.d.ts +4 -0
- package/dist/exports/email.js +4 -0
- package/dist/exports/email.js.map +1 -0
- package/dist/exports/invitations.d.ts +6 -0
- package/dist/exports/invitations.js +6 -0
- package/dist/exports/invitations.js.map +1 -0
- package/dist/exports/organisations.d.ts +11 -0
- package/dist/exports/organisations.js +12 -0
- package/dist/exports/organisations.js.map +1 -0
- package/dist/exports/stripe-legacy.d.ts +6 -0
- package/dist/exports/stripe-legacy.js +7 -0
- package/dist/exports/stripe-legacy.js.map +1 -0
- package/dist/exports/stripe.d.ts +11 -0
- package/dist/exports/stripe.js +9 -0
- package/dist/exports/stripe.js.map +1 -0
- package/dist/exports/twitter.d.ts +5 -0
- package/dist/exports/twitter.js +5 -0
- package/dist/exports/twitter.js.map +1 -0
- package/dist/exports/users.d.ts +10 -0
- package/dist/exports/users.js +11 -0
- package/dist/exports/users.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/organisation-subscriptions/entities/organisation-subscription.entity.js +2 -1
- package/dist/organisation-subscriptions/entities/organisation-subscription.entity.js.map +1 -1
- package/dist/stripe-client/StripeClientConfigurationService.js +1 -0
- package/dist/stripe-client/StripeClientConfigurationService.js.map +1 -1
- package/dist/stripe-client/StripeClientProvider.js +1 -1
- package/dist/stripe-client/StripeClientProvider.js.map +1 -1
- package/dist/stripe-client/controllers/stripe-checkout-controller.d.ts +1 -0
- package/dist/stripe-client/controllers/stripe-checkout-controller.js +1 -0
- package/dist/stripe-client/controllers/stripe-checkout-controller.js.map +1 -1
- package/dist/stripe-client/controllers/stripe-events-controller.js +1 -0
- package/dist/stripe-client/controllers/stripe-events-controller.js.map +1 -1
- package/dist/stripe-client/controllers/stripe-unauthenticated-checkout-controller.js +1 -0
- package/dist/stripe-client/controllers/stripe-unauthenticated-checkout-controller.js.map +1 -1
- package/dist/stripe-client/controllers/stripe-webhook-controller.js +1 -4
- package/dist/stripe-client/controllers/stripe-webhook-controller.js.map +1 -1
- package/dist/stripe-client/services/auth-stripe-checkout.service.js +1 -0
- package/dist/stripe-client/services/auth-stripe-checkout.service.js.map +1 -1
- package/dist/stripe-client/services/queued-payment-event.handler.d.ts +1 -0
- package/dist/stripe-client/services/queued-payment-event.handler.js +2 -0
- package/dist/stripe-client/services/queued-payment-event.handler.js.map +1 -1
- package/dist/stripe-client/services/stripe-checkout.service.d.ts +1 -0
- package/dist/stripe-client/services/stripe-checkout.service.js +2 -0
- package/dist/stripe-client/services/stripe-checkout.service.js.map +1 -1
- package/dist/stripe-client/stripe-account.module.d.ts +1 -0
- package/dist/stripe-client/stripe-account.module.js +2 -0
- package/dist/stripe-client/stripe-account.module.js.map +1 -1
- package/dist/stripe-client/stripe-account.options.d.ts +2 -0
- package/dist/stripe-client/stripe-account.options.js.map +1 -1
- package/dist/stripe-payments/controllers/secure-stripe-checkout.controller.d.ts +10 -0
- package/dist/stripe-payments/controllers/secure-stripe-checkout.controller.js +65 -0
- package/dist/stripe-payments/controllers/secure-stripe-checkout.controller.js.map +1 -0
- package/dist/stripe-payments/controllers/secure-stripe-events.controller.d.ts +9 -0
- package/dist/stripe-payments/controllers/secure-stripe-events.controller.js +65 -0
- package/dist/stripe-payments/controllers/secure-stripe-events.controller.js.map +1 -0
- package/dist/stripe-payments/controllers/secure-stripe-webhook.controller.d.ts +14 -0
- package/dist/stripe-payments/controllers/secure-stripe-webhook.controller.js +112 -0
- package/dist/stripe-payments/controllers/secure-stripe-webhook.controller.js.map +1 -0
- package/dist/stripe-payments/entities/stripe-checkout-attempt.entity.d.ts +15 -0
- package/dist/stripe-payments/entities/stripe-checkout-attempt.entity.js +88 -0
- package/dist/stripe-payments/entities/stripe-checkout-attempt.entity.js.map +1 -0
- package/dist/stripe-payments/entities/stripe-payment-event.entity.d.ts +16 -0
- package/dist/stripe-payments/entities/stripe-payment-event.entity.js +101 -0
- package/dist/stripe-payments/entities/stripe-payment-event.entity.js.map +1 -0
- package/dist/stripe-payments/entities/stripe-payment-state.entity.d.ts +9 -0
- package/dist/stripe-payments/entities/stripe-payment-state.entity.js +53 -0
- package/dist/stripe-payments/entities/stripe-payment-state.entity.js.map +1 -0
- package/dist/stripe-payments/models/secure-checkout.dto.d.ts +14 -0
- package/dist/stripe-payments/models/secure-checkout.dto.js +105 -0
- package/dist/stripe-payments/models/secure-checkout.dto.js.map +1 -0
- package/dist/stripe-payments/models/secure-payment-response.dto.d.ts +7 -0
- package/dist/stripe-payments/models/secure-payment-response.dto.js +30 -0
- package/dist/stripe-payments/models/secure-payment-response.dto.js.map +1 -0
- package/dist/stripe-payments/services/default-stripe-payments-entitlement-store.d.ts +12 -0
- package/dist/stripe-payments/services/default-stripe-payments-entitlement-store.js +49 -0
- package/dist/stripe-payments/services/default-stripe-payments-entitlement-store.js.map +1 -0
- package/dist/stripe-payments/services/secure-stripe-checkout.service.d.ts +24 -0
- package/dist/stripe-payments/services/secure-stripe-checkout.service.js +213 -0
- package/dist/stripe-payments/services/secure-stripe-checkout.service.js.map +1 -0
- package/dist/stripe-payments/services/secure-stripe-client.provider.d.ts +2 -0
- package/dist/stripe-payments/services/secure-stripe-client.provider.js +15 -0
- package/dist/stripe-payments/services/secure-stripe-client.provider.js.map +1 -0
- package/dist/stripe-payments/services/secure-stripe-product.service.d.ts +9 -0
- package/dist/stripe-payments/services/secure-stripe-product.service.js +54 -0
- package/dist/stripe-payments/services/secure-stripe-product.service.js.map +1 -0
- package/dist/stripe-payments/services/secure-stripe-webhook.service.d.ts +14 -0
- package/dist/stripe-payments/services/secure-stripe-webhook.service.js +58 -0
- package/dist/stripe-payments/services/secure-stripe-webhook.service.js.map +1 -0
- package/dist/stripe-payments/services/secure-subscription.service.d.ts +18 -0
- package/dist/stripe-payments/services/secure-subscription.service.js +217 -0
- package/dist/stripe-payments/services/secure-subscription.service.js.map +1 -0
- package/dist/stripe-payments/services/stripe-payment-event.processor.d.ts +15 -0
- package/dist/stripe-payments/services/stripe-payment-event.processor.js +78 -0
- package/dist/stripe-payments/services/stripe-payment-event.processor.js.map +1 -0
- package/dist/stripe-payments/services/stripe-payment-event.service.d.ts +20 -0
- package/dist/stripe-payments/services/stripe-payment-event.service.js +178 -0
- package/dist/stripe-payments/services/stripe-payment-event.service.js.map +1 -0
- package/dist/stripe-payments/services/stripe-payment-fulfillment.service.d.ts +31 -0
- package/dist/stripe-payments/services/stripe-payment-fulfillment.service.js +331 -0
- package/dist/stripe-payments/services/stripe-payment-fulfillment.service.js.map +1 -0
- package/dist/stripe-payments/services/stripe-payments-operations.service.d.ts +25 -0
- package/dist/stripe-payments/services/stripe-payments-operations.service.js +59 -0
- package/dist/stripe-payments/services/stripe-payments-operations.service.js.map +1 -0
- package/dist/stripe-payments/services/stripe-payments-telemetry.service.d.ts +7 -0
- package/dist/stripe-payments/services/stripe-payments-telemetry.service.js +40 -0
- package/dist/stripe-payments/services/stripe-payments-telemetry.service.js.map +1 -0
- package/dist/stripe-payments/stripe-payment.config.d.ts +19 -0
- package/dist/stripe-payments/stripe-payment.config.js +98 -0
- package/dist/stripe-payments/stripe-payment.config.js.map +1 -0
- package/dist/stripe-payments/stripe-payment.config.test.d.ts +1 -0
- package/dist/stripe-payments/stripe-payment.config.test.js +59 -0
- package/dist/stripe-payments/stripe-payment.config.test.js.map +1 -0
- package/dist/stripe-payments/stripe-payments.extensions.d.ts +69 -0
- package/dist/stripe-payments/stripe-payments.extensions.js +30 -0
- package/dist/stripe-payments/stripe-payments.extensions.js.map +1 -0
- package/dist/stripe-payments/stripe-payments.module.d.ts +12 -0
- package/dist/stripe-payments/stripe-payments.module.js +118 -0
- package/dist/stripe-payments/stripe-payments.module.js.map +1 -0
- package/dist/stripe-payments/stripe-payments.options.d.ts +21 -0
- package/dist/stripe-payments/stripe-payments.options.js +2 -0
- package/dist/stripe-payments/stripe-payments.options.js.map +1 -0
- package/dist/typeorm/entities.d.ts +15 -0
- package/dist/typeorm/entities.js +32 -0
- package/dist/typeorm/entities.js.map +1 -0
- package/package.json +85 -38
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
|
11
|
+
import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn, UpdateDateColumn, } from "typeorm";
|
|
12
|
+
let StripeCheckoutAttempt = class StripeCheckoutAttempt {
|
|
13
|
+
id;
|
|
14
|
+
idempotencyKey;
|
|
15
|
+
organisationUuid;
|
|
16
|
+
userUuid;
|
|
17
|
+
productKey;
|
|
18
|
+
priceId;
|
|
19
|
+
mode;
|
|
20
|
+
status;
|
|
21
|
+
stripeSessionId;
|
|
22
|
+
stripeSessionUrl;
|
|
23
|
+
errorMessage;
|
|
24
|
+
createdDate;
|
|
25
|
+
updatedDate;
|
|
26
|
+
};
|
|
27
|
+
__decorate([
|
|
28
|
+
PrimaryGeneratedColumn(),
|
|
29
|
+
ApiProperty(),
|
|
30
|
+
__metadata("design:type", Number)
|
|
31
|
+
], StripeCheckoutAttempt.prototype, "id", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
Column({ length: 255 }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], StripeCheckoutAttempt.prototype, "idempotencyKey", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
Column({ length: 64 }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], StripeCheckoutAttempt.prototype, "organisationUuid", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
Column({ length: 64 }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], StripeCheckoutAttempt.prototype, "userUuid", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
Column({ length: 64 }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], StripeCheckoutAttempt.prototype, "productKey", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
Column({ length: 255 }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], StripeCheckoutAttempt.prototype, "priceId", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
Column({ length: 32 }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], StripeCheckoutAttempt.prototype, "mode", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
Column({ length: 32, default: "creating" }),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], StripeCheckoutAttempt.prototype, "status", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
Column({ nullable: true, length: 255 }),
|
|
62
|
+
ApiPropertyOptional(),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], StripeCheckoutAttempt.prototype, "stripeSessionId", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
Column({ nullable: true, type: "text" }),
|
|
67
|
+
ApiPropertyOptional(),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], StripeCheckoutAttempt.prototype, "stripeSessionUrl", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
Column({ nullable: true, type: "text" }),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], StripeCheckoutAttempt.prototype, "errorMessage", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
CreateDateColumn(),
|
|
76
|
+
__metadata("design:type", Date)
|
|
77
|
+
], StripeCheckoutAttempt.prototype, "createdDate", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
UpdateDateColumn(),
|
|
80
|
+
__metadata("design:type", Date)
|
|
81
|
+
], StripeCheckoutAttempt.prototype, "updatedDate", void 0);
|
|
82
|
+
StripeCheckoutAttempt = __decorate([
|
|
83
|
+
Entity("stripe_checkout_attempt"),
|
|
84
|
+
Index(["idempotencyKey"], { unique: true }),
|
|
85
|
+
Index(["stripeSessionId"], { unique: true })
|
|
86
|
+
], StripeCheckoutAttempt);
|
|
87
|
+
export { StripeCheckoutAttempt };
|
|
88
|
+
//# sourceMappingURL=stripe-checkout-attempt.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe-checkout-attempt.entity.js","sourceRoot":"","sources":["../../../src/stripe-payments/entities/stripe-checkout-attempt.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,WAAW,EAAE,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AACjE,OAAO,EACH,MAAM,EACN,gBAAgB,EAChB,MAAM,EACN,KAAK,EACL,sBAAsB,EACtB,gBAAgB,GACnB,MAAM,SAAS,CAAC;AAKV,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAG9B,EAAE,CAAU;IAGZ,cAAc,CAAU;IAGxB,gBAAgB,CAAU;IAG1B,QAAQ,CAAU;IAGlB,UAAU,CAAU;IAGpB,OAAO,CAAU;IAGjB,IAAI,CAAU;IAGd,MAAM,CAAqC;IAI3C,eAAe,CAAU;IAIzB,gBAAgB,CAAU;IAG1B,YAAY,CAAU;IAGtB,WAAW,CAAQ;IAGnB,WAAW,CAAQ;CACtB,CAAA;AAvCG;IAFC,sBAAsB,EAAE;IACxB,WAAW,EAAE;;iDACF;AAGZ;IADC,MAAM,CAAC,EAAC,MAAM,EAAE,GAAG,EAAC,CAAC;;6DACE;AAGxB;IADC,MAAM,CAAC,EAAC,MAAM,EAAE,EAAE,EAAC,CAAC;;+DACK;AAG1B;IADC,MAAM,CAAC,EAAC,MAAM,EAAE,EAAE,EAAC,CAAC;;uDACH;AAGlB;IADC,MAAM,CAAC,EAAC,MAAM,EAAE,EAAE,EAAC,CAAC;;yDACD;AAGpB;IADC,MAAM,CAAC,EAAC,MAAM,EAAE,GAAG,EAAC,CAAC;;sDACL;AAGjB;IADC,MAAM,CAAC,EAAC,MAAM,EAAE,EAAE,EAAC,CAAC;;mDACP;AAGd;IADC,MAAM,CAAC,EAAC,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,EAAC,CAAC;;qDACC;AAI3C;IAFC,MAAM,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAC,CAAC;IACrC,mBAAmB,EAAE;;8DACG;AAIzB;IAFC,MAAM,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC;IACtC,mBAAmB,EAAE;;+DACI;AAG1B;IADC,MAAM,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC;;2DACjB;AAGtB;IADC,gBAAgB,EAAE;8BACL,IAAI;0DAAC;AAGnB;IADC,gBAAgB,EAAE;8BACL,IAAI;0DAAC;AAzCV,qBAAqB;IAHjC,MAAM,CAAC,yBAAyB,CAAC;IACjC,KAAK,CAAC,CAAC,gBAAgB,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC;IACzC,KAAK,CAAC,CAAC,iBAAiB,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC;GAC9B,qBAAqB,CA0CjC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class StripeCheckoutEvent {
|
|
2
|
+
id: number;
|
|
3
|
+
stripeEventId: string;
|
|
4
|
+
stripeObjectId: string;
|
|
5
|
+
eventType: string;
|
|
6
|
+
clientReferenceId?: string;
|
|
7
|
+
status: "received" | "processing" | "processed" | "failed";
|
|
8
|
+
stripeData: unknown;
|
|
9
|
+
errorMessage?: string;
|
|
10
|
+
processingStartedAt?: Date;
|
|
11
|
+
processedAt?: Date;
|
|
12
|
+
processingAttempts: number;
|
|
13
|
+
createdDate: Date;
|
|
14
|
+
updatedDate: Date;
|
|
15
|
+
get stripeDataAsString(): string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
|
11
|
+
import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn, UpdateDateColumn, } from "typeorm";
|
|
12
|
+
let StripeCheckoutEvent = class StripeCheckoutEvent {
|
|
13
|
+
id;
|
|
14
|
+
stripeEventId;
|
|
15
|
+
stripeObjectId;
|
|
16
|
+
eventType;
|
|
17
|
+
clientReferenceId;
|
|
18
|
+
status;
|
|
19
|
+
stripeData;
|
|
20
|
+
errorMessage;
|
|
21
|
+
processingStartedAt;
|
|
22
|
+
processedAt;
|
|
23
|
+
processingAttempts;
|
|
24
|
+
createdDate;
|
|
25
|
+
updatedDate;
|
|
26
|
+
get stripeDataAsString() {
|
|
27
|
+
return JSON.stringify(this.stripeData, undefined, 4);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
__decorate([
|
|
31
|
+
PrimaryGeneratedColumn(),
|
|
32
|
+
ApiProperty(),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], StripeCheckoutEvent.prototype, "id", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
Column({ length: 255 }),
|
|
37
|
+
ApiProperty(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], StripeCheckoutEvent.prototype, "stripeEventId", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
Column({ length: 255 }),
|
|
42
|
+
ApiProperty(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], StripeCheckoutEvent.prototype, "stripeObjectId", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
Column({ length: 128 }),
|
|
47
|
+
ApiProperty(),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], StripeCheckoutEvent.prototype, "eventType", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
Column({ nullable: true, length: 255 }),
|
|
52
|
+
ApiPropertyOptional(),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], StripeCheckoutEvent.prototype, "clientReferenceId", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
Column({ length: 32, default: "received" }),
|
|
57
|
+
ApiProperty(),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], StripeCheckoutEvent.prototype, "status", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
Column({ type: "jsonb" }),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], StripeCheckoutEvent.prototype, "stripeData", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
Column({ nullable: true, type: "text" }),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], StripeCheckoutEvent.prototype, "errorMessage", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
Column({ nullable: true, type: "timestamptz" }),
|
|
70
|
+
__metadata("design:type", Date)
|
|
71
|
+
], StripeCheckoutEvent.prototype, "processingStartedAt", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
Column({ nullable: true, type: "timestamptz" }),
|
|
74
|
+
__metadata("design:type", Date)
|
|
75
|
+
], StripeCheckoutEvent.prototype, "processedAt", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
Column({ default: 0 }),
|
|
78
|
+
__metadata("design:type", Number)
|
|
79
|
+
], StripeCheckoutEvent.prototype, "processingAttempts", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
CreateDateColumn(),
|
|
82
|
+
ApiProperty({ format: "date-time" }),
|
|
83
|
+
__metadata("design:type", Date)
|
|
84
|
+
], StripeCheckoutEvent.prototype, "createdDate", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
UpdateDateColumn(),
|
|
87
|
+
__metadata("design:type", Date)
|
|
88
|
+
], StripeCheckoutEvent.prototype, "updatedDate", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
ApiProperty({ type: String, name: "stripeDataAsString" }),
|
|
91
|
+
__metadata("design:type", String),
|
|
92
|
+
__metadata("design:paramtypes", [])
|
|
93
|
+
], StripeCheckoutEvent.prototype, "stripeDataAsString", null);
|
|
94
|
+
StripeCheckoutEvent = __decorate([
|
|
95
|
+
Entity("stripe_payment_event"),
|
|
96
|
+
Index(["stripeEventId"], { unique: true }),
|
|
97
|
+
Index(["stripeObjectId", "eventType"]),
|
|
98
|
+
Index(["status", "processingStartedAt"])
|
|
99
|
+
], StripeCheckoutEvent);
|
|
100
|
+
export { StripeCheckoutEvent };
|
|
101
|
+
//# sourceMappingURL=stripe-payment-event.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe-payment-event.entity.js","sourceRoot":"","sources":["../../../src/stripe-payments/entities/stripe-payment-event.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,WAAW,EAAE,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AACjE,OAAO,EACH,MAAM,EACN,gBAAgB,EAChB,MAAM,EACN,KAAK,EACL,sBAAsB,EACtB,gBAAgB,GACnB,MAAM,SAAS,CAAC;AAMV,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAG5B,EAAE,CAAU;IAIZ,aAAa,CAAU;IAIvB,cAAc,CAAU;IAIxB,SAAS,CAAU;IAInB,iBAAiB,CAAU;IAI3B,MAAM,CAAsD;IAG5D,UAAU,CAAW;IAGrB,YAAY,CAAU;IAGtB,mBAAmB,CAAQ;IAG3B,WAAW,CAAQ;IAGnB,kBAAkB,CAAU;IAI5B,WAAW,CAAQ;IAGnB,WAAW,CAAQ;IAEnB,IACI,kBAAkB;QAClB,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;IACzD,CAAC;CACJ,CAAA;AAhDG;IAFC,sBAAsB,EAAE;IACxB,WAAW,EAAE;;+CACF;AAIZ;IAFC,MAAM,CAAC,EAAC,MAAM,EAAE,GAAG,EAAC,CAAC;IACrB,WAAW,EAAE;;0DACS;AAIvB;IAFC,MAAM,CAAC,EAAC,MAAM,EAAE,GAAG,EAAC,CAAC;IACrB,WAAW,EAAE;;2DACU;AAIxB;IAFC,MAAM,CAAC,EAAC,MAAM,EAAE,GAAG,EAAC,CAAC;IACrB,WAAW,EAAE;;sDACK;AAInB;IAFC,MAAM,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAC,CAAC;IACrC,mBAAmB,EAAE;;8DACK;AAI3B;IAFC,MAAM,CAAC,EAAC,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,EAAC,CAAC;IACzC,WAAW,EAAE;;mDAC8C;AAG5D;IADC,MAAM,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;uDACH;AAGrB;IADC,MAAM,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC;;yDACjB;AAGtB;IADC,MAAM,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAC,CAAC;8BACxB,IAAI;gEAAC;AAG3B;IADC,MAAM,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAC,CAAC;8BAChC,IAAI;wDAAC;AAGnB;IADC,MAAM,CAAC,EAAC,OAAO,EAAE,CAAC,EAAC,CAAC;;+DACO;AAI5B;IAFC,gBAAgB,EAAE;IAClB,WAAW,CAAC,EAAC,MAAM,EAAE,WAAW,EAAC,CAAC;8BACrB,IAAI;wDAAC;AAGnB;IADC,gBAAgB,EAAE;8BACL,IAAI;wDAAC;AAEnB;IAAC,WAAW,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAC,CAAC;;;6DAGvD;AAlDQ,mBAAmB;IAJ/B,MAAM,CAAC,sBAAsB,CAAC;IAC9B,KAAK,CAAC,CAAC,eAAe,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC;IACxC,KAAK,CAAC,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;IACtC,KAAK,CAAC,CAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC;GAC5B,mBAAmB,CAmD/B"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn, UpdateDateColumn, } from "typeorm";
|
|
11
|
+
let StripePaymentState = class StripePaymentState {
|
|
12
|
+
id;
|
|
13
|
+
paymentSystemTransactionId;
|
|
14
|
+
lastStripeEventId;
|
|
15
|
+
lastStripeEventCreatedAt;
|
|
16
|
+
status;
|
|
17
|
+
createdDate;
|
|
18
|
+
updatedDate;
|
|
19
|
+
};
|
|
20
|
+
__decorate([
|
|
21
|
+
PrimaryGeneratedColumn(),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], StripePaymentState.prototype, "id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
Column({ length: 255 }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], StripePaymentState.prototype, "paymentSystemTransactionId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
Column({ length: 255 }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], StripePaymentState.prototype, "lastStripeEventId", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
Column({ type: "timestamptz" }),
|
|
34
|
+
__metadata("design:type", Date)
|
|
35
|
+
], StripePaymentState.prototype, "lastStripeEventCreatedAt", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
Column({ length: 64 }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], StripePaymentState.prototype, "status", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
CreateDateColumn(),
|
|
42
|
+
__metadata("design:type", Date)
|
|
43
|
+
], StripePaymentState.prototype, "createdDate", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
UpdateDateColumn(),
|
|
46
|
+
__metadata("design:type", Date)
|
|
47
|
+
], StripePaymentState.prototype, "updatedDate", void 0);
|
|
48
|
+
StripePaymentState = __decorate([
|
|
49
|
+
Entity("stripe_payment_state"),
|
|
50
|
+
Index(["paymentSystemTransactionId"], { unique: true })
|
|
51
|
+
], StripePaymentState);
|
|
52
|
+
export { StripePaymentState };
|
|
53
|
+
//# sourceMappingURL=stripe-payment-state.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe-payment-state.entity.js","sourceRoot":"","sources":["../../../src/stripe-payments/entities/stripe-payment-state.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACH,MAAM,EACN,gBAAgB,EAChB,MAAM,EACN,KAAK,EACL,sBAAsB,EACtB,gBAAgB,GACnB,MAAM,SAAS,CAAC;AAIV,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAE3B,EAAE,CAAU;IAGZ,0BAA0B,CAAU;IAGpC,iBAAiB,CAAU;IAG3B,wBAAwB,CAAQ;IAGhC,MAAM,CAAU;IAGhB,WAAW,CAAQ;IAGnB,WAAW,CAAQ;CACtB,CAAA;AAnBG;IADC,sBAAsB,EAAE;;8CACb;AAGZ;IADC,MAAM,CAAC,EAAC,MAAM,EAAE,GAAG,EAAC,CAAC;;sEACc;AAGpC;IADC,MAAM,CAAC,EAAC,MAAM,EAAE,GAAG,EAAC,CAAC;;6DACK;AAG3B;IADC,MAAM,CAAC,EAAC,IAAI,EAAE,aAAa,EAAC,CAAC;8BACH,IAAI;oEAAC;AAGhC;IADC,MAAM,CAAC,EAAC,MAAM,EAAE,EAAE,EAAC,CAAC;;kDACL;AAGhB;IADC,gBAAgB,EAAE;8BACL,IAAI;uDAAC;AAGnB;IADC,gBAAgB,EAAE;8BACL,IAAI;uDAAC;AApBV,kBAAkB;IAF9B,MAAM,CAAC,sBAAsB,CAAC;IAC9B,KAAK,CAAC,CAAC,4BAA4B,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC;GACzC,kBAAkB,CAqB9B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class StripeCheckoutSessionRequestDto {
|
|
2
|
+
organisationUuid: string;
|
|
3
|
+
productKey: string;
|
|
4
|
+
successFrontendPath: string;
|
|
5
|
+
cancelFrontendPath?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class StripeCustomerPortalRequestDto {
|
|
8
|
+
subscriptionRecordUuid: string;
|
|
9
|
+
returnUrl: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class StripeEventsQueryDto {
|
|
12
|
+
skip: number;
|
|
13
|
+
take: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
|
11
|
+
import { Type } from "class-transformer";
|
|
12
|
+
import { IsInt, IsNotEmpty, IsOptional, IsString, IsUUID, Matches, Max, MaxLength, Min, } from "class-validator";
|
|
13
|
+
const relativePathPattern = /^\/(?!\/)[^\s]*$/;
|
|
14
|
+
export class StripeCheckoutSessionRequestDto {
|
|
15
|
+
organisationUuid;
|
|
16
|
+
productKey;
|
|
17
|
+
successFrontendPath;
|
|
18
|
+
cancelFrontendPath;
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
ApiProperty(),
|
|
22
|
+
IsUUID("4"),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], StripeCheckoutSessionRequestDto.prototype, "organisationUuid", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
ApiProperty({
|
|
27
|
+
description: "A product key from the server-side Stripe product catalog",
|
|
28
|
+
}),
|
|
29
|
+
IsString(),
|
|
30
|
+
IsNotEmpty(),
|
|
31
|
+
Matches(/^[a-z0-9][a-z0-9_-]{0,63}$/),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], StripeCheckoutSessionRequestDto.prototype, "productKey", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
ApiProperty({
|
|
36
|
+
description: "A relative frontend path on the configured application origin",
|
|
37
|
+
}),
|
|
38
|
+
IsString(),
|
|
39
|
+
IsNotEmpty(),
|
|
40
|
+
MaxLength(200),
|
|
41
|
+
Matches(relativePathPattern),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], StripeCheckoutSessionRequestDto.prototype, "successFrontendPath", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
ApiPropertyOptional({
|
|
46
|
+
description: "A relative frontend path on the configured application origin",
|
|
47
|
+
}),
|
|
48
|
+
IsOptional(),
|
|
49
|
+
IsString(),
|
|
50
|
+
MaxLength(200),
|
|
51
|
+
Matches(relativePathPattern),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], StripeCheckoutSessionRequestDto.prototype, "cancelFrontendPath", void 0);
|
|
54
|
+
export class StripeCustomerPortalRequestDto {
|
|
55
|
+
subscriptionRecordUuid;
|
|
56
|
+
returnUrl;
|
|
57
|
+
}
|
|
58
|
+
__decorate([
|
|
59
|
+
ApiProperty(),
|
|
60
|
+
IsUUID("4"),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], StripeCustomerPortalRequestDto.prototype, "subscriptionRecordUuid", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
ApiProperty({
|
|
65
|
+
description: "A relative frontend path on the configured application origin",
|
|
66
|
+
}),
|
|
67
|
+
IsString(),
|
|
68
|
+
IsNotEmpty(),
|
|
69
|
+
MaxLength(200),
|
|
70
|
+
Matches(relativePathPattern),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], StripeCustomerPortalRequestDto.prototype, "returnUrl", void 0);
|
|
73
|
+
export class StripeEventsQueryDto {
|
|
74
|
+
skip = 0;
|
|
75
|
+
take = 50;
|
|
76
|
+
}
|
|
77
|
+
__decorate([
|
|
78
|
+
ApiPropertyOptional({
|
|
79
|
+
type: Number,
|
|
80
|
+
default: 0,
|
|
81
|
+
minimum: 0,
|
|
82
|
+
maximum: 1000,
|
|
83
|
+
}),
|
|
84
|
+
IsOptional(),
|
|
85
|
+
Type(() => Number),
|
|
86
|
+
IsInt(),
|
|
87
|
+
Min(0),
|
|
88
|
+
Max(1000),
|
|
89
|
+
__metadata("design:type", Object)
|
|
90
|
+
], StripeEventsQueryDto.prototype, "skip", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
ApiPropertyOptional({
|
|
93
|
+
type: Number,
|
|
94
|
+
default: 50,
|
|
95
|
+
minimum: 1,
|
|
96
|
+
maximum: 1000,
|
|
97
|
+
}),
|
|
98
|
+
IsOptional(),
|
|
99
|
+
Type(() => Number),
|
|
100
|
+
IsInt(),
|
|
101
|
+
Min(1),
|
|
102
|
+
Max(1000),
|
|
103
|
+
__metadata("design:type", Object)
|
|
104
|
+
], StripeEventsQueryDto.prototype, "take", void 0);
|
|
105
|
+
//# sourceMappingURL=secure-checkout.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secure-checkout.dto.js","sourceRoot":"","sources":["../../../src/stripe-payments/models/secure-checkout.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,WAAW,EAAE,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAC,IAAI,EAAC,MAAM,mBAAmB,CAAC;AACvC,OAAO,EACH,KAAK,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,MAAM,EACN,OAAO,EACP,GAAG,EACH,SAAS,EACT,GAAG,GACN,MAAM,iBAAiB,CAAC;AAEzB,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAE/C,MAAM,OAAO,+BAA+B;IAGxC,gBAAgB,CAAU;IAS1B,UAAU,CAAU;IAUpB,mBAAmB,CAAU;IAU7B,kBAAkB,CAAU;CAC/B;AA9BG;IAFC,WAAW,EAAE;IACb,MAAM,CAAC,GAAG,CAAC;;yEACc;AAS1B;IAPC,WAAW,CAAC;QACT,WAAW,EACP,2DAA2D;KAClE,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,OAAO,CAAC,4BAA4B,CAAC;;mEAClB;AAUpB;IARC,WAAW,CAAC;QACT,WAAW,EACP,+DAA+D;KACtE,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,GAAG,CAAC;IACd,OAAO,CAAC,mBAAmB,CAAC;;4EACA;AAU7B;IARC,mBAAmB,CAAC;QACjB,WAAW,EACP,+DAA+D;KACtE,CAAC;IACD,UAAU,EAAE;IACZ,QAAQ,EAAE;IACV,SAAS,CAAC,GAAG,CAAC;IACd,OAAO,CAAC,mBAAmB,CAAC;;2EACD;AAGhC,MAAM,OAAO,8BAA8B;IAGvC,sBAAsB,CAAU;IAUhC,SAAS,CAAU;CACtB;AAXG;IAFC,WAAW,EAAE;IACb,MAAM,CAAC,GAAG,CAAC;;8EACoB;AAUhC;IARC,WAAW,CAAC;QACT,WAAW,EACP,+DAA+D;KACtE,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,GAAG,CAAC;IACd,OAAO,CAAC,mBAAmB,CAAC;;iEACV;AAGvB,MAAM,OAAO,oBAAoB;IAY7B,IAAI,GAAG,CAAC,CAAC;IAaT,IAAI,GAAG,EAAE,CAAC;CACb;AAdG;IAXC,mBAAmB,CAAC;QACjB,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,IAAI;KAChB,CAAC;IACD,UAAU,EAAE;IACZ,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,KAAK,EAAE;IACP,GAAG,CAAC,CAAC,CAAC;IACN,GAAG,CAAC,IAAI,CAAC;;kDACD;AAaT;IAXC,mBAAmB,CAAC;QACjB,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,IAAI;KAChB,CAAC;IACD,UAAU,EAAE;IACZ,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,KAAK,EAAE;IACP,GAAG,CAAC,CAAC,CAAC;IACN,GAAG,CAAC,IAAI,CAAC;;kDACA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { ApiProperty } from "@nestjs/swagger";
|
|
11
|
+
export class StripeCheckoutSessionResponseDto {
|
|
12
|
+
stripeSessionId;
|
|
13
|
+
stripeSessionUrl;
|
|
14
|
+
}
|
|
15
|
+
__decorate([
|
|
16
|
+
ApiProperty(),
|
|
17
|
+
__metadata("design:type", String)
|
|
18
|
+
], StripeCheckoutSessionResponseDto.prototype, "stripeSessionId", void 0);
|
|
19
|
+
__decorate([
|
|
20
|
+
ApiProperty(),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], StripeCheckoutSessionResponseDto.prototype, "stripeSessionUrl", void 0);
|
|
23
|
+
export class StripeCustomerPortalResponseDto {
|
|
24
|
+
sessionUrl;
|
|
25
|
+
}
|
|
26
|
+
__decorate([
|
|
27
|
+
ApiProperty(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], StripeCustomerPortalResponseDto.prototype, "sessionUrl", void 0);
|
|
30
|
+
//# sourceMappingURL=secure-payment-response.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secure-payment-response.dto.js","sourceRoot":"","sources":["../../../src/stripe-payments/models/secure-payment-response.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,gCAAgC;IAEzC,eAAe,CAAU;IAGzB,gBAAgB,CAAU;CAC7B;AAJG;IADC,WAAW,EAAE;;yEACW;AAGzB;IADC,WAAW,EAAE;;0EACY;AAG9B,MAAM,OAAO,+BAA+B;IAExC,UAAU,CAAU;CACvB;AADG;IADC,WAAW,EAAE;;mEACM"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StripePaymentsEntitlement, StripePaymentsEntitlementInput, StripePaymentsEntitlementStore, StripePaymentsRevocationInput } from "../stripe-payments.extensions.js";
|
|
2
|
+
import { SecureSubscriptionService } from "./secure-subscription.service.js";
|
|
3
|
+
export declare class DefaultStripePaymentsEntitlementStore implements StripePaymentsEntitlementStore {
|
|
4
|
+
private readonly subscriptionService;
|
|
5
|
+
constructor(subscriptionService: SecureSubscriptionService);
|
|
6
|
+
findByUuid(uuid: string): Promise<StripePaymentsEntitlement>;
|
|
7
|
+
findByTransactionId(paymentSystemTransactionId: string): Promise<StripePaymentsEntitlement | null>;
|
|
8
|
+
save(input: StripePaymentsEntitlementInput): Promise<void>;
|
|
9
|
+
revokeCustomerPayments(customerId: string, input: StripePaymentsRevocationInput): Promise<void>;
|
|
10
|
+
revokePayment(paymentSystemTransactionId: string, input: StripePaymentsRevocationInput): Promise<boolean>;
|
|
11
|
+
private map;
|
|
12
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Injectable } from "@nestjs/common";
|
|
11
|
+
import { SecureSubscriptionService } from "./secure-subscription.service.js";
|
|
12
|
+
let DefaultStripePaymentsEntitlementStore = class DefaultStripePaymentsEntitlementStore {
|
|
13
|
+
subscriptionService;
|
|
14
|
+
constructor(subscriptionService) {
|
|
15
|
+
this.subscriptionService = subscriptionService;
|
|
16
|
+
}
|
|
17
|
+
async findByUuid(uuid) {
|
|
18
|
+
const record = await this.subscriptionService.findByUuid(uuid);
|
|
19
|
+
return this.map(record);
|
|
20
|
+
}
|
|
21
|
+
async findByTransactionId(paymentSystemTransactionId) {
|
|
22
|
+
const record = await this.subscriptionService.findByTransactionId(paymentSystemTransactionId);
|
|
23
|
+
return record ? this.map(record) : null;
|
|
24
|
+
}
|
|
25
|
+
async save(input) {
|
|
26
|
+
await this.subscriptionService.save(input);
|
|
27
|
+
}
|
|
28
|
+
revokeCustomerPayments(customerId, input) {
|
|
29
|
+
return this.subscriptionService.revokeCustomerPayments(customerId, input);
|
|
30
|
+
}
|
|
31
|
+
revokePayment(paymentSystemTransactionId, input) {
|
|
32
|
+
return this.subscriptionService.revokePayment(paymentSystemTransactionId, input);
|
|
33
|
+
}
|
|
34
|
+
map(record) {
|
|
35
|
+
return {
|
|
36
|
+
uuid: record.uuid,
|
|
37
|
+
organisationUuid: record.organisation.uuid,
|
|
38
|
+
paymentSystemTransactionId: record.paymentSystemTransactionId,
|
|
39
|
+
paymentSystemCustomerId: record.paymentSystemCustomerId,
|
|
40
|
+
paymentSystemMode: record.paymentSystemMode,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
DefaultStripePaymentsEntitlementStore = __decorate([
|
|
45
|
+
Injectable(),
|
|
46
|
+
__metadata("design:paramtypes", [SecureSubscriptionService])
|
|
47
|
+
], DefaultStripePaymentsEntitlementStore);
|
|
48
|
+
export { DefaultStripePaymentsEntitlementStore };
|
|
49
|
+
//# sourceMappingURL=default-stripe-payments-entitlement-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-stripe-payments-entitlement-store.js","sourceRoot":"","sources":["../../../src/stripe-payments/services/default-stripe-payments-entitlement-store.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAO1C,OAAO,EAAC,yBAAyB,EAAC,MAAM,kCAAkC,CAAC;AAGpE,IAAM,qCAAqC,GAA3C,MAAM,qCAAqC;IAEzB;IADrB,YACqB,mBAA8C;QAA9C,wBAAmB,GAAnB,mBAAmB,CAA2B;IAChE,CAAC;IAEJ,KAAK,CAAC,UAAU,CAAC,IAAY;QACzB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC/D,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,mBAAmB,CACrB,0BAAkC;QAElC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,mBAAmB,CAC7D,0BAA0B,CAC7B,CAAC;QACF,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAqC;QAC5C,MAAM,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IAED,sBAAsB,CAClB,UAAkB,EAClB,KAAoC;QAEpC,OAAO,IAAI,CAAC,mBAAmB,CAAC,sBAAsB,CAClD,UAAU,EACV,KAAK,CACR,CAAC;IACN,CAAC;IAED,aAAa,CACT,0BAAkC,EAClC,KAAoC;QAEpC,OAAO,IAAI,CAAC,mBAAmB,CAAC,aAAa,CACzC,0BAA0B,EAC1B,KAAK,CACR,CAAC;IACN,CAAC;IAEO,GAAG,CAAC,MAMX;QACG,OAAO;YACH,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,gBAAgB,EAAE,MAAM,CAAC,YAAY,CAAC,IAAI;YAC1C,0BAA0B,EAAE,MAAM,CAAC,0BAA0B;YAC7D,uBAAuB,EAAE,MAAM,CAAC,uBAAuB;YACvD,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;SAC9C,CAAC;IACN,CAAC;CACJ,CAAA;AA1DY,qCAAqC;IADjD,UAAU,EAAE;qCAGiC,yBAAyB;GAF1D,qCAAqC,CA0DjD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RequestUser } from "../../authorization/models/RequestWithUser.js";
|
|
2
|
+
import Stripe from "stripe";
|
|
3
|
+
import { Repository } from "typeorm";
|
|
4
|
+
import { StripeCheckoutSessionRequestDto, StripeCustomerPortalRequestDto } from "../models/secure-checkout.dto.js";
|
|
5
|
+
import { StripeCheckoutSessionResponseDto, StripeCustomerPortalResponseDto } from "../models/secure-payment-response.dto.js";
|
|
6
|
+
import { StripeCheckoutAttempt } from "../entities/stripe-checkout-attempt.entity.js";
|
|
7
|
+
import { SecureStripeProductService } from "./secure-stripe-product.service.js";
|
|
8
|
+
import { StripePaymentsAccessPolicy, StripePaymentsEntitlementStore } from "../stripe-payments.extensions.js";
|
|
9
|
+
import { StripePaymentsTelemetryService } from "./stripe-payments-telemetry.service.js";
|
|
10
|
+
export declare class SecureStripeCheckoutService {
|
|
11
|
+
private readonly stripe;
|
|
12
|
+
private readonly attemptRepository;
|
|
13
|
+
private readonly productService;
|
|
14
|
+
private readonly entitlementStore;
|
|
15
|
+
private readonly accessPolicy;
|
|
16
|
+
private readonly telemetry;
|
|
17
|
+
private readonly logger;
|
|
18
|
+
constructor(stripe: Stripe, attemptRepository: Repository<StripeCheckoutAttempt>, productService: SecureStripeProductService, entitlementStore: StripePaymentsEntitlementStore, accessPolicy: StripePaymentsAccessPolicy, telemetry: StripePaymentsTelemetryService);
|
|
19
|
+
createCheckoutSession(request: StripeCheckoutSessionRequestDto, user: RequestUser, idempotencyKey: string | undefined): Promise<StripeCheckoutSessionResponseDto>;
|
|
20
|
+
createCustomerPortalSession(request: StripeCustomerPortalRequestDto, user: RequestUser, idempotencyKey: string | undefined): Promise<StripeCustomerPortalResponseDto>;
|
|
21
|
+
private requireIdempotencyKey;
|
|
22
|
+
private assertMatchingAttempt;
|
|
23
|
+
private isUniqueViolation;
|
|
24
|
+
}
|