subaccount

package
v0.6.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 DefaultSubAccountService

type DefaultSubAccountService struct {
	*client.Client
}

DefaultSubAccountService handles operations related to subaccounts For more details see https://developers.paystack.co/v1.0/reference#create-subaccount

func (*DefaultSubAccountService) Create

func (s *DefaultSubAccountService) Create(ctx context.Context, subaccount *SubAccount) (*SubAccount, error)

Create creates a new subaccount For more details see https://paystack.com/docs/api/#subaccount-create

func (*DefaultSubAccountService) Get

Get returns the details of a subaccount. For more details see https://developers.paystack.co/v1.0/reference#fetch-subaccount TODO: use ID or slug

func (*DefaultSubAccountService) List

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

func (*DefaultSubAccountService) ListN

func (s *DefaultSubAccountService) ListN(ctx context.Context, count, offset int) (*SubAccountList, error)

ListN returns a list of subaccounts For more details see https://paystack.com/docs/api/#subaccount-list

func (*DefaultSubAccountService) Update

func (s *DefaultSubAccountService) Update(ctx context.Context, subaccount *SubAccount) (*SubAccount, error)

Update updates a subaccount's properties. For more details see https://developers.paystack.co/v1.0/reference#update-subaccount TODO: use ID or slug

type Service

type Service interface {
	Create(ctx context.Context, subaccount *SubAccount) (*SubAccount, error)
	Update(ctx context.Context, subaccount *SubAccount) (*SubAccount, error)
	Get(ctx context.Context, id int) (*SubAccount, error)
	List(ctx context.Context) (*SubAccountList, error)
	ListN(ctx context.Context, count, offset int) (*SubAccountList, error)
}

type SubAccount

type SubAccount 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"`
	BusinessName        string          `json:"business_name,omitempty"`
	SubAccountCode      string          `json:"subaccount_code,omitempty"`
	Description         string          `json:"description,omitempty"`
	PrimaryContactName  string          `json:"primary_contact_name,omitempty"`
	PrimaryContactEmail string          `json:"primary_contact_email,omitempty"`
	PrimaryContactPhone string          `json:"primary_contact_phone,omitempty"`
	Metadata            client.Metadata `json:"metadata,omitempty"`
	PercentageCharge    float32         `json:"percentage_charge,omitempty"`
	IsVerified          bool            `json:"is_verified,omitempty"`
	SettlementBank      string          `json:"settlement_bank,omitempty"`
	AccountNumber       string          `json:"account_number,omitempty"`
	SettlementSchedule  string          `json:"settlement_schedule,omitempty"`
	Active              bool            `json:"active,omitempty"`
	Migrate             bool            `json:"migrate,omitempty"`
}

SubAccount is the resource representing your Paystack subaccount. For more details see https://developers.paystack.co/v1.0/reference#create-subaccount

type SubAccountList

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

SubAccountList is a list object for subaccounts.

Jump to

Keyboard shortcuts

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