From fd8e7a09d4a7da97b93abf2a0c2b3d8e66773d16 Mon Sep 17 00:00:00 2001 From: Igor Zynov Date: Tue, 29 Jul 2025 01:45:42 +0400 Subject: [PATCH] feat(payment-stripe): add metadata to price and customAmount to transaction --- src/interfaces/payment-stripe/entities/price.ts | 1 + src/interfaces/payment-stripe/entities/transaction.ts | 2 ++ src/interfaces/payment-stripe/methods/price/create.ts | 1 + 3 files changed, 4 insertions(+) diff --git a/src/interfaces/payment-stripe/entities/price.ts b/src/interfaces/payment-stripe/entities/price.ts index 8db4bc8..1eed5db 100644 --- a/src/interfaces/payment-stripe/entities/price.ts +++ b/src/interfaces/payment-stripe/entities/price.ts @@ -13,6 +13,7 @@ interface IPrice extends IEntity { createdAt?: Date; updatedAt?: Date; product?: IProduct; + metadata?: Record | null; } export default IPrice; diff --git a/src/interfaces/payment-stripe/entities/transaction.ts b/src/interfaces/payment-stripe/entities/transaction.ts index b0321f3..a5df05f 100644 --- a/src/interfaces/payment-stripe/entities/transaction.ts +++ b/src/interfaces/payment-stripe/entities/transaction.ts @@ -98,6 +98,8 @@ interface ITransaction extends IEntity { entityId?: string; // Smallest currency unit amount amount?: number; + // Custom amount paid by user for PWYW transactions (in cents) + customAmount?: number; // Smallest currency unit tax tax?: number; // Smallest currency unit fee diff --git a/src/interfaces/payment-stripe/methods/price/create.ts b/src/interfaces/payment-stripe/methods/price/create.ts index 17e3dd3..e9e0d70 100644 --- a/src/interfaces/payment-stripe/methods/price/create.ts +++ b/src/interfaces/payment-stripe/methods/price/create.ts @@ -5,6 +5,7 @@ interface IPriceCreateInput { currency: string; userId: string; unitAmount: number; + metadata?: Record; } interface IPriceCreateOutput {