Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
[NMI] Send Message in AuthorizationResponse (#264)
Browse files Browse the repository at this point in the history
We were not passing through the response message from NMI. Now, we are!
  • Loading branch information
Wolfizen authored Oct 12, 2023
1 parent 4c384fe commit 63f9208
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gateways/nmi/nmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ func (client *NMIClient) AuthorizeWithContext(ctx context.Context, request *slee
}

responseHeader := sleet.GetHTTPResponseHeader(request.Options, *httpResponse)
// "2" means declined and "3" means bad request
// "1" means successful, "2" means declined, and "3" means bad request
if nmiResponse.Response != "1" {
return &sleet.AuthorizationResponse{
Success: false,
Response: nmiResponse.ResponseCode,
ErrorCode: nmiResponse.ResponseCode,
Message: nmiResponse.ResponseText,
StatusCode: httpResponse.StatusCode,
Header: responseHeader,
}, nil
Expand All @@ -78,6 +79,7 @@ func (client *NMIClient) AuthorizeWithContext(ctx context.Context, request *slee
AvsResult: sleet.AVSResponseUnknown,
CvvResult: sleet.CVVResponseUnknown,
Response: nmiResponse.ResponseCode,
Message: nmiResponse.ResponseText,
AvsResultRaw: nmiResponse.AVSResponseCode,
CvvResultRaw: nmiResponse.CVVResponseCode,
StatusCode: httpResponse.StatusCode,
Expand Down

0 comments on commit 63f9208

Please sign in to comment.