plan

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultPlanService

type DefaultPlanService struct {
	*client.Client
}

DefaultPlanService handles operations related to the plan For more details see https://developers.paystack.co/v1.0/reference#create-plan

func (*DefaultPlanService) Create

func (s *DefaultPlanService) Create(ctx context.Context, plan *Plan) (*Plan, error)

Create creates a new plan For more details see https://developers.paystack.co/v1.0/reference#create-plan

func (*DefaultPlanService) Get

func (s *DefaultPlanService) Get(ctx context.Context, id int) (*Plan, error)

Get returns the details of a plan. For more details see https://developers.paystack.co/v1.0/reference#fetch-plan

func (*DefaultPlanService) List

func (s *DefaultPlanService) List(ctx context.Context) (*List, error)

List returns a list of plans. For more details see https://developers.paystack.co/v1.0/reference#list-plans

func (*DefaultPlanService) ListN

func (s *DefaultPlanService) ListN(ctx context.Context, count, offset int) (*List, error)

ListN returns a list of plans For more details see https://developers.paystack.co/v1.0/reference#list-plans

func (*DefaultPlanService) Update

func (s *DefaultPlanService) Update(ctx context.Context, plan *Plan) (response.Response, error)

Update updates a plan's properties. For more details see https://developers.paystack.co/v1.0/reference#update-plan

type List

type List struct {
	Meta   response.ListMeta
	Values []Plan `json:"data"`
}

List is a list object for Plans.

type Plan

type Plan struct {
	ID                int     `json:"id,omitempty"`
	CreatedAt         string  `json:"createdAt,omitempty"`
	UpdatedAt         string  `json:"updatedAt,omitempty"`
	Domain            string  `json:"domain,omitempty"`
	Integration       int     `json:"integration,omitempty"`
	Name              string  `json:"name,omitempty"`
	Description       string  `json:"description,omitempty"`
	PlanCode          string  `json:"plan_code,omitempty"`
	Amount            float32 `json:"amount,omitempty"`
	Interval          string  `json:"interval,omitempty"`
	SendInvoices      bool    `json:"send_invoices,omitempty"`
	SendSMS           bool    `json:"send_sms,omitempty"`
	Currency          string  `json:"currency,omitempty"`
	InvoiceLimit      float32 `json:"invoice_limit,omitempty"`
	HostedPage        string  `json:"hosted_page,omitempty"`
	HostedPageURL     string  `json:"hosted_page_url,omitempty"`
	HostedPageSummary string  `json:"hosted_page_summary,omitempty"`
}

Plan represents a For more details see https://developers.paystack.co/v1.0/reference#create-plan

type Service

type Service interface {
	Create(ctx context.Context, plan *Plan) (*Plan, error)
	Update(ctx context.Context, plan *Plan) (response.Response, error)
	Get(ctx context.Context, id int) (*Plan, error)
	List(ctx context.Context) (*List, error)
	ListN(ctx context.Context, count, offset int) (*List, error)
}

Jump to

Keyboard shortcuts

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