mhooks

package
v0.47.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeAccountCreated           = moov.EventTypeAccountCreated
	EventTypeAccountDisconnected      = moov.EventTypeAccountDisconnected
	EventTypeAccountUpdated           = moov.EventTypeAccountUpdated
	EventTypeBalanceUpdated           = moov.EventTypeBalanceUpdated
	EventTypeBankAccountCreated       = moov.EventTypeBankAccountCreated
	EventTypeBankAccountDeleted       = moov.EventTypeBankAccountDeleted
	EventTypeBankAccountUpdated       = moov.EventTypeBankAccountUpdated
	EventTypeBillingStatementCreated  = moov.EventTypeBillingStatementCreated
	EventTypeCancellationCreated      = moov.EventTypeCancellationCreated
	EventTypeCancellationUpdated      = moov.EventTypeCancellationUpdated
	EventTypeCardAutoUpdated          = moov.EventTypeCardAutoUpdated
	EventTypeCapabilityRequested      = moov.EventTypeCapabilityRequested
	EventTypeCapabilityUpdated        = moov.EventTypeCapabilityUpdated
	EventTypeDisputeCreated           = moov.EventTypeDisputeCreated
	EventTypeDisputeUpdated           = moov.EventTypeDisputeUpdated
	EventTypeInvoiceCreated           = moov.EventTypeInvoiceCreated
	EventTypeInvoiceUpdated           = moov.EventTypeInvoiceUpdated
	EventTypeNetworkIDUpdated         = moov.EventTypeNetworkIDUpdated
	EventTypePaymentMethodDisabled    = moov.EventTypePaymentMethodDisabled
	EventTypePaymentMethodEnabled     = moov.EventTypePaymentMethodEnabled
	EventTypeRefundCreated            = moov.EventTypeRefundCreated
	EventTypeRefundUpdated            = moov.EventTypeRefundUpdated
	EventTypeRepresentativeCreated    = moov.EventTypeRepresentativeCreated
	EventTypeRepresentativeDeleted    = moov.EventTypeRepresentativeDeleted
	EventTypeRepresentativeUpdated    = moov.EventTypeRepresentativeUpdated
	EventTypeSweepCreated             = moov.EventTypeSweepCreated
	EventTypeSweepUpdated             = moov.EventTypeSweepUpdated
	EventTypeTestPing                 = moov.EventTypeTestPing
	EventTypeTicketCreated            = moov.EventTypeTicketCreated
	EventTypeTicketUpdated            = moov.EventTypeTicketUpdated
	EventTypeTicketMessageAdded       = moov.EventTypeTicketMessageAdded
	EventTypeTransferCreated          = moov.EventTypeTransferCreated
	EventTypeTransferUpdated          = moov.EventTypeTransferUpdated
	EventTypeWalletCreated            = moov.EventTypeWalletCreated
	EventTypeWalletUpdated            = moov.EventTypeWalletUpdated
	EventTypeWalletTransactionUpdated = moov.EventTypeWalletTransactionUpdated
)

Variables

View Source
var ErrInvalidSignature = errors.New("calculated signature does not match X-Signature header")

Functions

This section is empty.

Types

type AccountCreated

type AccountCreated struct {
	// ID of the account
	AccountID string `json:"accountID"`
	ForeignID string `json:"foreignID,omitempty"`
}

type AccountDisconnected added in v0.22.0

type AccountDisconnected struct {
	// ID of the account
	AccountID string `json:"accountID"`
	ForeignID string `json:"foreignID,omitempty"`
}

type AccountUpdated

type AccountUpdated struct {
	// ID of the account
	AccountID string `json:"accountID"`
	ForeignID string `json:"foreignID,omitempty"`
}

type BalanceUpdated

type BalanceUpdated struct {
	// ID of the Account associated with the wallet
	AccountID string `json:"accountID"`
	// ID of the Wallet
	WalletID string `json:"walletID"`
}

type BankAccountCreated

type BankAccountCreated struct {
	// ID of the bank account
	BankAccountID string `json:"bankAccountID"`
	// ID of the account where the bank account was created
	AccountID string `json:"accountID"`
	// Status of the bank account
	Status moov.BankAccountStatus `json:"status"`
}

