mock

package
v0.0.0-...-bd1588a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(httpClient *http.Client) *recurly.Client

NewClient returns a new instance of *recury.Client with the services assigned to mocks.

Types

type AccountsService

type AccountsService struct {
	OnList      func(params recurly.Params) (*recurly.Response, []recurly.Account, error)
	ListInvoked bool

	OnGet      func(code string) (*recurly.Response, *recurly.Account, error)
	GetInvoked bool

	OnLookupAccountBalance      func(code string) (*recurly.Response, *recurly.AccountBalance, error)
	LookupAccountBalanceInvoked bool

	OnCreate      func(a recurly.Account) (*recurly.Response, *recurly.Account, error)
	CreateInvoked bool

	OnUpdate      func(code string, a recurly.Account) (*recurly.Response, *recurly.Account, error)
	UpdateInvoked bool

	OnClose      func(code string) (*recurly.Response, error)
	CloseInvoked bool

	OnReopen      func(code string) (*recurly.Response, error)
	ReopenInvoked bool

	OnListNotes      func(code string) (*recurly.Response, []recurly.Note, error)
	ListNotesInvoked bool
}

AccountsService represents the interactions available for accounts.

func (*AccountsService) Close

func (m *AccountsService) Close(code string) (*recurly.Response, error)

func (*AccountsService) Create

func (*AccountsService) Get

func (*AccountsService) List

func (*AccountsService) ListNotes

func (m *AccountsService) ListNotes(code string) (*recurly.Response, []recurly.Note, error)

func (*AccountsService) LookupAccountBalance

func (m *AccountsService) LookupAccountBalance(code string) (*recurly.Response, *recurly.AccountBalance, error)

func (*AccountsService) Reopen

func (m *AccountsService) Reopen(code string) (*recurly.Response, error)

func (*AccountsService) Update

type AddOnsService

type AddOnsService struct {
	OnList      func(planCode string, params recurly.Params) (*recurly.Response, []recurly.AddOn, error)
	ListInvoked bool

	OnGet      func(planCode string, code string) (*recurly.Response, *recurly.AddOn, error)
	GetInvoked bool

	OnCreate      func(planCode string, a recurly.AddOn) (*recurly.Response, *recurly.AddOn, error)
	CreateInvoked bool

	OnUpdate      func(planCode string, code string, a recurly.AddOn) (*recurly.Response, *recurly.AddOn, error)
	UpdateInvoked bool

	OnDelete      func(planCode string, code string) (*recurly.Response, error)
	DeleteInvoked bool
}

AddOnsService represents the interactions available for add ons.

func (*AddOnsService) Create

func (m *AddOnsService) Create(planCode string, a recurly.AddOn) (*recurly.Response, *recurly.AddOn, error)

func (*AddOnsService) Delete

func (m *AddOnsService) Delete(planCode string, code string) (*recurly.Response, error)

func (*AddOnsService) Get

func (m *AddOnsService) Get(planCode string, code string) (*recurly.Response, *recurly.AddOn, error)

func (*AddOnsService) List

func (m *AddOnsService) List(planCode string, params recurly.Params) (*recurly.Response, []recurly.AddOn, error)

func (*AddOnsService) Update

func (m *AddOnsService) Update(planCode string, code string, a recurly.AddOn) (*recurly.Response, *recurly.AddOn, error)

type AdjustmentsService

type AdjustmentsService struct {
	OnList      func(accountCode string, params recurly.Params) (*recurly.Response, []recurly.Adjustment, error)
	ListInvoked bool

	OnGet      func(uuid string) (*recurly.Response, *recurly.Adjustment, error)
	GetInvoked bool

	OnCreate      func(accountCode string, a recurly.Adjustment) (*recurly.Response, *recurly.Adjustment, error)
	CreateInvoked bool

	OnDelete      func(uuid string) (*recurly.Response, error)
	DeleteInvoked bool
}

AdjustmentsService represents the interactions available for adjustments.

func (*AdjustmentsService) Create

func (*AdjustmentsService) Delete

func (m *AdjustmentsService) Delete(uuid string) (*recurly.Response, error)

func (*AdjustmentsService) Get

