domain

package
v3.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 1 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// PaymentErrorCodeFailed error will be returned when a general error occurred
	PaymentErrorCodeFailed = "failed"
	// PaymentErrorCodeAuthorizeFailed error will be returned when the authorization failed
	PaymentErrorCodeAuthorizeFailed = "authorization_failed"
	// PaymentErrorCodeCaptureFailed error will be returned when capturing failed
	PaymentErrorCodeCaptureFailed = "capture_failed"
	// PaymentErrorAbortedByCustomer error will be returned when the payment will be aborted by the customer
	PaymentErrorAbortedByCustomer = "aborted_by_customer"
	// PaymentErrorCodeCancelled error will be returned when the payment will be canceled
	PaymentErrorCodeCancelled = "cancelled"
	// PaymentErrorDuplicateIdempotencyKey error will be returned when idempotency key already in use
	PaymentErrorDuplicateIdempotencyKey = "duplicate_idempotency_key"

	// PaymentFlowStatusUnapproved payment started
	PaymentFlowStatusUnapproved = "payment_unapproved"
	// PaymentFlowStatusFailed payment failed
	PaymentFlowStatusFailed = "payment_failed"
	// PaymentFlowStatusAborted payment aborted by user
	PaymentFlowStatusAborted = "payment_aborted"
	// PaymentFlowStatusApproved payment approved by payment adapter
	PaymentFlowStatusApproved = "payment_approved"
	// PaymentFlowStatusCompleted payment approved and confirmed by customer
	PaymentFlowStatusCompleted = "payment_completed"
	// PaymentFlowWaitingForCustomer payment waiting for customer
	PaymentFlowWaitingForCustomer = "payment_waiting_for_customer"
	// PaymentFlowStatusCancelled payment cancelled by provider
	PaymentFlowStatusCancelled = "payment_cancelled"

	// PaymentFlowActionShowIframe signals the frontend to show an iframe
	PaymentFlowActionShowIframe = "show_iframe"
	// PaymentFlowActionShowHTML signals the frontend to show HTML
	PaymentFlowActionShowHTML = "show_html"
	// PaymentFlowActionRedirect signals the frontend to do a redirect to a hosted payment page
	PaymentFlowActionRedirect = "redirect"
	// PaymentFlowActionPostRedirect signals the frontend to do a post redirect to a hosted payment page
	PaymentFlowActionPostRedirect = "post_redirect"
	// PaymentFlowActionShowWalletPayment signals the frontend to start a wallet payment
	PaymentFlowActionShowWalletPayment = "show_wallet_payment"
	// PaymentFlowActionTriggerClientSDK signals the frontend to trigger a special client sdk implementation
	PaymentFlowActionTriggerClientSDK = "trigger_client_sdk"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	ErrorMessage string
	ErrorCode    string
}

Error should be used by PaymentGateway to indicate that payment failed (so that the customer can see a speaking message)

func (*Error) Error

func (pe *Error) Error() string

Error getter

type FlowActionData added in v3.1.0

type FlowActionData struct {
	// URL is used to pass URL data to the user if the current state needs some
	URL *url.URL `swaggertype:"string"`
	// DisplayData holds data, normally HTML to be displayed to the user
	DisplayData   string
	FormParameter map[string]FormField
	WalletDetails *WalletDetails
}

FlowActionData contains additional data for the current action

type FlowResult

type FlowResult struct {
	// EarlyPlaceOrder indicates if the order should be placed with the beginning of the payment flow
	EarlyPlaceOrder bool
	// Status contains the current payment status
	Status FlowStatus
}

FlowResult contains information about a newly started flow

type FlowStatus

type FlowStatus struct {
	// Status of the payment flow. E.g. "payment_completed", "payment_waiting_for_customer" or "payment_failed"
	Status string
	// Action to perform to proceed in the payment flow. If status is "payment_waiting_for_customer" this field contains information about what to do - e.g. "redirect" or "show_iframe"
	Action string
	// Data contains additional information related to the action / flow
	Data       interface{}
	ActionData FlowActionData
	// Error contains additional information in case of an error (e.g. payment failed)
	Error *Error
}

FlowStatus contains information about the current payment status

type FormField added in v3.1.0

type FormField struct {
	Value []string
}

FormField contains form fields

type Method

type Method struct {
	//A speaking title
	Title string
	//A unique Code
	Code string
}

Method contains information about a general payment method

type PaymentRequestAPI added in v3.4.0

type PaymentRequestAPI struct {
	Methods               string
	Details               string
	Options               string
	MerchantValidationURL *url.URL `swaggertype:"string"`
	CompleteURL           *url.URL `swaggertype:"string"`
}

PaymentRequestAPI parameters

type WalletDetails added in v3.4.0

type WalletDetails struct {
	UsedPaymentMethod string
	PaymentRequestAPI PaymentRequestAPI
}

WalletDetails for handling wallet payments in the frontend

Jump to

Keyboard shortcuts

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