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

smobilpay.*WebhookRequest.IsFailed   A

Complexity

Conditions 2

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
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