func (*AdjustmentsService) List

func (m *AdjustmentsService) List(accountCode string, params recurly.Params) (*recurly.Response, []recurly.Adjustment, error)

type BillingService

type BillingService struct {
	OnGet      func(accountCode string) (*recurly.Response, *recurly.Billing, error)
	GetInvoked bool

	OnCreate      func(accountCode string, b recurly.Billing) (*recurly.Response, *recurly.Billing, error)
	CreateInvoked bool

	OnCreateWithToken      func(accountCode string, token string) (*recurly.Response, *recurly.Billing, error)
	CreateWithTokenInvoked bool

	OnUpdate      func(accountCode string, b recurly.Billing) (*recurly.Response, *recurly.Billing, error)
	UpdateInvoked bool

	OnUpdateWithToken      func(accountCode string, token string) (*recurly.Response, *recurly.Billing, error)
	UpdateWithTokenInvoked bool

	OnClear      func(accountCode string) (*recurly.Response, error)
	ClearInvoked bool
}

BillingService represents the interactions available for billing.

func (*BillingService) Clear

func (m *BillingService) Clear(accountCode string) (*recurly.Response, error)

func (*BillingService) Create

func (m *BillingService) Create(accountCode string, b recurly.Billing) (*recurly.Response, *recurly.Billing, error)

func (*BillingService) CreateWithToken

func (m *BillingService) CreateWithToken(accountCode string, token string) (*recurly.Response, *recurly.Billing, error)

func (*BillingService) Get

func (m *BillingService) Get(accountCode string) (*recurly.Response, *recurly.Billing, error)

func (*BillingService) Update

func (m *BillingService) Update(accountCode string, b recurly.Billing) (*recurly.Response, *recurly.Billing, error)

func (*BillingService) UpdateWithToken

func (m *BillingService) UpdateWithToken(accountCode string, token string) (*recurly.Response, *recurly.Billing, error)

type CouponsService

type CouponsService struct {
	OnList      func(params recurly.Params) (*recurly.Response, []recurly.Coupon, error)
	ListInvoked bool

	OnGet      func(code string) (*recurly.Response, *recurly.Coupon, error)
	GetInvoked bool

	OnCreate      func(c recurly.Coupon) (*recurly.Response, *recurly.Coupon, error)
	CreateInvoked bool

	OnDelete      func(code string) (*recurly.Response, error)
	DeleteInvoked bool
}

CouponsService represents the interactions available for coupons.

func (*CouponsService) Create

func (*CouponsService) Delete

func (m *CouponsService) Delete(code string) (*recurly.Response, error)

func (*CouponsService) Get

func (*CouponsService) List

type CreditPaymentsService

type CreditPaymentsService struct {
	OnList      func(params recurly.Params) (*recurly.Response, []recurly.CreditPayment, error)
	ListInvoked bool

	OnListAccount      func(code string, params recurly.Params) (*recurly.Response, []recurly.CreditPayment, error)
	ListAccountInvoked bool

	OnGet      func(uuid string) (*recurly.Response, *recurly.CreditPayment, error)
	GetInvoked bool
}

CreditPaymentsService represents the interactions available for credit payments.

func (*CreditPaymentsService) Get

func (*CreditPaymentsService) List

func (*CreditPaymentsService) ListAccount

type InvoicesService

