Skip to content

threefold.models_to_move.payment #

fn StripeEventData.new #

fn StripeEventData.new() StripeEventData

new creates a new StripeEventData

fn StripeEventRequest.new #

fn StripeEventRequest.new() StripeEventRequest

new creates a new StripeEventRequest

fn StripeWebhookEvent.new #

fn StripeWebhookEvent.new() StripeWebhookEvent

new creates a new StripeWebhookEvent

struct StripeEventData #

struct StripeEventData {
pub mut:
	object              string  // The main object data (JSON as string for flexibility)
	previous_attributes ?string // Previous attributes if this is an update (JSON as string)
}

StripeEventData represents the data portion of a Stripe event

fn (StripeEventData) object #

fn (mut data StripeEventData) object(object string) StripeEventData

object sets the object data (builder pattern)

fn (StripeEventData) previous_attributes #

fn (mut data StripeEventData) previous_attributes(previous_attributes ?string) StripeEventData

previous_attributes sets the previous attributes (builder pattern)

struct StripeEventRequest #

struct StripeEventRequest {
pub mut:
	id              ?string // Request ID (optional)
	idempotency_key ?string // Idempotency key (optional)
}

StripeEventRequest represents request information for a Stripe event

fn (StripeEventRequest) id #

fn (mut request StripeEventRequest) id(id ?string) StripeEventRequest

id sets the request ID (builder pattern)

fn (StripeEventRequest) idempotency_key #

fn (mut request StripeEventRequest) idempotency_key(idempotency_key ?string) StripeEventRequest

idempotency_key sets the idempotency key (builder pattern)

struct StripeWebhookEvent #

struct StripeWebhookEvent {
pub mut:
	id               string              // Event ID
	object           string              // Object type (always "event")
	api_version      ?string             // API version used
	created          i64                 // Creation timestamp
	data             StripeEventData     // Event data
	livemode         bool                // Whether this is a live mode event
	pending_webhooks i32                 // Number of pending webhooks
	request          ?StripeEventRequest // Request information (optional)
	event_type       string              // Type of event (e.g., "payment_intent.succeeded")
}

StripeWebhookEvent represents a Stripe webhook event structure

fn (StripeWebhookEvent) id #

fn (mut event StripeWebhookEvent) id(id string) StripeWebhookEvent

id sets the event ID (builder pattern)

fn (StripeWebhookEvent) object #

fn (mut event StripeWebhookEvent) object(object string) StripeWebhookEvent

object sets the object type (builder pattern)

fn (StripeWebhookEvent) api_version #

fn (mut event StripeWebhookEvent) api_version(api_version ?string) StripeWebhookEvent

api_version sets the API version (builder pattern)

fn (StripeWebhookEvent) created #

fn (mut event StripeWebhookEvent) created(created i64) StripeWebhookEvent

created sets the creation timestamp (builder pattern)

fn (StripeWebhookEvent) data #

fn (mut event StripeWebhookEvent) data(data StripeEventData) StripeWebhookEvent

data sets the event data (builder pattern)

fn (StripeWebhookEvent) livemode #

fn (mut event StripeWebhookEvent) livemode(livemode bool) StripeWebhookEvent

livemode sets the livemode flag (builder pattern)

fn (StripeWebhookEvent) pending_webhooks #

fn (mut event StripeWebhookEvent) pending_webhooks(pending_webhooks i32) StripeWebhookEvent

pending_webhooks sets the pending webhooks count (builder pattern)

fn (StripeWebhookEvent) request #

fn (mut event StripeWebhookEvent) request(request ?StripeEventRequest) StripeWebhookEvent

request sets the request information (builder pattern)

fn (StripeWebhookEvent) event_type #

fn (mut event StripeWebhookEvent) event_type(event_type string) StripeWebhookEvent

event_type sets the event type (builder pattern)

fn (StripeWebhookEvent) is_payment_intent_succeeded #

fn (event StripeWebhookEvent) is_payment_intent_succeeded() bool

Event type helper methods is_payment_intent_succeeded checks if this is a payment intent succeeded event

fn (StripeWebhookEvent) is_payment_intent_failed #

fn (event StripeWebhookEvent) is_payment_intent_failed() bool

is_payment_intent_failed checks if this is a payment intent failed event

fn (StripeWebhookEvent) is_payment_intent_created #

fn (event StripeWebhookEvent) is_payment_intent_created() bool

is_payment_intent_created checks if this is a payment intent created event

fn (StripeWebhookEvent) is_customer_created #

fn (event StripeWebhookEvent) is_customer_created() bool

is_customer_created checks if this is a customer created event

fn (StripeWebhookEvent) is_customer_updated #

fn (event StripeWebhookEvent) is_customer_updated() bool

is_customer_updated checks if this is a customer updated event

fn (StripeWebhookEvent) is_invoice_payment_succeeded #

fn (event StripeWebhookEvent) is_invoice_payment_succeeded() bool

is_invoice_payment_succeeded checks if this is an invoice payment succeeded event

fn (StripeWebhookEvent) is_invoice_payment_failed #

fn (event StripeWebhookEvent) is_invoice_payment_failed() bool

is_invoice_payment_failed checks if this is an invoice payment failed event

fn (StripeWebhookEvent) is_subscription_created #

fn (event StripeWebhookEvent) is_subscription_created() bool

is_subscription_created checks if this is a subscription created event

fn (StripeWebhookEvent) is_subscription_updated #

fn (event StripeWebhookEvent) is_subscription_updated() bool

is_subscription_updated checks if this is a subscription updated event

fn (StripeWebhookEvent) is_subscription_deleted #

fn (event StripeWebhookEvent) is_subscription_deleted() bool

is_subscription_deleted checks if this is a subscription deleted event

fn (StripeWebhookEvent) is_test_event #

fn (event StripeWebhookEvent) is_test_event() bool

is_test_event checks if this is a test mode event

fn (StripeWebhookEvent) is_live_event #

fn (event StripeWebhookEvent) is_live_event() bool

is_live_event checks if this is a live mode event

fn (StripeWebhookEvent) has_previous_attributes #

fn (event StripeWebhookEvent) has_previous_attributes() bool

has_previous_attributes checks if the event has previous attributes (indicating an update)

fn (StripeWebhookEvent) get_event_category #

fn (event StripeWebhookEvent) get_event_category() string

get_event_category returns the category of the event (e.g., "payment_intent", "customer")

fn (StripeWebhookEvent) get_event_action #

fn (event StripeWebhookEvent) get_event_action() string

get_event_action returns the action of the event (e.g., "succeeded", "failed", "created")