type BankAccountDeleted

type BankAccountDeleted struct {
	// ID of the bank account
	BankAccountID string `json:"bankAccountID"`
	// ID of the account where the bank account was deleted
	AccountID string `json:"accountID"`
}

type BankAccountUpdated

type BankAccountUpdated struct {
	// ID of the bank account
	BankAccountID string `json:"bankAccountID"`
	// ID of the account where the bank account was updated
	AccountID string `json:"accountID"`
	// Status of the bank account
	Status           moov.BankAccountStatus       `json:"status"`
	StatusReason     moov.BankAccountStatusReason `json:"statusReason"`
	ExceptionDetails *moov.ExceptionDetails       `json:"exceptionDetails,omitempty"`
}

type BillingStatementCreated added in v0.23.1

type BillingStatementCreated struct {
	StatementID string `json:"statementID"`
}

type CancellationCreated added in v0.10.0

type CancellationCreated struct {
	CancellationID string                  `json:"cancellationID"`
	TransferID     string                  `json:"transferID"`
	Status         moov.CancellationStatus `json:"status"`
}

type CancellationUpdated added in v0.10.0

type CancellationUpdated struct {
	CancellationID string                  `json:"cancellationID"`
	TransferID     string                  `json:"transferID"`
	Status         moov.CancellationStatus `json:"status"`
}

type CapabilityRequested

type CapabilityRequested struct {
	Capability moov.CapabilityName `json:"capabilityID"`
	// ID of the account requesting the capability
	AccountID string `json:"accountID"`
	ForeignID string `json:"foreignID,omitempty"`
}

type CapabilityUpdated

type CapabilityUpdated struct {
	Capability moov.CapabilityName `json:"capabilityID"`
	// ID of the account requesting the capability
	AccountID string `json:"accountID"`
	ForeignID string `json:"foreignID,omitempty"`
	// Status of the capability
	Status moov.CapabilityStatus `json:"status"`
}

type CardAutoUpdated

type CardAutoUpdated struct {
	// ID of the merchant's Account associated with the updated Card
	AccountID string `json:"accountID"`
	// ID of the Card that was updated
	CardID     string              `json:"cardID"`
	UpdateType moov.CardUpdateType `json:"updateType"`
}

type DisputeCreated

type DisputeCreated struct {
	// ID of the merchant's Account associated with the disputed transaction.
	AccountID string `json:"accountID"`
	// ID of the disputed transfer.
	TransferID string `json:"transferID"`
	// ID of the disputed transaction.
	TransactionID string `json:"transactionID"`
	// ID of the dispute.
	DisputeID string       `json:"disputeID"`
	Status    moov.Dispute `json:"status"`
	Phase     moov.Dispute `json:"phase"`
}

type DisputeUpdated

type DisputeUpdated struct {
	// ID of the merchant's Account associated with the disputed transaction.
	AccountID string `json:"accountID"`
	// ID of the disputed transfer.
	TransferID string `json:"transferID"`
	// ID of the disputed transaction.
	TransactionID string `json:"transactionID"`
	// ID of the dispute.
	DisputeID string             `json:"disputeID"`
	Status    moov.DisputeStatus `json:"status"`
	Phase     moov.DisputePhase  `json:"phase"`
}

type Event

type Event struct {
	EventID   string          `json:"eventID"`
	EventType EventType       `json:"type"`
	CreatedOn time.Time       `json:"createdOn"`
	Data      json.RawMessage `json:"data"`
	// contains filtered or unexported fields
}

func ParseEvent

func ParseEvent(r *http.Request, secret string) (*Event, error)

ParseEvent returns a webhook event with the hydrated payload.

Access the event payload by calling the corresponding getter method. For example, if the event.EventType=account.created, call event.AccountCreated().

The webhook signature is verified using the provided signing secret.

func (Event) AccountCreated

func (e Event) AccountCreated() (*AccountCreated, error)

func (Event) AccountDisconnected added in v0.22.0

func (e Event) AccountDisconnected() (*AccountDisconnected, error)

func (Event) AccountUpdated

func (e Event) AccountUpdated() (*AccountUpdated, error)

func (Event) BalanceUpdated