type InvoicesService struct {
	OnList      func(params recurly.Params) (*recurly.Response, []recurly.Invoice, error)
	ListInvoked bool

	OnListAccount      func(accountCode string, params recurly.Params) (*recurly.Response, []recurly.Invoice, error)
	ListAccountInvoked bool

	OnGet      func(invoiceNumber int) (*recurly.Response, *recurly.Invoice, error)
	GetInvoked bool

	OnGetPDF      func(invoiceNumber int, language string) (*recurly.Response, *bytes.Buffer, error)
	GetPDFInvoked bool

	OnPreview      func(accountCode string) (*recurly.Response, *recurly.Invoice, error)
	PreviewInvoked bool

	OnCreate      func(accountCode string, invoice recurly.Invoice) (*recurly.Response, *recurly.Invoice, error)
	CreateInvoked bool

	OnCollect      func(invoiceNumber int) (*recurly.Response, *recurly.Invoice, error)
	CollectInvoked bool

	OnMarkPaid      func(invoiceNumber int) (*recurly.Response, *recurly.Invoice, error)
	MarkPaidInvoked bool

	OnMarkFailed      func(invoiceNumber int) (*recurly.Response, *recurly.Invoice, error)
	MarkFailedInvoked bool

	OnRefundVoidOpenAmount      func(invoiceNumber int, amountInCents int, refundMethod string) (*recurly.Response, *recurly.Invoice, error)
	RefundVoidOpenAmountInvoked bool

	OnVoidCreditInvoice      func(invoiceNumber int) (*recurly.Response, *recurly.Invoice, error)
	VoidCreditInvoiceInvoked bool

	OnRecordPayment      func(pmt recurly.OfflinePayment) (*recurly.Response, *recurly.Transaction, error)
	RecordPaymentInvoked bool
}

InvoicesService represents the interactions available for invoices.

func (*InvoicesService) Collect

func (m *InvoicesService) Collect(invoiceNumber int) (*recurly.Response, *recurly.Invoice, error)

func (*InvoicesService) Create

func (m *InvoicesService) Create(accountCode string, invoice recurly.Invoice) (*recurly.Response, *recurly.Invoice, error)

func (*InvoicesService) Get

func (m *InvoicesService) Get(invoiceNumber int) (*recurly.Response, *recurly.Invoice, error)

func (*InvoicesService) GetPDF

func (m *InvoicesService) GetPDF(invoiceNumber int, language string) (*recurly.Response, *bytes.Buffer, error)

func (*InvoicesService) List

func (*InvoicesService) ListAccount

func (m *InvoicesService) ListAccount(accountCode string, params recurly.Params) (*recurly.Response, []recurly.Invoice, error)

func (*InvoicesService) MarkFailed

func (m *InvoicesService) MarkFailed(invoiceNumber int) (*recurly.Response, *recurly.Invoice, error)

func (*InvoicesService) MarkPaid

func (m *InvoicesService) MarkPaid(invoiceNumber int) (*recurly.Response, *recurly.Invoice, error)

func (*InvoicesService) Preview

func (m *InvoicesService) Preview(accountCode string) (*recurly.Response, *recurly.Invoice, error)

func (*InvoicesService) RecordPayment

func (*InvoicesService) RefundVoidOpenAmount

func (m *InvoicesService) RefundVoidOpenAmount(invoiceNumber int, amountInCents int, refundMethod string) (*recurly.Response, *recurly.Invoice, error)

func (*InvoicesService) VoidCreditInvoice

func (m *InvoicesService) VoidCreditInvoice(invoiceNumber int) (*recurly.Response, *recurly.Invoice, error)

type PlansService

type PlansService struct {
	OnList      func(params recurly.Params) (*recurly.Response, []recurly.Plan, error)
	ListInvoked bool

	OnGet      func(code string) (*recurly.Response, *recurly.Plan, error)
	GetInvoked bool

	OnCreate      func(p recurly.Plan) (*recurly.Response, *recurly.Plan, error)
	CreateInvoked bool

	OnUpdate      func(code string, p recurly.Plan) (*recurly.Response, *recurly.Plan, error)
	UpdateInvoked bool

	OnDelete      func(code string) (*recurly.Response, error)
	DeleteInvoked bool
}

PlansService represents the interactions available for plans.

func (*PlansService) Create

func (*PlansService) Delete

func (m *PlansService) Delete(code string) (*recurly.Response, error)

func (*PlansService) Get

func (m *PlansService) Get(code string) (*recurly.Response, *recurly.Plan, error)

func (*PlansService) List

func (m *PlansService) List(params recurly.Params) (*recurly.Response, []recurly.Plan, error)

func (*PlansService) Update

func (m *PlansService) Update(code string, p recurly.Plan) (*recurly.Response, *recurly.Plan, error)

type PurchasesService

type PurchasesService struct {
	OnCreate      func(p recurly.Purchase) (*recurly.Response, *recurly.InvoiceCollection, error)
	CreateInvoked bool

	OnPreview      func(p recurly.Purchase) (*recurly.Response, *recurly.InvoiceCollection, error)
	PreviewInvoked bool
}

