SudoSOS Back-end API / stripe/terminal-payment / TerminalPayment
Class: TerminalPayment ​
Extends ​
Constructors ​
Constructor ​
ts
new TerminalPayment(): TerminalPayment;Returns ​
TerminalPayment
Inherited from ​
Properties ​
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
createdAt | readonly | Date | The creation date of the object. | BaseEntity.createdAt |
createdBy | public | User | The user who created this TerminalPayment | - |
finalTransaction? | public | Transaction | The transaction that was paid with this payment | - |
id | readonly | number | - | BaseEntity.id |
processedByTerminal? | public | string | The ID of the Stripe terminal currently processing this payment, if any | - |
stripePaymentIntent | public | StripePaymentIntent | - | - |
temporaryTransaction? | public | TmpTransaction | The transaction that should be created when payment is successful | - |
transfer? | public | Transfer | The created transfer when payment is successful | - |
updatedAt | readonly | Date | The last update date of the object. | BaseEntity.updatedAt |
version | readonly | number | The 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 ​
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 ​
| Parameter | Type | Description |
|---|---|---|
userId | number | ID of the user to check. |
Returns ​
boolean