Skip to content

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

Stripe: Payment Request Service ​

This is the module page of the payment-request-service.

Service layer for PaymentRequest. Owns creation, lookup, cancellation, payment session bootstrap, and the settlement-time hook invoked from the Stripe webhook flow in StripeService.

Classes ​

ClassDescription
IllegalPaymentRequestTransitionErrorThrown when a state transition on a PaymentRequest is illegal — e.g. cancelling an already-paid request, or starting payment on a cancelled or expired one.
InvalidPaymentRequestBeneficiaryErrorThrown when a PaymentRequest cannot be created or paid because the beneficiary user is ineligible (soft-deleted, point-of-sale, etc.).
PaymentRequestServiceService layer for PaymentRequest.

Interfaces ​

InterfaceDescription
CreatePaymentRequestParams-
PaymentRequestFilterParameters-

Variables ​

VariableDescription
PAYMENT_REQUEST_DESCRIPTION_MAX_LENGTHMaximum length of PaymentRequest.description and Transfer.description, both persisted as varchar(255). Validated up-front in the service so the caller gets a clear error instead of a low-level DB constraint failure.
TRANSFER_DESCRIPTION_MAX_LENGTH-

Functions ​

FunctionDescription
parseGetPaymentRequestsFiltersParse a list-PaymentRequests query into PaymentRequestFilterParameters. Throws on any malformed value so the controller can return 400 — same strictness as the inline parser this replaced.
validPaymentRequestBeneficiaryTypesUser types allowed to be the beneficiary of a PaymentRequest. Anything not on this list is rejected, so the default for newly-added user types is fail-closed. Soft-deleted users are rejected at runtime regardless of type.