func (e Event) BalanceUpdated() (*BalanceUpdated, error)

func (Event) BankAccountCreated

func (e Event) BankAccountCreated() (*BankAccountCreated, error)

func (Event) BankAccountDeleted

func (e Event) BankAccountDeleted() (*BankAccountDeleted, error)

func (Event) BankAccountUpdated

func (e Event) BankAccountUpdated() (*BankAccountUpdated, error)

func (Event) BillingStatementCreated added in v0.23.1

func (e Event) BillingStatementCreated() (*BillingStatementCreated, error)

func (Event) CancellationCreated added in v0.10.0

func (e Event) CancellationCreated() (*CancellationCreated, error)

func (Event) CancellationUpdated added in v0.10.0

func (e Event) CancellationUpdated() (*CancellationUpdated, error)

func (Event) CapabilityRequested

func (e Event) CapabilityRequested() (*CapabilityRequested, error)

func (Event) CapabilityUpdated

func (e Event) CapabilityUpdated() (*CapabilityUpdated, error)

func (Event) CardAutoUpdated

func (e Event) CardAutoUpdated() (*CardAutoUpdated, error)

func (Event) DisputeCreated

func (e Event) DisputeCreated() (*DisputeCreated, error)

func (Event) DisputeUpdated

func (e Event) DisputeUpdated() (*DisputeUpdated, error)

func (Event) InvoiceCreated added in v0.30.0

func (e Event) InvoiceCreated() (*InvoiceCreated, error)

func (Event) InvoiceUpdated added in v0.30.0

func (e Event) InvoiceUpdated() (*InvoiceUpdated, error)

func (Event) NetworkIDUpdated

func (e Event) NetworkIDUpdated() (*NetworkIDUpdated, error)

func (Event) PaymentMethodDisabled

func (e Event) PaymentMethodDisabled() (*PaymentMethodDisabled, error)

func (Event) PaymentMethodEnabled

func (e Event) PaymentMethodEnabled() (*PaymentMethodEnabled, error)

func (Event) RefundCreated

func (e Event) RefundCreated() (*RefundCreated, error)

func (Event) RefundUpdated

func (e Event) RefundUpdated() (*RefundUpdated, error)

func (Event) RepresentativeCreated

func (e Event) RepresentativeCreated() (*RepresentativeCreated, error)

func (Event) RepresentativeDeleted

func (e Event) RepresentativeDeleted() (*RepresentativeDeleted, error)

func (Event) RepresentativeUpdated

func (e Event) RepresentativeUpdated() (*RepresentativeUpdated, error)

func (Event) SweepCreated added in v0.6.0

func (e Event) SweepCreated() (*SweepCreated, error)

func (Event) SweepUpdated added in v0.6.0

func (e Event) SweepUpdated() (*SweepUpdated, error)

func (Event) TestPing added in v0.3.0

func (e Event) TestPing() (*TestPing, error)

func (Event) TicketCreated added in v0.22.0

func (e Event) TicketCreated() (*TicketCreated, error)

func (Event) TicketMessageAdded added in v0.22.0

func (e Event) TicketMessageAdded() (*TicketMessageAdded, error)

func (Event) TicketUpdated added in v0.22.0

func (e Event) TicketUpdated() (*TicketUpdated, error)

func (Event) TransferCreated

func (e Event) TransferCreated() (*TransferCreated, error)

func (Event) TransferUpdated

func (e Event) TransferUpdated() (*TransferUpdated, error)

func (Event) WalletCreated added in v0.22.0

func (e Event) WalletCreated() (*WalletCreated, error)

func (Event) WalletTransactionUpdated

func (e Event) WalletTransactionUpdated() (*WalletTransactionUpdated, error)

func (Event) WalletUpdated added in v0.22.0

func (e Event) WalletUpdated() (*WalletUpdated, error)

type EventType

type EventType = moov.EventType

type InvoiceCreated added in v0.30.0

type InvoiceCreated struct {
	AccountID string `json:"accountID"`
	InvoiceID string `json:"invoiceID"`
}

type InvoiceUpdated added in v0.30.0

