Skip to content

Commit

Permalink
add deny transaction method
Browse files Browse the repository at this point in the history
  • Loading branch information
omarxp committed Jun 16, 2020
1 parent 54da2d2 commit a81742b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions core.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,23 @@ func (gateway *CoreGateway) Approve(orderID string) (Response, error) {
return resp, nil
}

// Deny : Deny a transaction using order ID which gets challenge status from Fraud Detection System
func (gateway *CoreGateway) Deny(orderID string) (Response, error) {
resp := Response{}

err := gateway.Call("POST", "v2/"+orderID+"/deny", nil, &resp)
if err != nil {
gateway.Client.Logger.Println("Error while deny: ", err)
return resp, err
}

if resp.StatusMessage != "" {
gateway.Client.Logger.Println(resp.StatusMessage)
}

return resp, nil
}

// Cancel : Cancel order using order ID
func (gateway *CoreGateway) Cancel(orderID string) (Response, error) {
resp := Response{}
Expand Down

0 comments on commit a81742b

Please sign in to comment.