sessions

package
v0.0.0-...-ff628f3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionsPath          = "sessions"
	CollectDataPath       = "collect-data"
	CompletePath          = "complete"
	IssuerFingerprintPath = "issuer-fingerprint"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Acs

type Acs struct {
	ReferenceNumber           string                `json:"reference_number,omitempty"`
	TransactionId             string                `json:"transaction_id,omitempty"`
	OperatorId                string                `json:"operator_id,omitempty"`
	Url                       string                `json:"url,omitempty"`
	SignedContent             string                `json:"signed_content,omitempty"`
	ChallengeMandated         bool                  `json:"challenge_mandated,omitempty"`
	AuthenticationType        string                `json:"authentication_type,omitempty"`
	ChallengeCancelReason     ChallengeCancelReason `json:"challenge_cancel_reason,omitempty"`
	Interface                 SessionInterface      `json:"interface,omitempty"`
	UiTemplate                channels.UIElements   `json:"ui_template,omitempty"`
	ChallengeCancelReasonCode string                `json:"challenge_cancel_reason_code,omitempty"`
}

type AuthenticationMethod

type AuthenticationMethod string
const (
	NoAuthentication         AuthenticationMethod = "no_authentication"
	OwnCredentials           AuthenticationMethod = "own_credentials"
	FederatedId              AuthenticationMethod = "federated_id"
	IssuerCredentials        AuthenticationMethod = "issuer_credentials"
	ThirdPartyAuthentication AuthenticationMethod = "third_party_authentication"
	Fido                     AuthenticationMethod = "fido"
)

type AuthenticationType

type AuthenticationType string
const (
	RegularAuthType   AuthenticationType = "regular"
	RecurringAuthType AuthenticationType = "recurring"
)

type CardInfo

type CardInfo struct {
	InstrumentId string            `json:"instrument_id,omitempty"`
	Fingerprint  string            `json:"fingerprint,omitempty"`
	Metadata     map[string]string `json:"metadata,omitempty"`
}

type CardholderAccountInfo

type CardholderAccountInfo struct {
	PurchaseCount                  int                  `json:"purchase_count,omitempty"`
	AccountAge                     string               `json:"account_age,omitempty"`
	AddCardAttempts                int                  `json:"add_card_attempts,omitempty"`
	ShippingAddressAge             string               `json:"shipping_address_age,omitempty"`
	AccountNameMatchesShippingName bool                 `json:"account_name_matches_shipping_name,omitempty"`
	SuspiciousAccountActivity      bool                 `json:"suspicious_account_activity,omitempty"`
	TransactionsToday              int                  `json:"transactions_today,omitempty"`
	AuthenticationMethod           AuthenticationMethod `json:"authentication_method,omitempty"`
}

type Category

type Category string
const (
	Payment    Category = "payment"
	NonPayment Category = "nonPayment"
)

type ChallengeCancelReason

type ChallengeCancelReason string
const (
	CardHolderCancel    ChallengeCancelReason = "cardholder_cancel"
	TransactionTimedOut ChallengeCancelReason = "transaction_timed_out"
	ChallengeTimedOut   ChallengeCancelReason = "challenge_timed_out"
	TransactionError    ChallengeCancelReason = "transaction_error"
	SdkTimedOut         ChallengeCancelReason = "sdk_timed_out"
	Unknown             ChallengeCancelReason = "unknown"
)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(configuration *configuration.Configuration, apiClient client.HttpClient) *Client

func (*Client) CompleteSession

func (c *Client) CompleteSession(sessionId, sessionSecret string) (*common.MetadataResponse, error)

func (*Client) GetSessionDetails

func (c *Client) GetSessionDetails(sessionId string, sessionSecret string) (*GetSessionResponse, error)

func (*Client) RequestSession

func (c *Client) RequestSession(request SessionRequest) (*SessionResponse, error)

func (*Client) Update3dsMethodCompletion

func (c *Client) Update3dsMethodCompletion(
	sessionId string,
	request ThreeDsMethodCompletionRequest,
	sessionSecret string,
) (*Update3dsMethodCompletionResponse, error)

func (*Client) UpdateSession