func (*PurchasesService) Create

func (*PurchasesService) Preview

type RedemptionsService

type RedemptionsService struct {
	OnGetForAccount      func(accountCode string) (*recurly.Response, []recurly.Redemption, error)
	GetForAccountInvoked bool

	OnGetForInvoice      func(invoiceNumber string) (*recurly.Response, []recurly.Redemption, error)
	GetForInvoiceInvoked bool

	OnRedeem      func(code string, accountCode string, currency string) (*recurly.Response, *recurly.Redemption, error)
	RedeemInvoked bool

	OnRedeemToSubscription      func(code string, accountCode string, currency string, subscriptionUUID string) (*recurly.Response, *recurly.Redemption, error)
	RedeemToSubscriptionInvoked bool

	OnDelete      func(accountCode string) (*recurly.Response, error)
	DeleteInvoked bool
}

RedemptionsService represents the interactions available for redemptions.

func (*RedemptionsService) Delete

func (m *RedemptionsService) Delete(accountCode string) (*recurly.Response, error)

func (*RedemptionsService) GetForAccount

func (m *RedemptionsService) GetForAccount(accountCode string) (*recurly.Response, []recurly.Redemption, error)

func (*RedemptionsService) GetForInvoice

func (m *RedemptionsService) GetForInvoice(invoiceNumber string) (*recurly.Response, []recurly.Redemption, error)

func (*RedemptionsService) Redeem

func (m *RedemptionsService) Redeem(code string, accountCode string, currency string) (*recurly.Response, *recurly.Redemption, error)

func (*RedemptionsService) RedeemToSubscription

func (m *RedemptionsService) RedeemToSubscription(code string, accountCode string, currency string, subscriptionUUID string) (*recurly.Response, *recurly.Redemption, error)

type ShippingAddressesService

type ShippingAddressesService struct {
	OnListAccount      func(accountCode string, params recurly.Params) (*recurly.Response, []recurly.ShippingAddress, error)
	ListAccountInvoked bool

	OnCreate      func(accountCode string, address recurly.ShippingAddress) (*recurly.Response, *recurly.ShippingAddress, error)
	CreateInvoked bool

	OnUpdate      func(accountCode string, shippingAddressID int64, address recurly.ShippingAddress) (*recurly.Response, *recurly.ShippingAddress, error)
	UpdateInvoked bool

	OnDelete      func(accountCode string, shippingAddressID int64) (*recurly.Response, error)
	DeleteInvoked bool

	OnGetSubscriptions      func(accountCode string, shippingAddress int64) (*recurly.Response, []recurly.Subscription, error)
	GetSubscriptionsInvoked bool
}

func (*ShippingAddressesService) Create

func (*ShippingAddressesService) Delete

func (s *ShippingAddressesService) Delete(accountCode string, shippingAddressID int64) (*recurly.Response, error)

func (*ShippingAddressesService) GetSubscriptions

func (s *ShippingAddressesService) GetSubscriptions(accountCode string, shippingAddress int64) (*recurly.Response, []recurly.Subscription, error)

func (*ShippingAddressesService) ListAccount

func (s *ShippingAddressesService) ListAccount(accountCode string, params recurly.Params) (*recurly.Response, []recurly.ShippingAddress, error)

func (*ShippingAddressesService) Update

func (s *ShippingAddressesService) Update(accountCode string, shippingAddressID int64, address recurly.ShippingAddress) (*recurly.Response, *recurly.ShippingAddress, error)

type SubscriptionsService

