Skip to content

SudoSOS Back-end API / stripe/payment-request / PaymentRequest

Class: PaymentRequest ​

A shareable, fixed-amount request to top up a specific user's SudoSOS balance. See the module page for full lifecycle and integration notes.

Extends ​

Constructors ​

Constructor ​

ts
new PaymentRequest(): PaymentRequest;

Returns ​

PaymentRequest

Overrides ​

BaseEntityWithoutId.constructor

Properties ​

PropertyModifierTypeDescriptionInherited from
amountpublicDineroFixed, immutable amount.-
attemptspublicPaymentRequestAttempt[]Payment attempts (intents)-
cancelledAtpublicDateWhen the request was cancelled (null if not cancelled).-
cancelledBypublicUserThe user that cancelled this request (null if not cancelled).-
createdAtreadonlyDateThe creation date of the object.BaseEntityWithoutId.createdAt
createdBypublicUserAudit: who issued this request.-
descriptionpublicstringHuman-readable description (e.g. "Drinks at Walhalla naborrel 2026-04-12").-
expiresAtpublicDateAfter this moment the request stops accepting payments. Once expiresAt has passed, the derived status flips to EXPIRED (unless the request had already been paid or cancelled, which take precedence — see PaymentRequest.status).-
forpublicUserThe user whose balance will be credited on successful payment.-
fulfilledBypublicUserThe admin that marked the request paid out-of-band via the escape hatch (null otherwise).-
idpublicstringUUID v4. Also the public-facing identifier shared in payment links.-
paidAtpublicDateWhen the request was marked paid (null if pending/cancelled/expired).-
updatedAtreadonlyDateThe last update date of the object.BaseEntityWithoutId.updatedAt
versionreadonlynumberThe current version of the object.BaseEntityWithoutId.version

Accessors ​

status ​

Get Signature ​

ts
get status(): PaymentRequestStatus;

Derived status — not persisted. Order of precedence: PAID > CANCELLED > EXPIRED > PENDING.

Returns ​

PaymentRequestStatus

Methods ​

getOwner() ​

ts
getOwner(): Promise<User>;

Returns ​

Promise<User>