Documentation
¶
Index ¶
- type DefaultSubAccountService
- func (s *DefaultSubAccountService) Create(ctx context.Context, subaccount *SubAccount) (*SubAccount, error)
- func (s *DefaultSubAccountService) Get(ctx context.Context, id int) (*SubAccount, error)
- func (s *DefaultSubAccountService) List(ctx context.Context) (*SubAccountList, error)
- func (s *DefaultSubAccountService) ListN(ctx context.Context, count, offset int) (*SubAccountList, error)
- func (s *DefaultSubAccountService) Update(ctx context.Context, subaccount *SubAccount) (*SubAccount, error)
- type Service
- type SubAccount
- type SubAccountList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultSubAccountService ¶
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 ¶
func (s *DefaultSubAccountService) Get(ctx context.Context, id int) (*SubAccount, error)
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 ¶
func (s *DefaultSubAccountService) List(ctx context.Context) (*SubAccountList, error)
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.