type InvoiceUpdated struct {
	AccountID string             `json:"accountID"`
	InvoiceID string             `json:"invoiceID"`
	Status    moov.InvoiceStatus `json:"status"`
}

type NetworkIDUpdated

type NetworkIDUpdated struct {
	// ID of account.
	AccountID     string     `json:"accountID"`
	VisaMid       *string    `json:"visaMid,omitempty"`
	MastercardMid *string    `json:"mastercardMid,omitempty"`
	DiscoverMid   *string    `json:"discoverMid,omitempty"`
	AmexMid       *string    `json:"amexMid,omitempty"`
	UpdatedOn     *time.Time `json:"updatedOn,omitempty"`
}

type PaymentMethodDisabled

type PaymentMethodDisabled struct {
	// ID of the payment method
	PaymentMethodID string `json:"paymentMethodID"`
	// ID of the account
	AccountID string `json:"accountID"`
	// ID of the bank account, card, or wallet
	SourceID string `json:"sourceID"`
}

type PaymentMethodEnabled

type PaymentMethodEnabled struct {
	// ID of the payment method
	PaymentMethodID string `json:"paymentMethodID"`
	// ID of the account
	AccountID string `json:"accountID"`
	// ID of the bank account, card, or wallet
	SourceID string `json:"sourceID"`
}

type PaymentMethodPartial

type PaymentMethodPartial struct {
	// ID of the account
	AccountID string `json:"accountID"`
	// ID of the payment method
	PaymentMethodID string `json:"paymentMethodID"`
}

type RefundCreated

type RefundCreated struct {
	// ID of the merchant's Account associated with the refund transfer
	AccountID string `json:"accountID"`
	// ID of the original transfer
	TransferID string `json:"transferID"`
	// ID of the refund transfer
	RefundID string `json:"refundID"`
}

type RefundUpdated

type RefundUpdated struct {
	// ID of the merchant's Account associated with the refund transfer
	AccountID string `json:"accountID"`
	// ID of the original transfer
	TransferID string `json:"transferID"`
	// ID of the refund transfer
	RefundID string `json:"refundID"`
	// Status of the refund transfer
	Status moov.RefundStatus `json:"status"`
}

type RepresentativeCreated

type RepresentativeCreated struct {
	// ID of the representative
	RepresentativeID string `json:"representativeID"`
	// ID of the account
	AccountID string `json:"accountID"`
}

type RepresentativeDeleted

type RepresentativeDeleted struct {
	// ID of the representative
	RepresentativeID string `json:"representativeID"`
	// ID of the account
	AccountID string `json:"accountID"`
}

type RepresentativeUpdated

type RepresentativeUpdated struct {
	// ID of the representative
	RepresentativeID string `json:"representativeID"`
	// ID of the account
	AccountID string `json:"accountID"`
}

type SweepCreated added in v0.6.0

type SweepCreated struct {
	// ID of the sweep
	SweepID string `json:"sweepID"`
	// ID of the Wallet
	WalletID string `json:"walletID"`
}

type SweepUpdated added in v0.6.0

type SweepUpdated struct {
	// ID of the sweep
	SweepID string `json:"sweepID"`
	// ID of the Wallet
	WalletID string           `json:"walletID"`
	Status   moov.SweepStatus `json:"status"`
	// ID of the transfer
	TransferID *string `json:"transferID,omitempty"`
}

SweepUpdated struct for SweepUpdated

type TestPing added in v0.3.0

type TestPing struct {
	Ping bool `json:"ping"`
}

type TicketCreated added in v0.22.0

type TicketCreated struct {
	// ID of the account
	AccountID string `json:"accountID"`
	// ID of the ticket
	TicketID  string `json:"ticketID"`
	ForeignID string `json:"foreignID,omitempty"`
}

type TicketMessageAdded added in v0.22.0

type TicketMessageAdded struct {
	// ID of the account
	AccountID string `json:"accountID"`
	// ID of the ticket
	TicketID  string `json:"ticketID"`
	ForeignID string `json:"foreignID,omitempty"`
}

type TicketUpdated added in v0.22.0

type TicketUpdated struct {
	// ID of the account
	AccountID string `json:"accountID"`
	// ID of the ticket
	TicketID  string `json:"ticketID"`
	ForeignID string `json:"foreignID,omitempty"`
	// Status of the ticket
	Status moov.TicketStatus `json:"status"`
}

