Skip to content

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 ​

ParameterType
manager?EntityManager

Returns ​

PaymentRequestCheckoutService

Overrides ​

WithManager.constructor

Properties ​

PropertyModifierTypeInherited from
managerprotectedEntityManagerWithManager.manager

Methods ​

configureLogger() ​

ts
protected configureLogger(logger): void;

Parameters ​

ParameterType
loggerLogger

Returns ​

void

Inherited from ​

WithManager.configureLogger


startPayment() ​

ts
startPayment(request): Promise<{
  clientSecret: string;
  intentId: string;
}>;

Start a Stripe payment session for the given PaymentRequest.

Parameters ​

ParameterType
requestPaymentRequest

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.).