mhooks

package
v0.0.0-...-6ccbc40 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

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"`
}

type AccountDeleted

type AccountDeleted struct {
	// ID of the account
	AccountID string `json:"accountID"`
}

type AccountUpdated

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

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"`
}

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 CapabilityRequested

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

type CapabilityUpdated

type CapabilityUpdated struct {
	Capability moov.CapabilityName `json:"capabilityID"`
	// ID of the account requesting the capability
	AccountID string `json:"accountID"`
	// 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) AccountDeleted

func (e Event) AccountDeleted() (*AccountDeleted, 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) 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) 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) TestPing

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

func (Event) TransferCreated

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

func (Event) TransferUpdated

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

func (Event) WalletTransactionUpdated

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

type EventType

type EventType string
const (
	EventTypeAccountCreated           EventType = "account.created"
	EventTypeAccountDeleted           EventType = "account.deleted"
	EventTypeAccountUpdated           EventType = "account.updated"
	EventTypeBalanceUpdated           EventType = "balance.updated"
	EventTypeBankAccountCreated       EventType = "bankAccount.created"
	EventTypeBankAccountDeleted       EventType = "bankAccount.deleted"
	EventTypeBankAccountUpdated       EventType = "bankAccount.updated"
	EventTypeCardAutoUpdated          EventType = "card.autoUpdated"
	EventTypeCapabilityRequested      EventType = "capability.requested"
	EventTypeCapabilityUpdated        EventType = "capability.updated"
	EventTypeDisputeCreated           EventType = "dispute.created"
	EventTypeDisputeUpdated           EventType = "dispute.updated"
	EventTypeNetworkIDUpdated         EventType = "networkID.updated"
	EventTypePaymentMethodDisabled    EventType = "paymentMethod.disabled"
	EventTypePaymentMethodEnabled     EventType = "paymentMethod.enabled"
	EventTypeRefundCreated            EventType = "refund.created"
	EventTypeRefundUpdated            EventType = "refund.updated"
	EventTypeRepresentativeCreated    EventType = "representative.created"
	EventTypeRepresentativeDeleted    EventType = "representative.deleted"
	EventTypeRepresentativeUpdated    EventType = "representative.updated"
	EventTypeTestPing                 EventType = "event.test"
	EventTypeTransferCreated          EventType = "transfer.created"
	EventTypeTransferUpdated          EventType = "transfer.updated"
	EventTypeWalletTransactionUpdated EventType = "walletTransaction.updated"
)

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 TestPing

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

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 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"`
}

Jump to

Keyboard shortcuts

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