SudoSOS Back-end API / stripe/payment-request-checkout-service / PaymentRequestCheckoutService
Class: PaymentRequestCheckoutService ​
Bootstrap a Stripe payment session for a PaymentRequest.
Validates the request is still PENDING and the beneficiary is payable, then creates a StripePaymentIntent tied back to the request. Used by both the authenticated "I want to pay my own request" endpoint and the public share-link endpoint.
Extends ​
Constructors ​
Constructor ​
ts
new PaymentRequestCheckoutService(manager?): PaymentRequestCheckoutService;Parameters ​
| Parameter | Type |
|---|---|
manager? | EntityManager |
Returns ​
PaymentRequestCheckoutService
Overrides ​
Properties ​
| Property | Modifier | Type | Inherited from |
|---|---|---|---|
manager | protected | EntityManager | WithManager.manager |
Methods ​
configureLogger() ​
ts
protected configureLogger(logger): void;Parameters ​
| Parameter | Type |
|---|---|
logger | Logger |
Returns ​
void
Inherited from ​
startPayment() ​
ts
startPayment(request): Promise<{
clientSecret: string;
intentId: string;
}>;Start a Stripe payment session for the given PaymentRequest.
Parameters ​
| Parameter | Type |
|---|---|
request | PaymentRequest |
Returns ​
Promise<{ clientSecret: string; intentId: string; }>
the created Stripe PaymentIntent's ID and the Stripe client_secret the caller forwards to the browser.
Throws ​
if the request is not PENDING.
Throws ​
if the beneficiary is no longer payable (soft-deleted, type became invalid, etc.).