customer

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 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 Customer

type Customer 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"`
	FirstName      string                      `json:"first_name,omitempty"`
	LastName       string                      `json:"last_name,omitempty"`
	Email          string                      `json:"email,omitempty"`
	Phone          string                      `json:"phone,omitempty"`
	Metadata       client.Metadata             `json:"metadata,omitempty"`
	CustomerCode   string                      `json:"customer_code,omitempty"`
	Subscriptions  []subscription.Subscription `json:"subscriptions,omitempty"`
	Authorizations []interface{}               `json:"authorizations,omitempty"`
	RiskAction     string                      `json:"risk_action"`
}

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

type DefaultCustomerService

type DefaultCustomerService struct {
	*client.Client
}

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

func (*DefaultCustomerService) Create

func (s *DefaultCustomerService) Create(customer *Customer) (*Customer, error)

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

func (*DefaultCustomerService) DeactivateAuthorization

func (s *DefaultCustomerService) DeactivateAuthorization(authorizationCode string) (*response.Response, error)

DeactivateAuthorization deactivates an authorization For more details see https://developers.paystack.co/v1.0/reference#deactivate-authorization

func (*DefaultCustomerService) Get

func (s *DefaultCustomerService) Get(customerCode string) (*Customer, error)

Get returns the details of a customer. For more details see https://paystack.com/docs/api/#customer-fetch

func (*DefaultCustomerService) List

func (s *DefaultCustomerService) List() (*List, error)

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

func (*DefaultCustomerService) ListN

func (s *DefaultCustomerService) ListN(count, offset int) (*List, error)

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

func (*DefaultCustomerService) SetRiskAction

func (s *DefaultCustomerService) SetRiskAction(customerCode, riskAction string) (*Customer, error)

SetRiskAction can be used to either whitelist or blacklist a customer For more details see https://developers.paystack.co/v1.0/reference#whiteblacklist-customer

func (*DefaultCustomerService) Update

func (s *DefaultCustomerService) Update(customer *Customer) (*Customer, error)

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

func (*DefaultCustomerService) ValidateCustomer added in v0.2.0

func (s *DefaultCustomerService) ValidateCustomer(customerId string, request *ValidateCustomerRequest) (bool, error)

type List

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

List is a list object for customers.

type Service

type Service interface {
	Create(customer *Customer) (*Customer, error)
	Update(customer *Customer) (*Customer, error)
	Get(customerCode string) (*Customer, error)
	List() (*List, error)
	ListN(count, offset int) (*List, error)
	SetRiskAction(customerCode, riskAction string) (*Customer, error)
	DeactivateAuthorization(authorizationCode string) (*response.Response, error)
	ValidateCustomer(customerId string, request *ValidateCustomerRequest) (bool, error)
}

type ValidateCustomerRequest added in v0.2.0

type ValidateCustomerRequest struct {
	Country       string `json:"country,omitempty"`
	Type          string `json:"type,omitempty"`
	AccountNumber string `json:"account_number,omitempty"`
	Bvn           string `json:"bvn,omitempty"`
	BankCode      string `json:"bank_code,omitempty"`
	FirstName     string `json:"first_name,omitempty"`
	LastName      string `json:"last_name,omitempty"`
}

Jump to

Keyboard shortcuts

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