-
Notifications
You must be signed in to change notification settings - Fork 45
/
purchases.go
59 lines (44 loc) · 1.86 KB
/
purchases.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package mock
import (
"context"
"github.com/blacklightcms/recurly"
)
var _ recurly.PurchasesService = &PurchasesService{}
type PurchasesService struct {
OnCreate func(ctx context.Context, p recurly.Purchase) (*recurly.InvoiceCollection, error)
CreateInvoked bool
OnPreview func(ctx context.Context, p recurly.Purchase) (*recurly.InvoiceCollection, error)
PreviewInvoked bool
OnAuthorize func(ctx context.Context, p recurly.Purchase) (*recurly.Purchase, error)
AuthorizeInvoked bool
OnPending func(ctx context.Context, p recurly.Purchase) (*recurly.Purchase, error)
PendingInvoked bool
OnCapture func(ctx context.Context, transactionUUID string) (*recurly.InvoiceCollection, error)
CaptureInvoked bool
OnCancel func(ctx context.Context, transactionUUID string) (*recurly.InvoiceCollection, error)
CancelInvoked bool
}
func (m *PurchasesService) Create(ctx context.Context, p recurly.Purchase) (*recurly.InvoiceCollection, error) {
m.CreateInvoked = true
return m.OnCreate(ctx, p)
}
func (m *PurchasesService) Preview(ctx context.Context, p recurly.Purchase) (*recurly.InvoiceCollection, error) {
m.PreviewInvoked = true
return m.OnPreview(ctx, p)
}
func (m *PurchasesService) Authorize(ctx context.Context, p recurly.Purchase) (*recurly.Purchase, error) {
m.AuthorizeInvoked = true
return m.OnAuthorize(ctx, p)
}
func (m *PurchasesService) Pending(ctx context.Context, p recurly.Purchase) (*recurly.Purchase, error) {
m.PendingInvoked = true
return m.OnPending(ctx, p)
}
func (m *PurchasesService) Capture(ctx context.Context, transactionUUID string) (*recurly.InvoiceCollection, error) {
m.CaptureInvoked = true
return m.OnCapture(ctx, transactionUUID)
}
func (m *PurchasesService) Cancel(ctx context.Context, transactionUUID string) (*recurly.InvoiceCollection, error) {
m.CancelInvoked = true
return m.OnCancel(ctx, transactionUUID)
}