forked from blacklightcms/recurly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
billing.go
44 lines (33 loc) · 1.29 KB
/
billing.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
37
38
39
40
41
42
43
44
package mock
import (
"context"
"github.com/blacklightcms/recurly"
)
var _ recurly.BillingService = &BillingService{}
// BillingService manages the interactions for billing.
type BillingService struct {
OnGet func(ctx context.Context, accountCode string) (*recurly.Billing, error)
GetInvoked bool
OnCreate func(ctx context.Context, accountCode string, b recurly.Billing) (*recurly.Billing, error)
CreateInvoked bool
OnUpdate func(ctx context.Context, accountCode string, b recurly.Billing) (*recurly.Billing, error)
UpdateInvoked bool
OnClear func(ctx context.Context, accountCode string) error
ClearInvoked bool
}
func (m *BillingService) Get(ctx context.Context, accountCode string) (*recurly.Billing, error) {
m.GetInvoked = true
return m.OnGet(ctx, accountCode)
}
func (m *BillingService) Create(ctx context.Context, accountCode string, b recurly.Billing) (*recurly.Billing, error) {
m.CreateInvoked = true
return m.OnCreate(ctx, accountCode, b)
}
func (m *BillingService) Update(ctx context.Context, accountCode string, b recurly.Billing) (*recurly.Billing, error) {
m.UpdateInvoked = true
return m.OnUpdate(ctx, accountCode, b)
}
func (m *BillingService) Clear(ctx context.Context, accountCode string) error {
m.ClearInvoked = true
return m.OnClear(ctx, accountCode)
}