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.
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,omitempty"` Currency *string `form:"currency,omitempty"` CVV *string `form:"cvv,omitempty"` FirstName *string `form:"first_name,omitempty"` LastName *string `form:"last_name,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"` }
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