type TransferCreated

type TransferCreated struct {
	// ID of the facilitator account
	AccountID string `json:"accountID"`
	// ID of the transfer
	TransferID string `json:"transferID"`
	// Status of the transfer
	Status moov.TransferStatus `json:"status"`
}

type TransferUpdated

type TransferUpdated struct {
	// ID of the facilitator account
	AccountID string `json:"accountID"`
	// ID of the transfer
	TransferID string `json:"transferID"`
	// Status of the transfer
	Status      TransferUpdatedStatus `json:"status"`
	Source      PaymentMethodPartial  `json:"source"`
	Destination PaymentMethodPartial  `json:"destination"`
}

type TransferUpdatedStatus

type TransferUpdatedStatus string
const (
	TransferUpdatedStatus_Pending   TransferUpdatedStatus = "pending"
	TransferUpdatedStatus_Completed TransferUpdatedStatus = "completed"
	TransferUpdatedStatus_Failed    TransferUpdatedStatus = "failed"
	TransferUpdatedStatus_Reversed  TransferUpdatedStatus = "reversed"
	TransferUpdatedStatus_Queued    TransferUpdatedStatus = "queued"
	TransferUpdatedStatus_Canceled  TransferUpdatedStatus = "canceled"

	TransferUpdatedStatus_SourceCompleted  TransferUpdatedStatus = "source.completed"
	TransferUpdatedStatus_SourceCorrected  TransferUpdatedStatus = "source.corrected"
	TransferUpdatedStatus_SourceInitiated  TransferUpdatedStatus = "source.initiated"
	TransferUpdatedStatus_SourceReturned   TransferUpdatedStatus = "source.returned"
	TransferUpdatedStatus_SourceOriginated TransferUpdatedStatus = "source.originated"
	TransferUpdatedStatus_SourceConfirmed  TransferUpdatedStatus = "source.confirmed"
	TransferUpdatedStatus_SourceSettled    TransferUpdatedStatus = "source.settled"
	TransferUpdatedStatus_SourceFailed     TransferUpdatedStatus = "source.failed"
	TransferUpdatedStatus_SourceCanceled   TransferUpdatedStatus = "source.canceled"

	TransferUpdatedStatus_DestinationCompleted              TransferUpdatedStatus = "destination.completed"
	TransferUpdatedStatus_DestinationCorrected              TransferUpdatedStatus = "destination.corrected"
	TransferUpdatedStatus_DestinationInitiated              TransferUpdatedStatus = "destination.initiated"
	TransferUpdatedStatus_DestinationReturned               TransferUpdatedStatus = "destination.returned"
	TransferUpdatedStatus_DestinationOriginated             TransferUpdatedStatus = "destination.originated"
	TransferUpdatedStatus_DestinationConfirmed              TransferUpdatedStatus = "destination.confirmed"
	TransferUpdatedStatus_DestinationFailed                 TransferUpdatedStatus = "destination.failed"
	TransferUpdatedStatus_DestinationAcceptedWithoutPosting TransferUpdatedStatus = "destination.accepted-without-posting"
)

type WalletCreated added in v0.22.0

type WalletCreated struct {
	// ID of the account
	AccountID string `json:"accountID"`
	// ID of the wallet
	WalletID string `json:"walletID"`
}

type WalletTransactionUpdated

type WalletTransactionUpdated struct {
	// ID of the account associated with the wallet
	AccountID string `json:"accountID"`
	// ID of the Wallet
	WalletID string `json:"walletID"`
	// ID of the wallet transaction
	TransactionID string `json:"transactionID"`
	// Status of the wallet transaction
	Status moov.WalletTransactionStatus `json:"status"`
	// Available balance of the wallet.
	AvailableBalance *moov.AvailableBalance `json:"availableBalance,omitempty"`
}

type WalletUpdated added in v0.22.0

type WalletUpdated struct {
	// ID of the account
	AccountID string `json:"accountID"`
	// ID of the wallet
	WalletID string `json:"walletID"`
	// Status of the wallet
	Status moov.WalletStatus `json:"status"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL