webhook

package
v8.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EventCodeAuthorisation            = "AUTHORISATION"
	EventCodeAuthorisationAdjustment  = "AUTHORISATION_ADJUSTMENT"
	EventCodeCancellation             = "CANCELLATION"
	EventCodeCancelOrRefund           = "CANCEL_OR_REFUND"
	EventCodeCapture                  = "CAPTURE"
	EventCodeCaptureFailed            = "CAPTURE_FAILED"
	EventCodeHandledExternally        = "HANDLED_EXTERNALLY"
	EventOrderOpened                  = "ORDER_OPENED"
	EventOrderClosed                  = "ORDER_CLOSED"
	EventCodeRefund                   = "REFUND"
	EventCodeRefundFailed             = "REFUND_FAILED"
	EventCodeRefundedReversed         = "REFUNDED_REVERSED"
	EventCodeRefundWithData           = "REFUND_WITH_DATA"
	EventCodeReportAvailable          = "REPORT_AVAILABLE"
	EventCodeVoidPendingRefund        = "VOID_PENDING_REFUND"
	EventCodeChargeback               = "CHARGEBACK"
	EventCodeChargebackReversed       = "CHARGEBACK_REVERSED"
	EventCodeNotificationOfChargeback = "NOTIFICATION_OF_CHARGEBACK"
	EventCodeNotificationOfFraud      = "NOTIFICATION_OF_FRAUD"
	EventCodePrearbitrationLost       = "PREARBITRATION_LOST"
	EventCodePrearbitrationWon        = "PREARBITRATION_WON"
	EventCodeRequestForInformation    = "REQUEST_FOR_INFORMATION"
	EventCodeSecondChargeback         = "SECOND_CHARGEBACK"
	EventCodePayoutExpire             = "PAYOUT_EXPIRE"
	EventCodePayoutDecline            = "PAYOUT_DECLINE"
	EventCodePayoutThirdparty         = "PAYOUT_THIRDPARTY"
	EventCodePaidoutReversed          = "PAIDOUT_REVERSED"
)

Event codes

View Source
const (
	AdditionalDataTotalFraudScore   = "totalFraudScore"
	AdditionalDataFraudCheckPattern = "fraudCheck-(\\d+)-([A-Za-z0-9]+)"
)

Additional Data

Variables

This section is empty.

Functions

This section is empty.

Types

type Amount

type Amount struct {
	// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).
	Currency string `json:"currency"`
	// The payable amount that can be charged for the transaction.  The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes).
	Value int64 `json:"value"`
}

type NotificationItem

type NotificationItem struct {
	NotificationRequestItem NotificationRequestItem `json:"NotificationRequestItem"`
}

type NotificationRequestItem

type NotificationRequestItem struct {
	AdditionalData      *map[string]interface{} `json:"additionalData,omitEmpty"`
	Amount              Amount                  `json:"amount"`
	EventCode           string                  `json:"eventCode"`
	EventDate           *time.Time              `json:"eventDate"`
	MerchantAccountCode string                  `json:"merchantAccountCode"`
	MerchantReference   string                  `json:"merchantReference"`
	Operations          []string                `json:"operations,omitEmpty"`
	OriginalReference   string                  `json:"originalReference,omitEmpty"`
	PaymentMethod       string                  `json:"paymentMethod"`
	PspReference        string                  `json:"pspReference"`
	Reason              string                  `json:"reason"`
	Success             string                  `json:"success"`
}

type Webhook

type Webhook struct {
	Live              string              `json:"live"`
	NotificationItems *[]NotificationItem `json:"notificationItems"`
}

func HandleRequest

func HandleRequest(req string) (*Webhook, error)

HandleRequest creates a Notification object from the given JSON string

func (*Webhook) GetNotificationItems

func (n *Webhook) GetNotificationItems() []*NotificationRequestItem

GetNotificationItems returns a reference to NotificationRequestItem's inside the NotificationItem array

Jump to

Keyboard shortcuts

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