func (c *Client) UpdateSession(
	sessionId string,
	request channels.Channel,
	sessionSecret string,
) (*GetSessionResponse, error)

type DeliveryTimeframe

type DeliveryTimeframe string
const (
	ElectronicDelivery DeliveryTimeframe = "electronic_delivery"
	SameDay            DeliveryTimeframe = "same_day"
	Overnight          DeliveryTimeframe = "overnight"
	TwoDayOrMore       DeliveryTimeframe = "two_day_or_more"
)

type Ds

type Ds struct {
	DsId            string `json:"ds_id,omitempty"`
	ReferenceNumber string `json:"reference_number,omitempty"`
	TransactionId   string `json:"transaction_id,omitempty"`
}

type DsPublicKeys

type DsPublicKeys struct {
	DsPublic string `json:"ds_public,omitempty"`
	CaPublic string `json:"ca_public,omitempty"`
}

type GetSessionResponse

type GetSessionResponse struct {
	SessionDetails
}

type Installment

type Installment struct {
	NumberOfPayments    int    `json:"number_of_payments,omitempty"`
	DaysBetweenPayments int    `json:"days_between_payments,omitempty"`
	Expiry              string `json:"expiry,omitempty"`
}

type MerchantRiskInfo

type MerchantRiskInfo struct {
	DeliveryEmail     string            `json:"delivery_email,omitempty"`
	DeliveryTimeframe DeliveryTimeframe `json:"delivery_timeframe,omitempty"`
	IsPreorder        bool              `json:"is_preorder,omitempty"`
	IsReorder         bool              `json:"is_reorder,omitempty"`
	ShippingIndicator ShippingIndicator `json:"shipping_indicator,omitempty"`
}

type NextAction

type NextAction string
const (
	CollectChannelData  NextAction = "collect_channel_data"
	IssueFingerprint    NextAction = "issuer_fingerprint"
	ChallengeCardHolder NextAction = "challenge_cardholder"
	RedirectCardholder  NextAction = "redirect_cardholder"
	Complete            NextAction = "complete"
	Authenticate        NextAction = "authenticate"
)

type Recurring

type Recurring struct {
	DaysBetweenPayments int    `json:"days_between_payments,omitempty"`
	Expiry              string `json:"expiry,omitempty"`
}

type ResponseCode

type ResponseCode string
const (
	Y ResponseCode = "Y"
	N ResponseCode = "N"
	U ResponseCode = "U"
	A ResponseCode = "A"
	C ResponseCode = "C"
	D ResponseCode = "D"
	R ResponseCode = "R"
	I ResponseCode = "I"
)

type SchemeInfo

type SchemeInfo struct {
	Name   sources.SessionScheme `json:"name,omitempty"`
	Score  string                `json:"score,omitempty"`
	Avalgo string                `json:"avalgo,omitempty"`
}

type SessionDetails

