Skip to content

SudoSOS Back-end API / stripe/terminal-payment / TerminalPayment

Class: TerminalPayment ​

Extends ​

Constructors ​

Constructor ​

ts
new TerminalPayment(): TerminalPayment;

Returns ​

TerminalPayment

Inherited from ​

BaseEntity.constructor

Properties ​

PropertyModifierTypeDescriptionInherited from
createdAtreadonlyDateThe creation date of the object.BaseEntity.createdAt
createdBypublicUserThe user who created this TerminalPayment-
finalTransaction?publicTransactionThe transaction that was paid with this payment-
idreadonlynumber-BaseEntity.id
processedByTerminal?publicstringThe ID of the Stripe terminal currently processing this payment, if any-
stripePaymentIntentpublicStripePaymentIntent--
temporaryTransaction?publicTmpTransactionThe transaction that should be created when payment is successful-
transfer?publicTransferThe created transfer when payment is successful-
updatedAtreadonlyDateThe last update date of the object.BaseEntity.updatedAt
versionreadonlynumberThe current version of the object.BaseEntity.version

Methods ​

getState() ​

ts
getState(): TerminalPaymentState;

Determine the terminal payment's state based on the entity's properties

Returns ​

TerminalPaymentState


isRelatedToUser() ​

ts
isRelatedToUser(userId): boolean;

Whether the given user is connected to this TerminalPayment, either as its creator or as the buyer or creator of its transaction. Callers use this to decide between the own and all RBAC relations.

Requires createdBy, temporaryTransaction and finalTransaction (with their from and createdBy) to be loaded.

Parameters ​

ParameterTypeDescription
userIdnumberID of the user to check.

Returns ​

boolean