Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountStripeWebhookRequest ¶
type AccountStripeWebhookRequest struct {
// Raw request body bytes for signature verification.
RawBody []byte `rawbody:"true"`
// Stripe-Signature header value for payload verification.
Signature string `header:"Stripe-Signature"`
// The account these Stripe webhook events belong to.
AccountID string `path:"account_id" validate:"required"`
}
Request for per-account Stripe webhook processing.
type ProcessAccountWebhookEndpoint ¶
type ProcessAccountWebhookEndpoint struct{}
Processes a Stripe webhook event delivered by an account's own connected Stripe account.
The payload is verified against the webhook secret stored on that account's Stripe integration. A succeeded payment is linked to the sales order it references and recorded as a customer payment; failed and canceled payments undo that link, and a completed payout marks the payments it covers as having reached the account's bank. Other event types, and payments that reference an order the account does not own, are acknowledged without action. Processing is idempotent, so Stripe's retries are safe.
func (*ProcessAccountWebhookEndpoint) Materialize ¶
func (e *ProcessAccountWebhookEndpoint) Materialize() *apiendpoint.APIEndpoint[*AccountStripeWebhookRequest, *apiresource.WebhookResponse]
type ProcessWebhookEndpoint ¶
type ProcessWebhookEndpoint struct{}
Processes a Stripe webhook event delivered to OpenMRP's own Stripe account.
The payload's signature is verified, then the events OpenMRP acts on — subscription servicing and collection changes, billing cadence outcomes, customer deletions, and completed checkouts — are queued for asynchronous handling; every other event type is acknowledged and dropped. A success response means the event was accepted, not that it has already been applied to the account.
func (*ProcessWebhookEndpoint) Materialize ¶
func (e *ProcessWebhookEndpoint) Materialize() *apiendpoint.APIEndpoint[*apiresource.StripeWebhookRequest, *apiresource.WebhookResponse]
type WebhookSvc ¶
type WebhookSvc interface {
ProcessWebhook(ctx context.Context, req *apiresource.StripeWebhookRequest) (*apiresource.WebhookResponse, *apierror.APIError)
ProcessAccountWebhook(ctx context.Context, req *AccountStripeWebhookRequest) (*apiresource.WebhookResponse, *apierror.APIError)
}
func NewWebhookSvc ¶
func NewWebhookSvc(config *WebhookSvcConfig) WebhookSvc
type WebhookSvcConfig ¶
type WebhookSvcConfig struct {
// BillingClient (required) is the billing-service gRPC client.
BillingClient pb.BillingServiceClient
// SalesClient (required) is the core-service sales gRPC client, which verifies and records per-account Stripe webhook events.
SalesClient corepb.CoreSalesServiceClient
}