Passed
Push — main ( 206f54...06bb6a )
by Acho
02:26
created

campay.*Transaction.IsSuccessfull   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
package campay
2
3
// Transaction contains details of an initiated transaction
4
type Transaction struct {
5
	Reference         string  `json:"reference"`
6
	Status            string  `json:"status"`
7
	Amount            float64 `json:"amount"`
8
	Currency          string  `json:"currency"`
9
	Operator          string  `json:"operator"`
10
	Code              string  `json:"code"`
11
	OperatorReference string  `json:"operator_reference"`
12
}
13
14
// IsPending checks if a transaction is pending
15
func (transaction *Transaction) IsPending() bool {
16
	return transaction.Status == "PENDING"
17
}
18
19
// IsSuccessfull checks if a transaction is successfull
20
func (transaction *Transaction) IsSuccessfull() bool {
21
	return transaction.Status == "SUCCESSFUL"
22
}
23