code_corps v0.0.1 CodeCorps.StripeService.WebhookProcessing.WebhookProcessor View Source

Used to process a Stripe webhook request.

Link to this section Summary

Functions

Used to process a Stripe webhook event

Used to process a Stripe webhook event in an async manner

Link to this section Functions

Link to this function process(event_params, handler) View Source

Used to process a Stripe webhook event.

Receives the event JSON as the first parameter.

Since a webhook can be a platform or a connect webhook, the function requires the handler module as the second parameter.

Returns

  • {:ok, %CodeCorps.StripeEvent{}} if the event was processed in some way. This includes the event being previously processed, or erroring out, or even just not being handled at the moment.
  • {:error, :already_processing} if the event already exists locally and is in the process of being handled.
Link to this function process_async(event_params, handler) View Source
process_async(map(), module()) :: CodeCorps.Processor.result()

Used to process a Stripe webhook event in an async manner.

Receives the event JSON as the first parameter.

Since a webhook can be a platform or a connect webhook, the function requires the handler module as the second parameter.

Returns {:ok, pid}