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 ​
| Class | Description |
|---|---|
| IllegalPaymentRequestTransitionError | Thrown 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. |
| InvalidPaymentRequestBeneficiaryError | Thrown when a PaymentRequest cannot be created or paid because the beneficiary user is ineligible (soft-deleted, point-of-sale, etc.). |
| PaymentRequestService | Service layer for PaymentRequest. |
Interfaces ​
| Interface | Description |
|---|---|
| CreatePaymentRequestParams | - |
| PaymentRequestFilterParameters | - |
Variables ​
| Variable | Description |
|---|---|
| PAYMENT_REQUEST_DESCRIPTION_MAX_LENGTH | Maximum 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 ​
| Function | Description |
|---|---|
| parseGetPaymentRequestsFilters | Parse 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. |
| validPaymentRequestBeneficiaryTypes | User 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. |