type SessionDetails struct {
	HttpMetadata           common.HttpMetadata
	Id                     string                    `json:"id,omitempty"`
	SessionSecret          string                    `json:"session_secret,omitempty"`
	TransactionId          string                    `json:"transaction_id,omitempty"`
	Scheme                 sources.SessionScheme     `json:"scheme,omitempty"`
	Amount                 int64                     `json:"amount,omitempty"`
	Currency               common.Currency           `json:"currency,omitempty"`
	Completed              bool                      `json:"completed,omitempty"`
	Challenged             bool                      `json:"challenged,omitempty"`
	AuthenticationType     AuthenticationType        `json:"authentication_type,omitempty"`
	AuthenticationCategory Category                  `json:"authentication_category,omitempty"`
	Certificates           *DsPublicKeys             `json:"certificates,omitempty"`
	Status                 SessionStatus             `json:"status,omitempty"`
	StatusReason           StatusReason              `json:"status_reason,omitempty"`
	Approved               bool                      `json:"approved,omitempty"`
	ProtocolVersion        string                    `json:"protocol_version,omitempty"`
	Reference              string                    `json:"reference,omitempty"`
	TransactionType        TransactionType           `json:"transaction_type,omitempty"`
	NextActions            []NextAction              `json:"next_actions,omitempty"`
	Ds                     *Ds                       `json:"ds,omitempty"`
	Acs                    *Acs                      `json:"acs,omitempty"`
	ResponseCode           ResponseCode              `json:"response_code,omitempty"`
	ResponseStatusReason   string                    `json:"response_status_reason,omitempty"`
	Pareq                  string                    `json:"pareq,omitempty"`
	Cryptogram             string                    `json:"cryptogram,omitempty"`
	Eci                    string                    `json:"eci,omitempty"`
	Xid                    string                    `json:"xid,omitempty"`
	CardholderInfo         string                    `json:"cardholder_info,omitempty"`
	Card                   *CardInfo                 `json:"card,omitempty"`
	Recurring              *Recurring                `json:"recurring,omitempty"`
	Installment            *Installment              `json:"installment,omitempty"`
	CustomerIp             string                    `json:"customer_ip,omitempty"`
	AuthenticationDate     *time.Time                `json:"authentication_date,omitempty"`
	Exemption              *ThreeDsExemption         `json:"exemption,omitempty"`
	FlowType               common.ThreeDsFlowType    `json:"flow_type,omitempty"`
	ChallengeIndicator     common.ChallengeIndicator `json:"challenge_indicator,omitempty"`
	SchemeInfo             *SchemeInfo               `json:"scheme_info,omitempty"`
	Links                  map[string]common.Link    `json:"_links"`
}

type SessionInterface

type SessionInterface string
const (
	NativeUi SessionInterface = "native_ui"
	Html     SessionInterface = "html"
)

type SessionMarketplaceData

type SessionMarketplaceData struct {
	SubEntityId string `json:"sub_entity_id,omitempty"`
}

type SessionRequest

type SessionRequest struct {
	Source                        sources.SessionSource      `json:"source,omitempty"`
	Amount                        int64                      `json:"amount,omitempty"`
	Currency                      common.Currency            `json:"currency,omitempty"`
	ProcessingChannelId           string                     `json:"processing_channel_id,omitempty"`
	Marketplace                   *SessionMarketplaceData    `json:"marketplace,omitempty"`
	AuthenticationType            AuthenticationType         `json:"authentication_type,omitempty"`
	AuthenticationCategory        Category                   `json:"authentication_category,omitempty"`
	AccountInfo                   *CardholderAccountInfo     `json:"account_info,omitempty"`
	ChallengeIndicator            common.ChallengeIndicator  `json:"challenge_indicator,omitempty"`
	BillingDescriptor             *SessionsBillingDescriptor `json:"billing_descriptor,omitempty"`
	Reference                     string                     `json:"reference,omitempty"`
	MerchantRiskInfo              *MerchantRiskInfo          `json:"merchant_risk_info,omitempty"`
	PriorTransactionReference     string                     `json:"prior_transaction_reference,omitempty"`
	TransactionType               TransactionType            `json:"transaction_type,omitempty"`
	ShippingAddress               *sources.SessionAddress    `json:"shipping_address,omitempty"`
	ShippingAddressMatchesBilling bool                       `json:"shipping_address_matches_billing,omitempty"`
	Completion                    completion.Completion      `json:"completion,omitempty"`
	ChannelData                   channels.Channel           `json:"channel_data,omitempty"`
	Recurring                     *Recurring                 `json:"recurring,omitempty"`
	Installment                   *Installment               `json:"installment,omitempty"`
}

type SessionResponse

type SessionResponse struct {
	Accepted *SessionDetails `json:"accepted,omitempty"`
	Created  *SessionDetails `json:"created,omitempty"`
}

func (*SessionResponse) MapResponse

func (r *SessionResponse) MapResponse(response *SessionDetails)

type SessionSecretCredentials

type SessionSecretCredentials struct {
	SessionSecret string
}

func NewSessionSecretCredentials

func NewSessionSecretCredentials(sessionSecret string) *SessionSecretCredentials

func (*SessionSecretCredentials) GetAuthorization

type SessionStatus

