cybersource

package
v1.0.204 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BillingAmount

type BillingAmount struct {
	Amount   string `json:"totalAmount"`
	Currency string `json:"currency"`
}

type BillingInformation

type BillingInformation struct {
	FirstName  string `json:"firstName"`
	LastName   string `json:"lastName"`
	Address1   string `json:"address1"`
	PostalCode string `json:"postalCode"`
	Locality   string `json:"locality"`
	AdminArea  string `json:"administrativeArea"`
	Country    string `json:"country"`
	Phone      string `json:"phoneNumber"`
	Company    string `json:"company"`
	Email      string `json:"email"`
}

type CardInformation

type CardInformation struct {
	ExpYear  string `json:"expirationYear"`
	ExpMonth string `json:"expirationMonth"`
	Number   string `json:"number"`
	CVV      string `json:"securityCode"`
}

type ClientReferenceInformation

type ClientReferenceInformation struct {
	Code          string `json:"code"`
	TransactionID string `json:"transactionID"`
}

type CybersourceClient

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

func NewClient

func NewClient(merchantID string, apiKey string, sharedSecretKey string) *CybersourceClient

func NewWithHttpClient

func NewWithHttpClient(merchantID string, apiKey string, sharedSecretKey string, httpClient *http.Client) *CybersourceClient

func (*CybersourceClient) Authorize

func (*CybersourceClient) Capture

func (client *CybersourceClient) Capture(request *sleet.CaptureRequest) (*sleet.CaptureResponse, error)

func (*CybersourceClient) Refund

func (client *CybersourceClient) Refund(request *sleet.RefundRequest) (*sleet.RefundResponse, error)

func (*CybersourceClient) Void

func (client *CybersourceClient) Void(request *sleet.VoidRequest) (*sleet.VoidResponse, error)
type Link struct {
	Href   string `json:"href"`
	Method string `json:"method"`
}
type Links struct {
	Self         *Link `json:"self,omitempty"`
	AuthReversal *Link `json:"authReversal,omitempty"`
	Capture      *Link `json:"capture,omitempty"`
	Refund       *Link `json:"refund,omitempty"`
	Void         *Link `json:"void,omitempty"`
}

type OrderInformation

type OrderInformation struct {
	BillTo        BillingInformation `json:"billTo"`
	BillingAmount BillingAmount      `json:"amountDetails"`
}

type PaymentInformation

type PaymentInformation struct {
	Card CardInformation `json:"card"`
}

type ProcessingInformation

type ProcessingInformation struct {
	Capture           bool   `json:"capture,omitempty"`
	CommerceIndicator string `json:"commerceIndicator"` // typically internet
	PaymentSolution   string `json:"paymentSolution"`
}

type ProcessorInformation

type ProcessorInformation struct {
	ApprovalCode     string `json:"approvalCode"`
	CardVerification struct {
		ResultCode string `json:"resultCode"`
	} `json:"cardVerification"`
	ResponseCode string `json:"responseCode"`
	AVS          struct {
		Code    string `json:"code"`
		CodeRaw string `json:"codeRaw"`
	} `json:"avs"`
}

type Request

type Request struct {
	ClientReferenceInformation *ClientReferenceInformation `json:"clientReferenceInformation,omitempty"`
	ProcessingInformation      *ProcessingInformation      `json:"processingInformation,omitempty"`
	OrderInformation           *OrderInformation           `json:"orderInformation,omitempty"`
	PaymentInformation         *PaymentInformation         `json:"paymentInformation,omitempty"`
}

Should we just combine these to one Request and have pointers?

type Response

type Response struct {
	SubmitTimeUTC              string                      `json:"submitTimeUtc"`
	Status                     string                      `json:"status"` // TODO: Make into enum
	ClientReferenceInformation *ClientReferenceInformation `json:"clientReferenceInformation,omitempty"`
	ID                         *string                     `json:"id,omitempty"`
	OrderInformation           *OrderInformation           `json:"orderInformation,omitempty"`
	ReconciliationID           *string                     `json:"reconciliationId,omitempty"`
	Links                      *Links                      `json:"_links,omitempty"`
	ErrorReason                *string                     `json:"reason,omitempty"`
	ErrorMessage               *string                     `json:"message,omitempty"`
	ProcessorInformation       *ProcessorInformation       `json:"processorInformation,omitempty"`
}

Jump to

Keyboard shortcuts

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