Passed
Push — main ( 05b9a1...e3569e )
by Acho
02:22
created

webhook.go   A

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 8
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A smobilpay.*WebhookRequest.IsFailed 0 2 2
1
package smobilpay
2
3
// WebhookRequest is the request payload sent to the webhook endpoint
4
type WebhookRequest struct {
5
	Timestamp     string `json:"timestamp"`
6
	TransactionID string `json:"trid"`
7
	ErrorCode     string `json:"errorCode"`
8
	Status        string `json:"status"`
9
}
10
11
// IsFailed checks if a WebhookRequest failed
12
func (request *WebhookRequest) IsFailed() bool {
13
	return request.Status == "ERRORED" || request.Status == "ERROREDREFUNDED"
14
}
15