-
Notifications
You must be signed in to change notification settings - Fork 45
/
transactions.go
36 lines (27 loc) · 973 Bytes
/
transactions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package mock
import (
"context"
"github.com/blacklightcms/recurly"
)
var _ recurly.TransactionsService = &TransactionsService{}
// TransactionsService mocks the transaction service.
type TransactionsService struct {
OnList func(opts *recurly.PagerOptions) recurly.Pager
ListInvoked bool
OnListAccount func(accountCode string, opts *recurly.PagerOptions) recurly.Pager
ListAccountInvoked bool
OnGet func(ctx context.Context, uuid string) (*recurly.Transaction, error)
GetInvoked bool
}
func (m *TransactionsService) List(opts *recurly.PagerOptions) recurly.Pager {
m.ListInvoked = true
return m.OnList(opts)
}
func (m *TransactionsService) ListAccount(accountCode string, opts *recurly.PagerOptions) recurly.Pager {
m.ListAccountInvoked = true
return m.OnListAccount(accountCode, opts)
}
func (m *TransactionsService) Get(ctx context.Context, uuid string) (*recurly.Transaction, error) {
m.GetInvoked = true
return m.OnGet(ctx, uuid)
}