Total Lines | 13 |
Duplicated Lines | 0 % |
Changes | 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 |