nmi

package
v1.1.1279 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NMIClient

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

NMIClient represents an HTTP client and the associated authentication information required for making a Direct Post API request.

func NewClient

func NewClient(env common.Environment, securityKey string) *NMIClient

NewClient returns a new client for making NMI Direct Post API requests for a given merchant using a specified security key.

func NewWithHttpClient

func NewWithHttpClient(env common.Environment, securityKey string, httpClient *http.Client) *NMIClient

NewWithHttpClient returns a client for making NMI Direct Post API requests for a given merchant using a specified security key. The provided HTTP client will be used to make the requests.

func (*NMIClient) Authorize added in v1.1.370

func (client *NMIClient) Authorize(request *sleet.AuthorizationRequest) (*sleet.AuthorizationResponse, error)

Authorize makes a payment authorization request to NMI for the given payment details. If successful, the authorization response will be returned.

func (*NMIClient) Capture added in v1.1.376

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

Capture captures an authorized payment through NMI. If successful, the capture response will be returned. Multiple captures cannot be made on the same authorization.

func (*NMIClient) Refund added in v1.1.385

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

Refund refunds a NMI transaction that has been captured or settled. If successful, the refund response will be returned. Multiple refunds can be made on the same payment, but the total amount refunded should not exceed the payment total.

func (*NMIClient) Void added in v1.1.381

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

Void cancels a NMI transaction. If successful, the void response will be returned. A previously voided transaction or one that has already been settled cannot be voided.

type Request added in v1.1.370

type Request struct {
	Address1              *string `form:"address1,omitempty"`
	Address2              *string `form:"address2,omitempty"`
	Amount                *string `form:"amount,omitempty"`
	CardExpiration        *string `form:"ccexp,omitempty"`
	CardNumber            *string `form:"ccnumber,omitempty"`
	City                  *string `form:"city,omitempty"`
	Currency              *string `form:"currency,omitempty"`
	CVV                   *string `form:"cvv,omitempty"`
	FirstName             *string `form:"first_name,omitempty"`
	LastName              *string `form:"last_name,omitempty"`
	MerchantDefinedField1 *string `form:"merchant_defined_field_1,omitempty"`
	OrderID               string  `form:"orderid,omitempty"`
	SecurityKey           string  `form:"security_key"`
	State                 *string `form:"state,omitempty"`
	TestMode              *string `form:"test_mode"`
	TransactionID         *string `form:"transactionid,omitempty"`
	TransactionType       string  `form:"type"`
	ZipCode               *string `form:"zip,omitempty"`
	Email                 *string `form:"email,omitempty"`
}

Request contains the information needed for all request types (Auth, Capture, Void, Refund)

type Response added in v1.1.370

type Response struct {
	AuthCode        string `form:"authcode"`
	AVSResponseCode string `form:"avsresponse"`
	CVVResponseCode string `form:"cvvresponse"`
	OrderID         string `form:"orderid"`
	Response        string `form:"response"`
	ResponseCode    string `form:"response_code"`
	ResponseText    string `form:"responsetext"`
	TransactionID   string `form:"transactionid"`
	Type            string `form:"type"`
}

Response contains all of the fields for all Cybersource API call responses

Jump to

Keyboard shortcuts

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