type SubscriptionsService struct {
	OnList      func(params recurly.Params) (*recurly.Response, []recurly.Subscription, error)
	ListInvoked bool

	OnListAccount      func(accountCode string, params recurly.Params) (*recurly.Response, []recurly.Subscription, error)
	ListAccountInvoked bool

	OnGet      func(uuid string) (*recurly.Response, *recurly.Subscription, error)
	GetInvoked bool

	OnCreate      func(sub recurly.NewSubscription) (*recurly.Response, *recurly.NewSubscriptionResponse, error)
	CreateInvoked bool

	OnPreview      func(sub recurly.NewSubscription) (*recurly.Response, *recurly.Subscription, error)
	PreviewInvoked bool

	OnUpdate      func(uuid string, sub recurly.UpdateSubscription) (*recurly.Response, *recurly.Subscription, error)
	UpdateInvoked bool

	OnUpdateNotes      func(uuid string, n recurly.SubscriptionNotes) (*recurly.Response, *recurly.Subscription, error)
	UpdateNotesInvoked bool

	OnPreviewChange      func(uuid string, sub recurly.UpdateSubscription) (*recurly.Response, *recurly.Subscription, error)
	PreviewChangeInvoked bool

	OnCancel      func(uuid string) (*recurly.Response, *recurly.Subscription, error)
	CancelInvoked bool

	OnReactivate      func(uuid string) (*recurly.Response, *recurly.Subscription, error)
	ReactivateInvoked bool

	OnTerminateWithPartialRefund      func(uuid string) (*recurly.Response, *recurly.Subscription, error)
	TerminateWithPartialRefundInvoked bool

	OnTerminateWithFullRefund      func(uuid string) (*recurly.Response, *recurly.Subscription, error)
	TerminateWithFullRefundInvoked bool

	OnTerminateWithoutRefund      func(uuid string) (*recurly.Response, *recurly.Subscription, error)
	TerminateWithoutRefundInvoked bool

	OnPostpone      func(uuid string, dt time.Time, bulk bool) (*recurly.Response, *recurly.Subscription, error)
	PostponeInvoked bool

	OnPause      func(uuid string, cycles int) (*recurly.Response, *recurly.Subscription, error)
	PauseInvoked bool

	OnResume      func(uuid string) (*recurly.Response, *recurly.Subscription, error)
	ResumeInvoked bool
}

SubscriptionService mocks the subscription service.

func (*SubscriptionsService) Cancel

func (*SubscriptionsService) Create

func (*SubscriptionsService) Get

func (*SubscriptionsService) List

func (*SubscriptionsService) ListAccount

func (m *SubscriptionsService) ListAccount(accountCode string, params recurly.Params) (*recurly.Response, []recurly.Subscription, error)

func (*SubscriptionsService) Pause

func (*SubscriptionsService) Postpone

func (m *SubscriptionsService) Postpone(uuid string, dt time.Time, bulk bool) (*recurly.Response, *recurly.Subscription, error)

func (*SubscriptionsService) Preview

func (*SubscriptionsService) PreviewChange

func (*SubscriptionsService) Reactivate

func (*SubscriptionsService) Resume

func (*SubscriptionsService) TerminateWithFullRefund

func (m *SubscriptionsService) TerminateWithFullRefund(uuid string) (*recurly.Response, *recurly.Subscription, error)

func (*SubscriptionsService) TerminateWithPartialRefund

func (m *SubscriptionsService) TerminateWithPartialRefund(uuid string) (*recurly.Response, *recurly.Subscription, error)

func (*SubscriptionsService) TerminateWithoutRefund

func (m *SubscriptionsService) TerminateWithoutRefund(uuid string) (*recurly.Response, *recurly.Subscription, error)

func (*SubscriptionsService) Update

func (*SubscriptionsService) UpdateNotes

type TransactionsService

type TransactionsService struct {
	OnList      func(params recurly.Params) (*recurly.Response, []recurly.Transaction, error)
	ListInvoked bool

	OnListAccount      func(accountCode string, params recurly.Params) (*recurly.Response, []recurly.Transaction, error)
	ListAccountInvoked bool

	OnGet      func(uuid string) (*recurly.Response, *recurly.Transaction, error)
	GetInvoked bool

	OnCreate      func(trans recurly.Transaction) (*recurly.Response, *recurly.Transaction, error)
	CreateInvoked bool
}

TransactionsService mocks the transaction service.

func (*TransactionsService) Create

func (*TransactionsService) Get

func (*TransactionsService) List

func (*TransactionsService) ListAccount

func (m *TransactionsService) ListAccount(accountCode string, params recurly.Params) (*recurly.Response, []recurly.Transaction, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL