notification

package
v5.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventCodeAuthorisation    = "AUTHORISATION"
	EventCodeCancellation     = "CANCELLATION"
	EventCodeRefund           = "REFUND"
	EventCodeCancelOrRefund   = "CANCEL_OR_REFUND"
	EventCodeCapture          = "CAPTURE"
	EventCodeCaptureFailed    = "CAPTURE_FAILED"
	EventCodeRefundFailed     = "REFUND_FAILED"
	EventCodeRefundedReversed = "REFUNDED_REVERSED"
	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 Notification

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

func (*Notification) GetNotificationItems

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

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

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 NotificationService

type NotificationService common.Service

NotificationService used to namespace this util under the client for consistency and for future prooffing if this ever requires api access

func (*NotificationService) HandleNotificationRequest

func (service *NotificationService) HandleNotificationRequest(req string) (*Notification, error)

HandleNotificationRequest creates a Notification object from the given JSON string

Jump to

Keyboard shortcuts

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