type SessionStatus string
const (
	Pending            SessionStatus = "pending"
	Processing         SessionStatus = "processing"
	Challenged         SessionStatus = "challenged"
	ChallengeAbandoned SessionStatus = "challenge_abandoned"
	Expired            SessionStatus = "expired"
	Approved           SessionStatus = "approved"
	Attempted          SessionStatus = "attempted"
	Unavailable        SessionStatus = "unavailable"
	Declined           SessionStatus = "declined"
	Rejected           SessionStatus = "rejected"
)

type SessionsBillingDescriptor

type SessionsBillingDescriptor struct {
	Name string `json:"name,omitempty"`
}

type ShippingIndicator

type ShippingIndicator string
const (
	Visa ShippingIndicator = "visa"
)

type StatusReason

type StatusReason string
const (
	AresError    StatusReason = "ares_error"
	AresStatus   StatusReason = "ares_status"
	VeresError   StatusReason = "veres_error"
	VeresStatus  StatusReason = "veres_status"
	ParesError   StatusReason = "pares_error"
	ParesStatus  StatusReason = "pares_status"
	RreqError    StatusReason = "rreq_error"
	RreqStatus   StatusReason = "rreq_status"
	RiskDeclined StatusReason = "risk_declined"
)

type ThreeDsExemption

type ThreeDsExemption struct {
	Requested          string              `json:"requested,omitempty"`
	Applied            common.Exemption    `json:"applied,omitempty"`
	Code               string              `json:"code,omitempty"`
	TrustedBeneficiary *TrustedBeneficiary `json:"trusted_beneficiary,omitempty"`
}

type ThreeDsMethodCompletionRequest

type ThreeDsMethodCompletionRequest struct {
	ThreeDsMethodCompletion common.ThreeDsMethodCompletion `json:"three_ds_method_completion,omitempty"`
}

type TransactionType

type TransactionType string
const (
	GoodsService             TransactionType = "goods_service"
	CheckAcceptance          TransactionType = "check_acceptance"
	AccountFunding           TransactionType = "account_funding"
	QuashiCardTransaction    TransactionType = "quashi_card_transaction"
	PrepaidActivationAndLoad TransactionType = "prepaid_activation_and_load"
)

type TrustedBeneficiary

type TrustedBeneficiary struct {
	Status string `json:"status,omitempty"`
	Source string `json:"source,omitempty"`
}

type Update3dsMethodCompletionResponse

type Update3dsMethodCompletionResponse struct {
	HttpMetadata           common.HttpMetadata
	Id                     string                 `json:"id,omitempty"`
	SessionSecret          string                 `json:"session_secret,omitempty"`
	TransactionId          string                 `json:"transaction_id,omitempty"`
	Scheme                 sources.SessionScheme  `json:"scheme,omitempty"`
	Amount                 int64                  `json:"amount,omitempty"`
	Currency               common.Currency        `json:"currency,omitempty"`
	Completed              bool                   `json:"completed,omitempty"`
	Challenged             bool                   `json:"challenged,omitempty"`
	AuthenticationType     AuthenticationType     `json:"authentication_type,omitempty"`
	AuthenticationCategory Category               `json:"authentication_category,omitempty"`
	Certificates           *DsPublicKeys          `json:"certificates,omitempty"`
	Status                 SessionStatus          `json:"status,omitempty"`
	StatusReason           StatusReason           `json:"status_reason,omitempty"`
	Approved               bool                   `json:"approved,omitempty"`
	ProtocolVersion        string                 `json:"protocol_version,omitempty"`
	Reference              string                 `json:"reference,omitempty"`
	TransactionType        TransactionType        `json:"transaction_type,omitempty"`
	NextActions            []NextAction           `json:"next_actions,omitempty"`
	Ds                     *Ds                    `json:"ds,omitempty"`
	Acs                    *Acs                   `json:"acs,omitempty"`
	ResponseCode           ResponseCode           `json:"response_code,omitempty"`
	ResponseStatusReason   string                 `json:"response_status_reason,omitempty"`
	Pareq                  string                 `json:"pareq,omitempty"`
	Cryptogram             string                 `json:"cryptogram,omitempty"`
	Eci                    string                 `json:"eci,omitempty"`
	Xid                    string                 `json:"xid,omitempty"`
	Card                   *CardInfo              `json:"card,omitempty"`
	Links                  map[string]common.Link `json:"_links"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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