cardconnect

package
v1.1.1345 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthorizePath = "/cardconnect/rest/auth"
	CapturePath   = "/cardconnect/rest/capture"
	VoidPath      = "/cardconnect/rest/void"
	RefundPath    = "/cardconnect/rest/refund"
)

Variables

View Source
var (
	CIT = "C"
	MIT = "M"
	YES = "Y"
	NO  = "N"
)

Functions

This section is empty.

Types

type BinInfo

type BinInfo struct {
	Country       string `json:"country"`
	Product       string `json:"product"`
	Bin           string `json:"bin"`
	CardUseString string `json:"cardusestring"`
	Gsa           bool   `json:"gsa"`
	Corporate     bool   `json:"corporate"`
	Fsa           bool   `json:"fsa"`
	Subtype       string `json:"subtype"`
	Purchase      bool   `json:"purchase"`
	Prepaid       bool   `json:"prepaid"`
	Issuer        string `json:"issuer"`
	Binlo         string `json:"binlo"`
	Binhi         string `json:"binhi"`
}

type CardConnectClient

type CardConnectClient struct {
	URL string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(username string, password string, merchantID string, URL string, environment common.Environment) *CardConnectClient

func NewWithHttpClient

func NewWithHttpClient(username string, password string, merchantID string, URL string, environment common.Environment, httpClient *http.Client) *CardConnectClient

NewWithHttpClient uses authentication with custom http client

func (*CardConnectClient) Authorize

Authorize a transaction. This transaction must be captured to receive funds

func (*CardConnectClient) AuthorizeWithContext added in v1.1.1297

func (client *CardConnectClient) AuthorizeWithContext(ctx context.Context, request *sleet.AuthorizationRequest) (*sleet.AuthorizationResponse, error)

AuthorizeWithContext authorizes a transaction. This transaction must be captured to receive funds

func (*CardConnectClient) Capture

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

Capture an authorized transaction

func (*CardConnectClient) CaptureWithContext added in v1.1.1297

func (client *CardConnectClient) CaptureWithContext(ctx context.Context, request *sleet.CaptureRequest) (*sleet.CaptureResponse, error)

CaptureWithContext captures an authorized transaction

func (*CardConnectClient) Refund

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

Refund a captured transaction

func (*CardConnectClient) RefundWithContext added in v1.1.1297

func (client *CardConnectClient) RefundWithContext(ctx context.Context, request *sleet.RefundRequest) (*sleet.RefundResponse, error)

RefundWithContext refunds a captured transaction

func (*CardConnectClient) Void

func (client *CardConnectClient) Void(request *sleet.VoidRequest) (*sleet.VoidResponse, error)

Void an authorized transaction

func (*CardConnectClient) VoidWithContext added in v1.1.1297

func (client *CardConnectClient) VoidWithContext(ctx context.Context, request *sleet.VoidRequest) (*sleet.VoidResponse, error)

VoidWithContext voids an authorized transaction

type Request

type Request struct {
	MerchantID    string  `json:"merchid"`
	Account       *string `json:"account"`
	Expiry        *string `json:"expiry"`
	Amount        *string `json:"amount,omitempty"`
	Currency      *string `json:"currency,omitempty"`
	CVV2          *string `json:"cvv2,omitempty"`
	COF           *string `json:"cof,omitempty"`
	COFScheduled  *string `json:"cofscheduled,omitempty"`
	Authorization *string `json:"authcode,omitempty"`
	RetRef        *string `json:"retref,omitempty"`
	OrderID       *string `json:"orderid,omitempty"`
	Region        *string `json:"region,omitempty"`
	Name          *string `json:"name,omitempty"`
	Address       *string `json:"address,omitempty"`
	Address2      *string `json:"address2,omitempty"`
	Country       *string `json:"country,omitempty"`
	City          *string `json:"city,omitempty"`
	Postal        *string `json:"postal,omitempty"`
	Phone         *string `json:"phone,omitempty"`
	Email         *string `json:"email,omitempty"`
	Company       *string `json:"company,omitempty"`
}

func UnmarshalRequest

func UnmarshalRequest(data []byte) (Request, error)

func (*Request) Marshal

func (r *Request) Marshal() ([]byte, error)

type Response

type Response struct {
	Message  *string  `json:"message"`
	RespStat string   `json:"respstat"`
	Token    string   `json:"token"`
	RetRef   string   `json:"retref"`
	Amount   string   `json:"amount"`
	Expiry   string   `json:"expiry"`
	MerchID  string   `json:"merchid"`
	RespCode string   `json:"respcode"`
	RespText string   `json:"resptext"`
	AvsResp  string   `json:"avsresp"`
	CVVResp  string   `json:"cvvresp"`
	AuthCode string   `json:"authcode"`
	RespProc string   `json:"respproc"`
	Emv      string   `json:"emv"`
	BinInfo  *BinInfo `json:"binInfo"`
	Account  string   `json:"account"`

	SetlStat *string `json:"setlstat"`
	CommCard *string `json:"commcard"`
	Batchid  *string `json:"batchid"`

	OrderID *string `json:"orderId"`

	Currency *string `json:"currency"`
}

func UnmarshalResponse

func UnmarshalResponse(data []byte) (Response, error)

func (*Response) Marshal

func (r *Response) Marshal() ([]byte, error)

Jump to

Keyboard shortcuts

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