-
Notifications
You must be signed in to change notification settings - Fork 45
/
shipping_address.go
43 lines (32 loc) · 1.57 KB
/
shipping_address.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
package mock
import (
"context"
"github.com/blacklightcms/recurly"
)
var _ recurly.ShippingAddressesService = &ShippingAddressesService{}
type ShippingAddressesService struct {
OnListAccount func(accountCode string, opts *recurly.PagerOptions) recurly.Pager
ListAccountInvoked bool
OnCreate func(ctx context.Context, accountCode string, address recurly.ShippingAddress) (*recurly.ShippingAddress, error)
CreateInvoked bool
OnUpdate func(ctx context.Context, accountCode string, shippingAddressID int, address recurly.ShippingAddress) (*recurly.ShippingAddress, error)
UpdateInvoked bool
OnDelete func(ctx context.Context, accountCode string, shippingAddressID int) error
DeleteInvoked bool
}
func (s *ShippingAddressesService) ListAccount(accountCode string, opts *recurly.PagerOptions) recurly.Pager {
s.ListAccountInvoked = true
return s.OnListAccount(accountCode, opts)
}
func (s *ShippingAddressesService) Create(ctx context.Context, accountCode string, address recurly.ShippingAddress) (*recurly.ShippingAddress, error) {
s.CreateInvoked = true
return s.OnCreate(ctx, accountCode, address)
}
func (s *ShippingAddressesService) Update(ctx context.Context, accountCode string, shippingAddressID int, address recurly.ShippingAddress) (*recurly.ShippingAddress, error) {
s.UpdateInvoked = true
return s.OnUpdate(ctx, accountCode, shippingAddressID, address)
}
func (s *ShippingAddressesService) Delete(ctx context.Context, accountCode string, shippingAddressID int) error {
s.DeleteInvoked = true
return s.OnDelete(ctx, accountCode, shippingAddressID)
}