paystack

package
v0.0.0-...-9286b18 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2017 License: BSD-2-Clause, BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.

func CheckResponse

func CheckResponse(r *http.Response) error

CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have either no response body, or a JSON response body that maps to ErrorResponse. Any other response body will be silently ignored.

The error types are listed as follows, *ServerError for status code between 500 and 504 inclusive, *BadRequestError for 400 status codes *NotFoundError for 404 status codes and *AuthError for authentication errors.

func Int

func Int(v int) *int

Int is a helper routine that allocates a new int value to store v and returns a pointer to it.

func SecretKey

func SecretKey(key string) func(*Client)

SecretKey is a referential function that sets the users secret key when initializing the client

func String

func String(v string) *string

String is a helper routine that allocates a new string value to store v and returns a pointer to it.

Types

type AccountData

type AccountData struct {
	AccountNumber *string `json:"account_number, omitempty"`
	AccountName   *string `json:"account_name, omitempty"`
}

func (*AccountData) GetAccountName

func (a *AccountData) GetAccountName() string

GetAccountName returns the AccountName field if it's non-nil, zero value otherwise.

func (*AccountData) GetAccountNumber

func (a *AccountData) GetAccountNumber() string

GetAccountNumber returns the AccountNumber field if it's non-nil, zero value otherwise.

type AuthError

type AuthError ErrorResponse

AuthError occurs when the request was not authorized. This can be triggered by passing an invalid secret key in the authorization header or the lack of one.

func (*AuthError) Error

func (r *AuthError) Error() string

type Authorization

type Authorization struct {
	AuthorizationCode *string `json:"authorization_code, omitempty"`
	CardType          *string `json:"card_type, omitempty"`
	Last4             *string `json:"last4, omitempty"`
	ExpMonth          *string `json:"exp_month, omitempty"`
	ExpYear           *string `json:"exp_year, omitempty"`
	Bin               *string `json:"bin, omitempty"`
	Bank              *string `json:"bank, omitempty"`
	Channel           *string `json:"channel, omitempty"`
	Signature         *string `json:"signature, omitempty"`
	Reusable          *bool   `json:"reusable, omitempty"`
	CountryCode       *string `json:"country_code, omitempty"`
	Customer          *string `json:"customer, omitempty"`
}

func (*Authorization) GetAuthorizationCode

func (a *Authorization) GetAuthorizationCode() string

GetAuthorizationCode returns the AuthorizationCode field if it's non-nil, zero value otherwise.

func (*Authorization) GetBank

func (a *Authorization) GetBank() string

GetBank returns the Bank field if it's non-nil, zero value otherwise.

func (*Authorization) GetBin

func (a *Authorization) GetBin() string

GetBin returns the Bin field if it's non-nil, zero value otherwise.

func (*Authorization) GetCardType

func (a *Authorization) GetCardType() string

GetCardType returns the CardType field if it's non-nil, zero value otherwise.

func (*Authorization) GetChannel

func (a *Authorization) GetChannel() string

GetChannel returns the Channel field if it's non-nil, zero value otherwise.

func (*Authorization) GetCountryCode

func (a *Authorization) GetCountryCode() string

GetCountryCode returns the CountryCode field if it's non-nil, zero value otherwise.

func (*Authorization) GetCustomer

func (a *Authorization) GetCustomer() string

GetCustomer returns the Customer field if it's non-nil, zero value otherwise.

func (*Authorization) GetExpMonth

func (a *Authorization) GetExpMonth() string

GetExpMonth returns the ExpMonth field if it's non-nil, zero value otherwise.

func (*Authorization) GetExpYear

func (a *Authorization) GetExpYear() string

GetExpYear returns the ExpYear field if it's non-nil, zero value otherwise.

func (*Authorization) GetLast4

func (a *Authorization) GetLast4() string

GetLast4 returns the Last4 field if it's non-nil, zero value otherwise.

func (*Authorization) GetReusable

func (a *Authorization) GetReusable() bool

GetReusable returns the Reusable field if it's non-nil, zero value otherwise.

func (*Authorization) GetSignature

func (a *Authorization) GetSignature() string

GetSignature returns the Signature field if it's non-nil, zero value otherwise.

type BadRequestError

type BadRequestError ErrorResponse

BadRequestError occurs when a validation or client side error occurred and the request was not fulfilled.

func (*BadRequestError) Error

func (r *BadRequestError) Error() string

type Balance

type Balance struct {
	Currency *string `json:"currency, omitempty"`
	Balance  *int    `json:"balance, omitempty"`
}

func (*Balance) GetBalance

func (b *Balance) GetBalance() int

GetBalance returns the Balance field if it's non-nil, zero value otherwise.

func (*Balance) GetCurrency

func (b *Balance) GetCurrency() string

GetCurrency returns the Currency field if it's non-nil, zero value otherwise.

type BalanceService

type BalanceService service

func (*BalanceService) Check

func (s *BalanceService) Check(ctx context.Context) ([]*Balance, *Response, error)

Check returns an array of balances

Paystack API reference: https://developers.paystack.co/reference#check-balance

type Bank

type Bank struct {
	Name      *string     `json:"name, omitempty"`
	Slug      *string     `json:"slug, omitempty"`
	Code      *string     `json:"code, omitempty"`
	Longcode  *string     `json:"longcode, omitempty"`
	Gateway   *string     `json:"gateway, omitempty"`
	Active    *bool       `json:"active, omitempty"`
	IsDeleted interface{} `json:"is_deleted, omitempty"`
	Id        *int        `json:"id, omitempty"`
	CreatedAt *time.Time  `json:"created_at, omitempty"`
	UpdatedAt *time.Time  `json:"updated_at, omitempty"`
}

func (*Bank) GetActive

func (b *Bank) GetActive() bool

GetActive returns the Active field if it's non-nil, zero value otherwise.

func (*Bank) GetCode

func (b *Bank) GetCode() string

GetCode returns the Code field if it's non-nil, zero value otherwise.

func (*Bank) GetCreatedAt

func (b *Bank) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Bank) GetGateway

func (b *Bank) GetGateway() string

GetGateway returns the Gateway field if it's non-nil, zero value otherwise.

func (*Bank) GetId

func (b *Bank) GetId() int

GetId returns the Id field if it's non-nil, zero value otherwise.

func (*Bank) GetLongcode

func (b *Bank) GetLongcode() string

GetLongcode returns the Longcode field if it's non-nil, zero value otherwise.

func (*Bank) GetName

func (b *Bank) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Bank) GetSlug

func (b *Bank) GetSlug() string

GetSlug returns the Slug field if it's non-nil, zero value otherwise.

func (*Bank) GetUpdatedAt

func (b *Bank) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type Bin

type Bin struct {
	Bin          *string `json:"bin, omitempty"`
	Brand        *string `json:"brand, omitempty"`
	SubBrand     *string `json:"sub_brand, omitempty"`
	CountryCode  *string `json:"country_code, omitempty"`
	CountryName  *string `json:"country_name, omitempty"`
	CardType     *string `json:"card_type, omitempty"`
	Bank         *string `json:"bank, omitempty"`
	LinkedBankId *int    `json:"linked_bank_id, omitempty"`
}

func (*Bin) GetBank

func (b *Bin) GetBank() string

GetBank returns the Bank field if it's non-nil, zero value otherwise.

func (*Bin) GetBin

func (b *Bin) GetBin() string

GetBin returns the Bin field if it's non-nil, zero value otherwise.

func (*Bin) GetBrand

func (b *Bin) GetBrand() string

GetBrand returns the Brand field if it's non-nil, zero value otherwise.

func (*Bin) GetCardType

func (b *Bin) GetCardType() string

GetCardType returns the CardType field if it's non-nil, zero value otherwise.

func (*Bin) GetCountryCode

func (b *Bin) GetCountryCode() string

GetCountryCode returns the CountryCode field if it's non-nil, zero value otherwise.

func (*Bin) GetCountryName

func (b *Bin) GetCountryName() string

GetCountryName returns the CountryName field if it's non-nil, zero value otherwise.

func (*Bin) GetLinkedBankId

func (b *Bin) GetLinkedBankId() int

GetLinkedBankId returns the LinkedBankId field if it's non-nil, zero value otherwise.

func (*Bin) GetSubBrand

func (b *Bin) GetSubBrand() string

GetSubBrand returns the SubBrand field if it's non-nil, zero value otherwise.

type BirthdayRequest

type BirthdayRequest struct {
	Birthday  *string `json:"birthday, omitempty"`
	Reference *string `json:"reference, omitempty"`
}

func (*BirthdayRequest) GetBirthday

func (b *BirthdayRequest) GetBirthday() string

GetBirthday returns the Birthday field if it's non-nil, zero value otherwise.

func (*BirthdayRequest) GetReference

func (b *BirthdayRequest) GetReference() string

GetReference returns the Reference field if it's non-nil, zero value otherwise.

type BulkBatch

type BulkBatch struct {
	Domain         *string    `json:"domain, omitempty"`
	BatchCode      *string    `json:"batch_code, omitempty"`
	Status         *string    `json:"status, omitempty"`
	Id             *int       `json:"id, omitempty"`
	Integration    *int       `json:"integration, omitempty"`
	CreatedAt      *time.Time `json:"createdAt, omitempty"`
	UpdatedAt      *time.Time `json:"updatedAt, omitempty"`
	TotalCharges   *int       `json:"total_charges, omitempty"`
	PendingCharges *int       `json:"pending_charges, omitempty"`
}

func (*BulkBatch) GetBatchCode

func (b *BulkBatch) GetBatchCode() string

GetBatchCode returns the BatchCode field if it's non-nil, zero value otherwise.

func (*BulkBatch) GetCreatedAt

func (b *BulkBatch) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*BulkBatch) GetDomain

func (b *BulkBatch) GetDomain() string

GetDomain returns the Domain field if it's non-nil, zero value otherwise.

func (*BulkBatch) GetId

func (b *BulkBatch) GetId() int

GetId returns the Id field if it's non-nil, zero value otherwise.

func (*BulkBatch) GetIntegration

func (b *BulkBatch) GetIntegration() int

GetIntegration returns the Integration field if it's non-nil, zero value otherwise.

func (*BulkBatch) GetStatus

func (b *BulkBatch) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*BulkBatch) GetUpdatedAt

func (b *BulkBatch) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type BulkBatchRequest

type BulkBatchRequest struct {
	Authorization *string `json:"authorization, omitempty"`
	Amount        *int    `json:"amount, omitempty"`
}

func (*BulkBatchRequest) GetAmount

func (b *BulkBatchRequest) GetAmount() int

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*BulkBatchRequest) GetAuthorization

func (b *BulkBatchRequest) GetAuthorization() string

GetAuthorization returns the Authorization field if it's non-nil, zero value otherwise.

type BulkCharge

type BulkCharge struct {
	Integration   *int          `json:"integration, omitempty"`
	Bulkcharge    *int          `json:"bulkcharge, omitempty"`
	Customer      Customer      `json:"customer, omitempty"`
	Authorization Authorization `json:"authorization, omitempty"`
	Transaction   Transaction   `json:"transaction, omitempty"`
	Domain        *string       `json:"domain, omitempty"`
	Amount        *int          `json:"amount, omitempty"`
	Currency      *string       `json:"currency, omitempty"`
	Status        *string       `json:"status, omitempty"`
	Id            *int          `json:"id, omitempty"`
	CreatedAt     *time.Time    `json:"created_at, omitempty"`
	UpdatedAt     *time.Time    `json:"updated_at, omitempty"`
}

func (*BulkCharge) GetAmount

func (b *BulkCharge) GetAmount() int

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*BulkCharge) GetBulkcharge

func (b *BulkCharge) GetBulkcharge() int

GetBulkcharge returns the Bulkcharge field if it's non-nil, zero value otherwise.

func (*BulkCharge) GetCreatedAt

func (b *BulkCharge) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*BulkCharge) GetCurrency

func (b *BulkCharge) GetCurrency() string

GetCurrency returns the Currency field if it's non-nil, zero value otherwise.

func (*BulkCharge) GetDomain

func (b *BulkCharge) GetDomain() string

GetDomain returns the Domain field if it's non-nil, zero value otherwise.

func (*BulkCharge) GetId

func (b *BulkCharge) GetId() int

GetId returns the Id field if it's non-nil, zero value otherwise.

func (*BulkCharge) GetIntegration

func (b *BulkCharge) GetIntegration() int

GetIntegration returns the Integration field if it's non-nil, zero value otherwise.

func (*BulkCharge) GetStatus

func (b *BulkCharge) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*BulkCharge) GetUpdatedAt

func (b *BulkCharge) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type BulkChargeService

type BulkChargeService service

func (*BulkChargeService) FetchBatch

func (s *BulkChargeService) FetchBatch(ctx context.Context, id string) (*BulkBatch, *Response, error)

FetchBatch

Paystack API reference: https://developers.paystack.co/reference#fetch-bulk-charge-batch

func (*BulkChargeService) FetchBatchCharges

func (s *BulkChargeService) FetchBatchCharges(ctx context.Context, id string, opt *BullkChargeOptions) ([]*BulkCharge, *Response, error)

FetchBatchCharges

Paystack API reference: https://developers.paystack.co/reference#fetch-transaction

func (*BulkChargeService) Initiate

func (s *BulkChargeService) Initiate(ctx context.Context, request []*BulkBatchRequest) (*BulkBatch, *Response, error)

Initiate

Paystack API reference: https://developers.paystack.co/reference#initiate-bulk-charge

func (*BulkChargeService) ListBatches

func (s *BulkChargeService) ListBatches(ctx context.Context, opt *ListOptions) ([]*BulkBatch, *Response, error)

ListBatches

Paystack API reference: https://developers.paystack.co/reference#list-transactions

func (*BulkChargeService) PauseBatch

func (s *BulkChargeService) PauseBatch(ctx context.Context, batch_code string) (*Message, *Response, error)

PauseBatch

Paystack API reference: https://developers.paystack.co/reference#pause-bulk-charge-batch

func (*BulkChargeService) ResumeBatch

func (s *BulkChargeService) ResumeBatch(ctx context.Context, batch_code string) (*Message, *Response, error)

ResumeBatch

Paystack API reference: https://developers.paystack.co/reference#resume-bulk-charge-batch

type BulkTransferRequest

type BulkTransferRequest struct {
	Currency  *string           `json:"currency, omitempty"`
	Source    *string           `json:"source, omitempty"`
	Transfers []TransferRequest `json:"transfers, omitempty"`
}

func (*BulkTransferRequest) GetCurrency

func (b *BulkTransferRequest) GetCurrency() string

GetCurrency returns the Currency field if it's non-nil, zero value otherwise.

func (*BulkTransferRequest) GetSource

func (b *BulkTransferRequest) GetSource() string

GetSource returns the Source field if it's non-nil, zero value otherwise.

type BullkChargeOptions

type BullkChargeOptions struct {
	ListOptions
	Status string `json:"status, omitempty"`
}

type BvnData

type BvnData struct {
	FirstName *string `json:"first_name, omitempty"`
	LastName  *string `json:"last_name, omitempty"`
	Dob       *string `json:"dob, omitempty"`
	Mobile    *string `json:"mobile, omitempty"`
	Bvn       *string `json:"bvn, omitempty"`
}

func (*BvnData) GetBvn

func (b *BvnData) GetBvn() string

GetBvn returns the Bvn field if it's non-nil, zero value otherwise.

func (*BvnData) GetDob

func (b *BvnData) GetDob() string

GetDob returns the Dob field if it's non-nil, zero value otherwise.

func (*BvnData) GetFirstName

func (b *BvnData) GetFirstName() string

GetFirstName returns the FirstName field if it's non-nil, zero value otherwise.

func (*BvnData) GetLastName

func (b *BvnData) GetLastName() string

GetLastName returns the LastName field if it's non-nil, zero value otherwise.

func (*BvnData) GetMobile

func (b *BvnData) GetMobile() string

GetMobile returns the Mobile field if it's non-nil, zero value otherwise.

type Card

type Card struct {
	Number      *string `json:"number, omitempty"`
	CVV         *string `json:"cvv, omitempty"`
	ExpiryMonth *string `json:"expiry_month, omitempty"`
	ExpiryYear  *string `json:"expiry_year, omitempty"`
}

func (*Card) GetCVV

func (c *Card) GetCVV() string

GetCVV returns the CVV field if it's non-nil, zero value otherwise.

func (*Card) GetExpiryMonth

func (c *Card) GetExpiryMonth() string

GetExpiryMonth returns the ExpiryMonth field if it's non-nil, zero value otherwise.

func (*Card) GetExpiryYear

func (c *Card) GetExpiryYear() string

GetExpiryYear returns the ExpiryYear field if it's non-nil, zero value otherwise.

func (*Card) GetNumber

func (c *Card) GetNumber() string

GetNumber returns the Number field if it's non-nil, zero value otherwise.

type ChargeRequest

type ChargeRequest struct {
	Email             *string  `json:"email, omitempty"`
	Card              Card     `json:"card, omitempty"`
	Bank              Bank     `json:"bank, omitempty"`
	AuthorizationCode *string  `json:"authorization_code, omitempty"`
	Pin               *string  `json:"pin, omitempty"`
	Metadata          Metadata `json:"metadata, omitempty"`
}

func (*ChargeRequest) GetAuthorizationCode

func (c *ChargeRequest) GetAuthorizationCode() string

GetAuthorizationCode returns the AuthorizationCode field if it's non-nil, zero value otherwise.

func (*ChargeRequest) GetEmail

func (c *ChargeRequest) GetEmail() string

GetEmail returns the Email field if it's non-nil, zero value otherwise.

func (*ChargeRequest) GetPin

func (c *ChargeRequest) GetPin() string

GetPin returns the Pin field if it's non-nil, zero value otherwise.

type ChargeService

type ChargeService service

func (*ChargeService) Charge

func (s *ChargeService) Charge(ctx context.Context, request *ChargeRequest) (*Transaction, *Response, error)

Charge

Paystack API reference: https://developers.paystack.co/reference#charge

func (*ChargeService) CheckPending

func (s *ChargeService) CheckPending(ctx context.Context, reference *string) (*Transaction, *Response, error)

CheckPending

Paystack API reference: https://developers.paystack.co/reference#check-pending-charge

func (*ChargeService) SubmitBirthday

func (s *ChargeService) SubmitBirthday(ctx context.Context, request *BirthdayRequest) (*Transaction, *Response, error)

SubmitBirthday

Paystack API reference: https://developers.paystack.co/reference#submit-birthday

func (*ChargeService) SubmitOTP

func (s *ChargeService) SubmitOTP(ctx context.Context, request *OTPRequest) (*Transaction, *Response, error)

SubmitOTP

Paystack API reference: https://developers.paystack.co/reference#submit-otp

func (*ChargeService) SubmitPIN

func (s *ChargeService) SubmitPIN(ctx context.Context, request *PinRequest) (*Transaction, *Response, error)

SubmitPIN

Paystack API reference: https://developers.paystack.co/reference#submit-pin

func (*ChargeService) SubmitPhone

func (s *ChargeService) SubmitPhone(ctx context.Context, request *PhoneRequest) (*Transaction, *Response, error)

SubmitPhone

Paystack API reference: https://developers.paystack.co/reference#submit-phone

func (*ChargeService) Tokenize

func (s *ChargeService) Tokenize(ctx context.Context, request *ChargeRequest) (*Authorization, *Response, error)

Tokenize

Paystack API reference: https://developers.paystack.co/reference#charge-tokenize

type Client

type Client struct {

	// Base URL for API requests. Defaults to the  Paystack API url.
	// BaseURL should always be specified with a trailing slash.
	BaseURL *url.URL

	//User agent for communicating with the Paystack API
	UserAgent string

	Secret string

	// Services used for talking to different parts of the Paystack API.
	Balance           *BalanceService
	BulkCharge        *BulkChargeService
	Charge            *ChargeService
	Customer          *CustomerService
	Integration       *IntegrationService
	Miscellaneous     *MiscellaneousService
	Page              *PageService
	Plan              *PlanService
	Settlement        *SettlementService
	Subaccount        *SubaccountService
	Subscription      *SubscriptionService
	Transaction       *TransactionService
	Transfer          *TransferService
	TransferRecipient *TransferRecipientService
	// contains filtered or unexported fields
}

A Client manages communication with the Paystack API

func NewClient

func NewClient(httpClient *http.Client, options ...func(*Client)) *Client

NewClient returns a new Paystack API client. If a nil httpClient is provided, http.DefaultClient will be used.

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it. If rate limit is exceeded and reset time is in the future, Do returns *RateLimitError immediately without making a network API call.

The provided ctx must be non-nil. If it is canceled or times out, ctx.Err() will be returned.

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.

type CustomFields

type CustomFields struct {
	DisplayName  *string `json:"display_name, omitempty"`
	VariableName *string `json:"variable_name, omitempty"`
	Value        *string `json:"value, omitempty"`
}

func (*CustomFields) GetDisplayName

func (c *CustomFields) GetDisplayName() string

GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.

func (*CustomFields) GetValue

func (c *CustomFields) GetValue() string

GetValue returns the Value field if it's non-nil, zero value otherwise.

func (*CustomFields) GetVariableName

func (c *CustomFields) GetVariableName() string

GetVariableName returns the VariableName field if it's non-nil, zero value otherwise.

type Customer

type Customer struct {
	Email          *string         `json:"email, omitempty"`
	FirstName      *string         `json:"first_name,omitempty"`
	LastName       *string         `json:"last_name,omitempty"`
	Phone          *string         `json:"phone,omitempty"`
	Integration    *int            `json:"integration,omitempty"`
	Domain         *string         `json:"domain,omitempty"`
	CustomerCode   *string         `json:"customer_code,omitempty"`
	Id             *int            `json:"id,omitempty"`
	CreatedAt      *time.Time      `json:"createdAt,omitempty"`
	UpdatedAt      *time.Time      `json:"updatedAt,omitempty"`
	Metadata       Metadata        `json:"metadata,omitempty"`
	RiskAction     *string         `json:"risk_action,omitempty"`
	Transactions   []Transaction   `json:"transactions,omitempty"`
	Subscriptions  []Subscription  `json:"subscriptions,omitempty"`
	Authorizations []Authorization `json:"authorizations,omitempty"`
}

func (*Customer) GetCreatedAt

func (c *Customer) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Customer) GetCustomerCode

func (c *Customer) GetCustomerCode() string

GetCustomerCode returns the CustomerCode field if it's non-nil, zero value otherwise.

func (*Customer) GetDomain

func (c *Customer) GetDomain() string

GetDomain returns the Domain field if it's non-nil, zero value otherwise.

func (*Customer) GetEmail

func (c *Customer) GetEmail() string

GetEmail returns the Email field if it's non-nil, zero value otherwise.

func (*Customer) GetFirstName

func (c *Customer) GetFirstName() string

GetFirstName returns the FirstName field if it's non-nil, zero value otherwise.

func (*Customer) GetId

func (c *Customer) GetId() int

GetId returns the Id field if it's non-nil, zero value otherwise.

func (*Customer) GetIntegration

func (c *Customer) GetIntegration() int

GetIntegration returns the Integration field if it's non-nil, zero value otherwise.

func (*Customer) GetLastName

func (c *Customer) GetLastName() string

GetLastName returns the LastName field if it's non-nil, zero value otherwise.

func (*Customer) GetPhone

func (c *Customer) GetPhone() string

GetPhone returns the Phone field if it's non-nil, zero value otherwise.

func (*Customer) GetRiskAction

func (c *Customer) GetRiskAction() string

GetRiskAction returns the RiskAction field if it's non-nil, zero value otherwise.

func (*Customer) GetUpdatedAt

func (c *Customer) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type CustomerOptions

type CustomerOptions struct {
	ExcludeTransactions bool `json:"exclude_transactions, omitempty"`
}

type CustomerRequest

type CustomerRequest struct {
	Email     *string  `json:"email, omitempty"`
	FirstName *string  `json:"first_name,omitempty"`
	LastName  *string  `json:"last_name,omitempty"`
	Phone     *string  `json:"phone,omitempty"`
	Metadata  Metadata `json:"metadata,omitempty"`
}

func (*CustomerRequest) GetEmail

func (c *CustomerRequest) GetEmail() string

GetEmail returns the Email field if it's non-nil, zero value otherwise.

func (*CustomerRequest) GetFirstName

func (c *CustomerRequest) GetFirstName() string

GetFirstName returns the FirstName field if it's non-nil, zero value otherwise.

func (*CustomerRequest) GetLastName

func (c *CustomerRequest) GetLastName() string

GetLastName returns the LastName field if it's non-nil, zero value otherwise.

func (*CustomerRequest) GetPhone

func (c *CustomerRequest) GetPhone() string

GetPhone returns the Phone field if it's non-nil, zero value otherwise.

type CustomerService

type CustomerService service

CustomerService handles the communication with the Customer related

func (*CustomerService) Create

Create returns a new customer

Paystack API reference: https://developers.paystack.co/reference#create-customer

func (*CustomerService) DeactivateAuthorization

func (s *CustomerService) DeactivateAuthorization(ctx context.Context, a *Authorization) (*Message, *Response, error)

DeactivateAuthorization forgets a customer's card the card authentication code is supplied Paystack API reference: https://developers.paystack.co/reference#deactivate-authorization

func (*CustomerService) Fetch

func (s *CustomerService) Fetch(ctx context.Context, id string, options *CustomerOptions) (*Customer, *Response, error)

Fetch returns a new customer with the id

Paystack API reference: https://developers.paystack.co/reference#fetch-customer

func (*CustomerService) List

func (s *CustomerService) List(ctx context.Context, opt *ListOptions) ([]*Customer, *Response, error)

List returns an array all customers

Paystack API reference: https://developers.paystack.co/reference#list-customers

func (*CustomerService) SetRiskAction

func (s *CustomerService) SetRiskAction(ctx context.Context, rap *RiskActionPayload) (*Customer, *Response, error)

SetRiskAction takes a risk action on a customer A RiskActionPayload has to be supplied

Paystack API reference: https://developers.paystack.co/reference#whiteblacklist-customer

func (*CustomerService) Update

func (s *CustomerService) Update(ctx context.Context, cr *CustomerRequest, customerCode string) (*Customer, *Response, error)

Update updates a customer model

Paystack API reference: https://developers.paystack.co/reference#update-customer

type ErrorResponse

type ErrorResponse struct {
	Response *http.Response // HTTP response that caused this error
	Message  string         `json:"message"` // error message
}

An ErrorResponse reports one or more errors caused by an API request. Paystack docs: https://developers.paystack.co/docs/errors

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

type ExportPath

type ExportPath struct {
	Path string `json:"path"`
}

type ExportRequest

type ExportRequest struct {
	From        *time.Time `json:"from, omitempty"`
	To          *time.Time `json:"to, omitempty"`
	Settled     *bool      `json:"settled, omitempty"`
	PaymentPage *int32     `json:"payment_page, omitempty"`
	Customer    *int32     `json:"customer, omitempty"`
	Currency    *string    `json:"currency, omitempty"`
	Settlement  *string    `json:"settlement, omitempty"`
	Amount      *int32     `json:"amount, omitempty"`
	Status      *string    `json:"status, omitempty"`
}

func (*ExportRequest) GetCurrency

func (e *ExportRequest) GetCurrency() string

GetCurrency returns the Currency field if it's non-nil, zero value otherwise.

func (*ExportRequest) GetFrom

func (e *ExportRequest) GetFrom() time.Time

GetFrom returns the From field if it's non-nil, zero value otherwise.

func (*ExportRequest) GetSettled

func (e *ExportRequest) GetSettled() bool

GetSettled returns the Settled field if it's non-nil, zero value otherwise.

func (*ExportRequest) GetSettlement

func (e *ExportRequest) GetSettlement() string

GetSettlement returns the Settlement field if it's non-nil, zero value otherwise.

func (*ExportRequest) GetStatus

func (e *ExportRequest) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*ExportRequest) GetTo

func (e *ExportRequest) GetTo() time.Time

GetTo returns the To field if it's non-nil, zero value otherwise.

type FieldByCurrency

type FieldByCurrency struct {
	Currency *string `json:"currency, omitempty"`
	Amount   *string `json:"amount, omitempty"`
}

func (*FieldByCurrency) GetAmount

func (f *FieldByCurrency) GetAmount() string

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*FieldByCurrency) GetCurrency

func (f *FieldByCurrency) GetCurrency() string

GetCurrency returns the Currency field if it's non-nil, zero value otherwise.

type FinalizeTransferRequest

type FinalizeTransferRequest struct {
	TransferCode *string `json:"transfer_code, omitempty"`
	OTP          *string `json:"otp, omitempty"`
}

func (*FinalizeTransferRequest) GetOTP

func (f *FinalizeTransferRequest) GetOTP() string

GetOTP returns the OTP field if it's non-nil, zero value otherwise.

func (*FinalizeTransferRequest) GetTransferCode

func (f *FinalizeTransferRequest) GetTransferCode() string

GetTransferCode returns the TransferCode field if it's non-nil, zero value otherwise.

type History

type History struct {
	Type    *string `json:"type, omitempty"`
	Message *string `json:"message, omitempty"`
	Time    *int    `json:"time, omitempty"`
}

func (*History) GetMessage

func (h *History) GetMessage() string

GetMessage returns the Message field if it's non-nil, zero value otherwise.

func (*History) GetTime

func (i *History) GetTime() int

GetTime returns the Time field if it's non-nil, zero value otherwise.

func (*History) GetType

func (h *History) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

type IntegrationOptions

type IntegrationOptions struct {
	Timeout *int `json:"timeout, omitempty"`
}

func (*IntegrationOptions) GetTimeout

func (i *IntegrationOptions) GetTimeout() int

GetTimeout returns the Timeout field if it's non-nil, zero value otherwise.

type IntegrationService

type IntegrationService service

func (*IntegrationService) FetchPaymentSessionTimeout

func (s *IntegrationService) FetchPaymentSessionTimeout(ctx context.Context) (*PaymentSession, *Response, error)

FetchPaymentSessionTimeout

Paystack API reference: https://developers.paystack.co/reference#fetch-payment-session-timeout

func (*IntegrationService) UpdatePaymentSessionTimeout

func (s *IntegrationService) UpdatePaymentSessionTimeout(ctx context.Context, options IntegrationOptions) (*PaymentSession, *Response, error)

UpdatePaymentSessionTimeout

Paystack API reference: https://developers.paystack.co/reference#update-payment-session-timeout

type ListOptions

type ListOptions struct {
	// For paginated result sets, page of results to retrieve.
	Page int `url:"page,omitempty"`

	// For paginated result sets, the number of results to include per page.
	PerPage int `url:"perPage,omitempty"`
}

ListOptions specifies the optional parameters to various List methods

type Log

type Log struct {
	TimeSpent      *int          `json:"time_spent, omitempty"`
	Attempts       *int          `json:"attempts, omitempty"`
	Authentication interface{}   `json:"authentication, omitempty"`
	Errors         *int          `json:"errors, omitempty"`
	Success        *bool         `json:"success, omitempty"`
	Mobile         *bool         `json:"mobile, omitempty"`
	Input          []interface{} `json:"input, omitempty"`
	Channel        *string       `json:"channel, omitempty"`
	History        []History     `json:"history, omitempty"`
}

func (*Log) GetChannel

func (l *Log) GetChannel() string

GetChannel returns the Channel field if it's non-nil, zero value otherwise.

func (*Log) GetMobile

func (l *Log) GetMobile() bool

GetMobile returns the Mobile field if it's non-nil, zero value otherwise.

func (*Log) GetSuccess

func (l *Log) GetSuccess() bool

GetSuccess returns the Success field if it's non-nil, zero value otherwise.

type Message

type Message struct {
	Status  *bool   `json:"status, omitempty"`
	Message *string `json:"message, omitempty"`
}

func (*Message) GetMessage

func (m *Message) GetMessage() string

GetMessage returns the Message field if it's non-nil, zero value otherwise.

func (*Message) GetStatus

func (m *Message) GetStatus() bool

GetStatus returns the Status field if it's non-nil, zero value otherwise.

type Meta

type Meta struct {
	Total     int `json:"total"`
	Skipped   int `json:"skipped"`
	PerPage   int `json:"perPage"` //awkward
	Page      int `json:"page"`
	PageCount int `json:"pageCount"`
}

type MetaResponse

type MetaResponse struct {
	Meta Meta `json:"meta"`
}

Object to model the meta json object returned by the Paystack API

type Metadata

type Metadata struct {
	CustomFields []map[string]interface{} `json:"custom_fields, omitempty"`
	Photos       []Photo                  `json:"photos,omitempty"`
}

type MiscellaneousService

type MiscellaneousService service

MiscellaneousService handles the communication with the Miscellaneous related parts of the Paystack API

func (*MiscellaneousService) ListBanks

func (s *MiscellaneousService) ListBanks(ctx context.Context, opt *ListOptions) ([]Bank, *Response, error)

ListBanks lists all banks

Paystack API reference: https://developers.paystack.co/reference#list-banks

func (*MiscellaneousService) ResolveAccountNumber

func (s *MiscellaneousService) ResolveAccountNumber(ctx context.Context, opt *ListOptions) (*AccountData, *Response, error)

ResolveAccountNumber

Paystack API reference: https://developers.paystack.co/reference#resolve-account-number

func (*MiscellaneousService) ResolveBvn

func (s *MiscellaneousService) ResolveBvn(ctx context.Context, id string) (*BvnData, *Response, error)

ResolveBvn

Paystack API reference: https://developers.paystack.co/reference#resolve-bvn

func (*MiscellaneousService) ResolveCardBin

func (s *MiscellaneousService) ResolveCardBin(ctx context.Context, id string) (*Bin, *Response, error)

ResolveCardBin

Paystack API reference: https://developers.paystack.co/reference#resolve-card-bin

type NotFoundError

type NotFoundError ErrorResponse

NotFoundError occurs when the request could not be fulfilled as the request resource does not exist.

func (*NotFoundError) Error

func (r *NotFoundError) Error() string

type OTPRequest

type OTPRequest struct {
	OTP       *string `json:"otp, omitempty"`
	Reference *string `json:"reference, omitempty"`
}

func (*OTPRequest) GetOTP

func (o *OTPRequest) GetOTP() string

GetOTP returns the OTP field if it's non-nil, zero value otherwise.

func (*OTPRequest) GetReference

func (o *OTPRequest) GetReference() string

GetReference returns the Reference field if it's non-nil, zero value otherwise.

type Page

type Page struct {
	Integration  *int         `json:"integration, omitempty, omitempty"`
	Plan         *int         `json:"plan, omitempty"`
	Domain       *string      `json:"domain, omitempty"`
	Name         *string      `json:"name, omitempty"`
	Description  *string      `json:"description, omitempty"`
	Amount       *int         `json:"amount, omitempty"`
	Currency     *string      `json:"currency, omitempty"`
	Slug         *string      `json:"slug, omitempty"`
	CustomFields CustomFields `json:"custom_fields, omitempty"`
	RedirectUrl  *string      `json:"redirect_url, omitempty"`
	Active       *bool        `json:"active, omitempty"`
	Migrate      interface{}  `json:"migrate, omitempty"`
	Id           *int         `json:"id, omitempty"`
	CreatedAt    *time.Time   `json:"created_at, omitempty"`
	UpdatedAt    *time.Time   `json:"updated_at, omitempty"`
}

func (*Page) GetActive

func (p *Page) GetActive() bool

GetActive returns the Active field if it's non-nil, zero value otherwise.

func (*Page) GetAmount

func (p *Page) GetAmount() int

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*Page) GetCreatedAt

func (p *Page) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Page) GetCurrency

func (p *Page) GetCurrency() string

GetCurrency returns the Currency field if it's non-nil, zero value otherwise.

func (*Page) GetDescription

func (p *Page) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*Page) GetDomain

func (p *Page) GetDomain() string

GetDomain returns the Domain field if it's non-nil, zero value otherwise.

func (*Page) GetId

func (p *Page) GetId() int

GetId returns the Id field if it's non-nil, zero value otherwise.

func (*Page) GetIntegration

func (p *Page) GetIntegration() int

GetIntegration returns the Integration field if it's non-nil, zero value otherwise.

func (*Page) GetName

func (p *Page) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Page) GetPlan

func (p *Page) GetPlan() int

GetPlan returns the Plan field if it's non-nil, zero value otherwise.

func (*Page) GetRedirectUrl

func (p *Page) GetRedirectUrl() string

GetRedirectUrl returns the RedirectUrl field if it's non-nil, zero value otherwise.

func (*Page) GetSlug

func (p *Page) GetSlug() string

GetSlug returns the Slug field if it's non-nil, zero value otherwise.

func (*Page) GetUpdatedAt

func (p *Page) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type PageRequest

type PageRequest struct {
	Name         *string      `json:"name, omitempty"`
	Description  *string      `json:"description, omitempty"`
	Amount       *int         `json:"amount, omitempty"`
	Currency     *string      `json:"currency, omitempty"`
	Slug         *string      `json:"slug, omitempty"`
	CustomFields CustomFields `json:"custom_fields, omitempty"`
	RedirectUrl  *string      `json:"redirect_url, omitempty"`
	Active       *bool        `json:"active, omitempty"`
	Id           *int         `json:"id, omitempty"`
}

func (*PageRequest) GetActive

func (p *PageRequest) GetActive() bool

GetActive returns the Active field if it's non-nil, zero value otherwise.

func (*PageRequest) GetAmount

func (p *PageRequest) GetAmount() int

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*PageRequest) GetCurrency

func (p *PageRequest) GetCurrency() string

GetCurrency returns the Currency field if it's non-nil, zero value otherwise.

func (*PageRequest) GetDescription

func (p *PageRequest) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*PageRequest) GetId

func (p *PageRequest) GetId() int

GetId returns the Id field if it's non-nil, zero value otherwise.

func (*PageRequest) GetName

func (p *PageRequest) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*PageRequest) GetRedirectUrl

func (p *PageRequest) GetRedirectUrl() string

GetRedirectUrl returns the RedirectUrl field if it's non-nil, zero value otherwise.

func (*PageRequest) GetSlug

func (p *PageRequest) GetSlug() string

GetSlug returns the Slug field if it's non-nil, zero value otherwise.

type PageService

type PageService service

PageService handles the communication with the Pages related parts of the Paystack API

func (*PageService) CheckSlugAvailability

func (s *PageService) CheckSlugAvailability(ctx context.Context, id string) (*Message, *Response, error)

CheckSlugAvailability checks if a slug is available

Paystack API reference: https://developers.paystack.co/reference#check-slug-availability

func (*PageService) Create

func (s *PageService) Create(ctx context.Context, sa *PageRequest) (*Page, *Response, error)

Create returns a new page

Paystack API reference: https://developers.paystack.co/reference#create-page

func (*PageService) Fetch

func (s *PageService) Fetch(ctx context.Context, id string) (*Page, *Response, error)

Fetch fetches a page

Paystack API reference: https://developers.paystack.co/reference#fetch-page

func (*PageService) List

func (s *PageService) List(ctx context.Context, opt *ListOptions) ([]Page, *Response, error)

List returns all created pages

Paystack API reference: https://developers.paystack.co/reference#list-pages

func (*PageService) Update

func (s *PageService) Update(ctx context.Context, sa *PageRequest, id string) (*Page, *Response, error)

Update updates a page model with the page

Paystack API reference: https://developers.paystack.co/reference#update-page

type PaymentSession

type PaymentSession struct {
	PaymentSessionTimeout *int `json:"payment_session_timeout, omitempty"`
}

func (*PaymentSession) GetPaymentSessionTimeout

func (p *PaymentSession) GetPaymentSessionTimeout() int

GetPaymentSessionTimeout returns the PaymentSessionTimeout field if it's non-nil, zero value otherwise.

type PhoneRequest

type PhoneRequest struct {
	OTP       *string `json:"otp, omitempty"`
	Reference *string `json:"reference, omitempty"`
}

func (*PhoneRequest) GetOTP

func (p *PhoneRequest) GetOTP() string

GetOTP returns the OTP field if it's non-nil, zero value otherwise.

func (*PhoneRequest) GetReference

func (p *PhoneRequest) GetReference() string

GetReference returns the Reference field if it's non-nil, zero value otherwise.

type Photo

type Photo struct {
	Type      *string `json:"type, omitempty"`
	TypeId    *string `json:"typeId, omitempty"`
	TypeName  *string `json:"typeName, omitempty"`
	URL       *string `json:"url, omitempty"`
	IsPrimary *bool   `json:"isPrimary, omitempty"`
}

type PinRequest

type PinRequest struct {
	Pin       *string `json:"pin, omitempty"`
	Reference *string `json:"reference, omitempty"`
}

func (*PinRequest) GetPin

func (p *PinRequest) GetPin() string

GetPin returns the Pin field if it's non-nil, zero value otherwise.

func (*PinRequest) GetReference

func (p *PinRequest) GetReference() string

GetReference returns the Reference field if it's non-nil, zero value otherwise.

type Plan

type Plan struct {
	Name              *string            `json:"name, omitempty"`
	Description       *string            `json:"description, omitempty"`
	Amount            *int               `json:"amount, omitempty"`
	Interval          *string            `json:"interval, omitempty"`
	Domain            *string            `json:"domain, omitempty"`
	PlanCode          *string            `json:"plan_code, omitempty"`
	SendInvoices      *bool              `json:"send_invoices, omitempty"`
	SendSms           *bool              `json:"send_sms, omitempty"`
	HostedPage        *bool              `json:"hosted_page, omitempty"`
	Currency          *string            `json:"currency, omitempty"`
	InvoiceLimit      *string            `json:"invoice_limit, omitempty"`
	Id                *int               `json:"id, omitempty"`
	CreatedAt         *time.Time         `json:"created_at, omitempty"`
	UpdatedAt         *time.Time         `json:"updated_at, omitempty"`
	Subscriptions     []PlanSubscription `json:"subscriptions, omitempty"`
	Integration       *int               `json:"integration, omitempty, omitempty"`
	HostedPageURL     *string            `json:"hosted_page_url, omitempty"`
	HostedPageSummary *string            `json:"hosted_page_summary, omitempty"`
}

func (*Plan) GetAmount

func (p *Plan) GetAmount() int

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*Plan) GetCreatedAt

func (p *Plan) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Plan) GetCurrency

func (p *Plan) GetCurrency() string

GetCurrency returns the Currency field if it's non-nil, zero value otherwise.

func (*Plan) GetDescription

func (p *Plan) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*Plan) GetDomain

func (p *Plan) GetDomain() string

GetDomain returns the Domain field if it's non-nil, zero value otherwise.

func (*Plan) GetHostedPage

func (p *Plan) GetHostedPage() bool

GetHostedPage returns the HostedPage field if it's non-nil, zero value otherwise.

func (*Plan) GetHostedPageSummary

func (p *Plan) GetHostedPageSummary() string

GetHostedPageSummary returns the HostedPageSummary field if it's non-nil, zero value otherwise.

func (*Plan) GetHostedPageURL

func (p *Plan) GetHostedPageURL() string

GetHostedPageURL returns the HostedPageURL field if it's non-nil, zero value otherwise.

func (*Plan) GetId

func (p *Plan) GetId() int

GetId returns the Id field if it's non-nil, zero value otherwise.

func (*Plan) GetIntegration

func (p *Plan) GetIntegration() int

GetIntegration returns the Integration field if it's non-nil, zero value otherwise.

func (*Plan) GetInterval

func (p *Plan) GetInterval() string

GetInterval returns the Interval field if it's non-nil, zero value otherwise.

func (*Plan) GetInvoiceLimit

func (p *Plan) GetInvoiceLimit() string

GetInvoiceLimit returns the InvoiceLimit field if it's non-nil, zero value otherwise.

func (*Plan) GetName

func (p *Plan) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Plan) GetPlanCode

func (p *Plan) GetPlanCode() string

GetPlanCode returns the PlanCode field if it's non-nil, zero value otherwise.

func (*Plan) GetSendInvoices

func (p *Plan) GetSendInvoices() bool

GetSendInvoices returns the SendInvoices field if it's non-nil, zero value otherwise.

func (*Plan) GetSendSms

func (p *Plan) GetSendSms() bool

GetSendSms returns the SendSms field if it's non-nil, zero value otherwise.

func (*Plan) GetUpdatedAt

func (p *Plan) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type PlanOptions

type PlanOptions struct {
	ListOptions
	Interval *string `json:"interval, omitempty"`
	Amount   string  `json:"amount, omitempty"`
}

func (*PlanOptions) GetInterval

func (p *PlanOptions) GetInterval() string

GetInterval returns the Interval field if it's non-nil, zero value otherwise.

type PlanRequest

type PlanRequest struct {
	Name         *string `json:"name, omitempty"`
	Description  *string `json:"description, omitempty"`
	Amount       *int    `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 *string `json:"invoice_limit, omitempty"`
}

func (*PlanRequest) GetAmount

func (p *PlanRequest) GetAmount() int

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*PlanRequest) GetCurrency

func (p *PlanRequest) GetCurrency() string

GetCurrency returns the Currency field if it's non-nil, zero value otherwise.

func (*PlanRequest) GetDescription

func (p *PlanRequest) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*PlanRequest) GetInterval

func (p *PlanRequest) GetInterval() string

GetInterval returns the Interval field if it's non-nil, zero value otherwise.

func (*PlanRequest) GetInvoiceLimit

func (p *PlanRequest) GetInvoiceLimit() string

GetInvoiceLimit returns the InvoiceLimit field if it's non-nil, zero value otherwise.

func (*PlanRequest) GetName

func (p *PlanRequest) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*PlanRequest) GetSendInvoices

func (p *PlanRequest) GetSendInvoices() bool

GetSendInvoices returns the SendInvoices field if it's non-nil, zero value otherwise.

func (*PlanRequest) GetSendSms

func (p *PlanRequest) GetSendSms() bool

GetSendSms returns the SendSms field if it's non-nil, zero value otherwise.

type PlanService

type PlanService service

PlanService handles the communication with the Plans related parts of the Paystack API

func (*PlanService) Create

func (s *PlanService) Create(ctx context.Context, p *PlanRequest) (*Plan, *Response, error)

Create returns a new plan

Paystack API reference: https://developers.paystack.co/reference#create-plan

func (*PlanService) Fetch

func (s *PlanService) Fetch(ctx context.Context, id string) (*Plan, *Response, error)

Fetch returns a plan with the passed id parameter

Paystack API reference: https://developers.paystack.co/reference#fetch-plan

func (*PlanService) List

func (s *PlanService) List(ctx context.Context, opt *PlanOptions) ([]Plan, *Response, error)

List returns an array all created plans

Paystack API reference: https://developers.paystack.co/reference#list-plans

func (*PlanService) Update

func (s *PlanService) Update(ctx context.Context, sa *Plan, id string) (*PlanSubscription, *Response, error)

Update updates a plan model with the supplied id

Paystack API reference: https://developers.paystack.co/reference#update-plan

type PlanSubscription

type PlanSubscription struct {
	Customer         *int        `json:"customer"`
	Plan             *int        `json:"plan, omitempty"`
	Integration      *int        `json:"integration, omitempty"`
	Domain           *string     `json:"domain, omitempty"`
	Start            *int64      `json:"start, omitempty"`
	Status           *string     `json:"status, omitempty"`
	Quantity         *int        `json:"quantity, omitempty"`
	Amount           *int        `json:"amount, omitempty"`
	SubscriptionCode *string     `json:"subscription_code, omitempty"`
	EmailToken       *string     `json:"email_token, omitempty"`
	Authorization    *int        `json:"authorization, omitempty"`
	EasyCronId       *int        `json:"easy_cron_id, omitempty"`
	CronExpression   *string     `json:"cron_expression, omitempty"`
	NextPaymentDate  *time.Time  `json:"next_payment_date, omitempty"`
	OpenInvoice      interface{} `json:"open_invoice, omitempty"`
	Id               *int        `json:"id, omitempty"`
	CreatedAt        *time.Time  `json:"created_at, omitempty"`
	UpdatedAt        *time.Time  `json:"updated_at, omitempty"`
}

func (*PlanSubscription) GetAmount

func (p *PlanSubscription) GetAmount() int

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*PlanSubscription) GetAuthorization

func (p *PlanSubscription) GetAuthorization() int

GetAuthorization returns the Authorization field if it's non-nil, zero value otherwise.

func (*PlanSubscription) GetCreatedAt

func (p *PlanSubscription) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*PlanSubscription) GetCronExpression

func (p *PlanSubscription) GetCronExpression() string

GetCronExpression returns the CronExpression field if it's non-nil, zero value otherwise.

func (*PlanSubscription) GetCustomer

func (p *PlanSubscription) GetCustomer() int

GetCustomer returns the Customer field if it's non-nil, zero value otherwise.

func (*PlanSubscription) GetDomain

func (p *PlanSubscription) GetDomain() string

GetDomain returns the Domain field if it's non-nil, zero value otherwise.

func (*PlanSubscription) GetEasyCronId

func (p *PlanSubscription) GetEasyCronId() int

GetEasyCronId returns the EasyCronId field if it's non-nil, zero value otherwise.

func (*PlanSubscription) GetEmailToken

func (p *PlanSubscription) GetEmailToken() string

GetEmailToken returns the EmailToken field if it's non-nil, zero value otherwise.

func (*PlanSubscription) GetId

func (p *PlanSubscription) GetId() int

GetId returns the Id field if it's non-nil, zero value otherwise.

func (*PlanSubscription) GetIntegration

func (p *PlanSubscription) GetIntegration() int

GetIntegration returns the Integration field if it's non-nil, zero value otherwise.

func (*PlanSubscription) GetNextPaymentDate

func (p *PlanSubscription) GetNextPaymentDate() time.Time

GetNextPaymentDate returns the NextPaymentDate field if it's non-nil, zero value otherwise.

func (*PlanSubscription) GetPlan

func (p *PlanSubscription) GetPlan() int

GetPlan returns the Plan field if it's non-nil, zero value otherwise.

func (*PlanSubscription) GetQuantity

func (p *PlanSubscription) GetQuantity() int

GetQuantity returns the Quantity field if it's non-nil, zero value otherwise.

func (*PlanSubscription) GetStatus

func (p *PlanSubscription) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*PlanSubscription) GetSubscriptionCode

func (p *PlanSubscription) GetSubscriptionCode() string

GetSubscriptionCode returns the SubscriptionCode field if it's non-nil, zero value otherwise.

func (*PlanSubscription) GetUpdatedAt

func (p *PlanSubscription) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type Reauthorization

type Reauthorization struct {
	ReauthorizationUrl *string `json:"reauthorization_url, omitempty"`
	Reference          *string `json:"reference, omitempty"`
}

func (*Reauthorization) GetReauthorizationUrl

func (r *Reauthorization) GetReauthorizationUrl() string

GetReauthorizationUrl returns the ReauthorizationUrl field if it's non-nil, zero value otherwise.

func (*Reauthorization) GetReference

func (r *Reauthorization) GetReference() string

GetReference returns the Reference field if it's non-nil, zero value otherwise.

type Response

type Response struct {
	*http.Response

	NextPage  int
	PrevPage  int
	FirstPage int
	LastPage  int
}

Response is a Paystack API response. This wraps the standard http.Response returned from Paystack and provides convenient access to things like pagination .

type RiskAction

type RiskAction int

enum that allows selection of the risk action type for customers

const (
	Allow RiskAction = 1 + iota
	Deny
)

func (RiskAction) String

func (r RiskAction) String() string

returns string equivalent of a RiskAction

type RiskActionPayload

type RiskActionPayload struct {
	CustomerCode *string    `json:"customer"`
	RiskAction   RiskAction `json:"risk_action"`
}

RiskActionPayload is sent when setting the risk action for a seller

func (*RiskActionPayload) GetCustomerCode

func (r *RiskActionPayload) GetCustomerCode() string

GetCustomerCode returns the CustomerCode field if it's non-nil, zero value otherwise.

type ServerError

type ServerError ErrorResponse

ServerError Occurs when the request could not be fulfilled due to an error on Paystack's end. This shouldn't happen so please report to paystack as soon as you encounter any instance of this.

func (*ServerError) Error

func (r *ServerError) Error() string

type Settlement

type Settlement struct {
	Integration *int        `json:"integration, omitempty"`
	Subaccount  Subaccount  `json:"subaccount, omitempty"`
	SettledBy   interface{} `json:"settled_by, omitempty"`
	SettledDate *time.Time  `json:"settled_date, omitempty"`
	Domain      *string     `json:"domain, omitempty"`
	TotalAmount *int        `json:"total_amount, omitempty"`
	Status      *string     `json:"status, omitempty"`
	Id          *int        `json:"id, omitempty"`
	CreatedAt   *time.Time  `json:"created_at, omitempty"`
	UpdatedAt   *time.Time  `json:"updated_at, omitempty"`
}

func (*Settlement) GetCreatedAt

func (s *Settlement) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Settlement) GetDomain

func (s *Settlement) GetDomain() string

GetDomain returns the Domain field if it's non-nil, zero value otherwise.

func (*Settlement) GetId

func (s *Settlement) GetId() int

GetId returns the Id field if it's non-nil, zero value otherwise.

func (*Settlement) GetIntegration

func (s *Settlement) GetIntegration() int

GetIntegration returns the Integration field if it's non-nil, zero value otherwise.

func (*Settlement) GetSettledDate

func (s *Settlement) GetSettledDate() time.Time

GetSettledDate returns the SettledDate field if it's non-nil, zero value otherwise.

func (*Settlement) GetStatus

func (s *Settlement) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*Settlement) GetTotalAmount

func (s *Settlement) GetTotalAmount() int

GetTotalAmount returns the TotalAmount field if it's non-nil, zero value otherwise.

func (*Settlement) GetUpdatedAt

func (s *Settlement) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type SettlementOptions

type SettlementOptions struct {
	From       time.Time `json:"from, omitempty"`
	To         time.Time `json:"to, omitempty"`
	Subaccount *string   `json:"subaccount, omitempty"`
}

func (*SettlementOptions) GetSubaccount

func (s *SettlementOptions) GetSubaccount() string

GetSubaccount returns the Subaccount field if it's non-nil, zero value otherwise.

type SettlementService

type SettlementService service

SettlementService handles the communication with the Settlements related parts of the Paystack API

func (*SettlementService) Fetch

Fetch gets all settlements made to your bank accounts

Paystack API reference: https://developers.paystack.co/reference#fetch-settlements

type StandardListResponse

type StandardListResponse struct {
	Status  bool                     `json:"status"`
	Message string                   `json:"message"`
	Data    []map[string]interface{} `json:"data"`
	Meta    Meta                     `json:"meta"`
}

The standard response type when the Paystack API returns a list of data object

type StandardResponse

type StandardResponse struct {
	Status  bool                   `json:"status"`
	Message string                 `json:"message"`
	Data    map[string]interface{} `json:"data"`
	Meta    Meta                   `json:"meta"`
}

The standard response type when the Paystack API returns a single data object

type Subaccount

type Subaccount struct {
	Integration         *int       `json:"integration, omitempty"`
	Domain              *string    `json:"domain, omitempty"`
	SubaccountCode      *string    `json:"subaccount_code, omitempty"`
	BusinessName        *string    `json:"business_name, 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            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"`
	Id                  *int       `json:"id, omitempty"`
	CreatedAt           *time.Time `json:"created_at, omitempty"`
	UpdatedAt           *time.Time `json:"updated_at, omitempty"`
}

func (*Subaccount) GetAccountNumber

func (s *Subaccount) GetAccountNumber() string

GetAccountNumber returns the AccountNumber field if it's non-nil, zero value otherwise.

func (*Subaccount) GetActive

func (s *Subaccount) GetActive() bool

GetActive returns the Active field if it's non-nil, zero value otherwise.

func (*Subaccount) GetBusinessName

func (s *Subaccount) GetBusinessName() string

GetBusinessName returns the BusinessName field if it's non-nil, zero value otherwise.

func (*Subaccount) GetCreatedAt

func (s *Subaccount) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Subaccount) GetDescription

func (s *Subaccount) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*Subaccount) GetDomain

func (s *Subaccount) GetDomain() string

GetDomain returns the Domain field if it's non-nil, zero value otherwise.

func (*Subaccount) GetId

func (s *Subaccount) GetId() int

GetId returns the Id field if it's non-nil, zero value otherwise.

func (*Subaccount) GetIntegration

func (s *Subaccount) GetIntegration() int

GetIntegration returns the Integration field if it's non-nil, zero value otherwise.

func (*Subaccount) GetIsVerified

func (s *Subaccount) GetIsVerified() bool

GetIsVerified returns the IsVerified field if it's non-nil, zero value otherwise.

func (*Subaccount) GetMigrate

func (s *Subaccount) GetMigrate() bool

GetMigrate returns the Migrate field if it's non-nil, zero value otherwise.

func (*Subaccount) GetPrimaryContactEmail

func (s *Subaccount) GetPrimaryContactEmail() string

GetPrimaryContactEmail returns the PrimaryContactEmail field if it's non-nil, zero value otherwise.

func (*Subaccount) GetPrimaryContactName

func (s *Subaccount) GetPrimaryContactName() string

GetPrimaryContactName returns the PrimaryContactName field if it's non-nil, zero value otherwise.

func (*Subaccount) GetPrimaryContactPhone

func (s *Subaccount) GetPrimaryContactPhone() string

GetPrimaryContactPhone returns the PrimaryContactPhone field if it's non-nil, zero value otherwise.

func (*Subaccount) GetSettlementBank

func (s *Subaccount) GetSettlementBank() string

GetSettlementBank returns the SettlementBank field if it's non-nil, zero value otherwise.

func (*Subaccount) GetSettlementSchedule

func (s *Subaccount) GetSettlementSchedule() string

GetSettlementSchedule returns the SettlementSchedule field if it's non-nil, zero value otherwise.

func (*Subaccount) GetSubaccountCode

func (s *Subaccount) GetSubaccountCode() string

GetSubaccountCode returns the SubaccountCode field if it's non-nil, zero value otherwise.

func (*Subaccount) GetUpdatedAt

func (s *Subaccount) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type SubaccountRequest

type SubaccountRequest struct {
	BusinessName        *string  `json:"business_name, omitempty"`
	PrimaryContactName  *string  `json:"primary_contact_name, omitempty"`
	PrimaryContactEmail *string  `json:"primary_contact_email, omitempty"`
	PrimaryContactPhone *string  `json:"primary_contact_phone, omitempty"`
	Metadata            Metadata `json:"metadata, omitempty"`
	PercentageCharge    *float32 `json:"percentage_charge, omitempty"`
	SettlementBank      *string  `json:"settlement_bank, omitempty"`
	AccountNumber       *string  `json:"account_number, omitempty"`
	SettlementSchedule  *string  `json:"settlement_schedule, omitempty"`
}

func (*SubaccountRequest) GetAccountNumber

func (s *SubaccountRequest) GetAccountNumber() string

GetAccountNumber returns the AccountNumber field if it's non-nil, zero value otherwise.

func (*SubaccountRequest) GetBusinessName

func (s *SubaccountRequest) GetBusinessName() string

GetBusinessName returns the BusinessName field if it's non-nil, zero value otherwise.

func (*SubaccountRequest) GetPrimaryContactEmail

func (s *SubaccountRequest) GetPrimaryContactEmail() string

GetPrimaryContactEmail returns the PrimaryContactEmail field if it's non-nil, zero value otherwise.

func (*SubaccountRequest) GetPrimaryContactName

func (s *SubaccountRequest) GetPrimaryContactName() string

GetPrimaryContactName returns the PrimaryContactName field if it's non-nil, zero value otherwise.

func (*SubaccountRequest) GetPrimaryContactPhone

func (s *SubaccountRequest) GetPrimaryContactPhone() string

GetPrimaryContactPhone returns the PrimaryContactPhone field if it's non-nil, zero value otherwise.

func (*SubaccountRequest) GetSettlementBank

func (s *SubaccountRequest) GetSettlementBank() string

GetSettlementBank returns the SettlementBank field if it's non-nil, zero value otherwise.

func (*SubaccountRequest) GetSettlementSchedule

func (s *SubaccountRequest) GetSettlementSchedule() string

GetSettlementSchedule returns the SettlementSchedule field if it's non-nil, zero value otherwise.

type SubaccountService

type SubaccountService service

SubaccountService handles the communication with the Subaccounts related parts of the Paystack API

func (*SubaccountService) Create

Create returns a new subaccount

Paystack API reference: https://developers.paystack.co/reference#create-subaccount

func (*SubaccountService) Fetch

Fetch returns a subaccount with the passed id

Paystack API reference: https://developers.paystack.co/reference#fetch-subaccount

func (*SubaccountService) List

List returns an array of all created subaccounts

Paystack API reference: https://developers.paystack.co/reference#list-subaccounts

func (*SubaccountService) Update

Update updates a subaccount model with the subaccount

Paystack API reference: https://developers.paystack.co/reference#update-subaccount

type Subscription

type Subscription struct {
	Customer         Customer      `json:"customer"`
	Plan             Plan          `json:"plan"`
	Integration      *int          `json:"integration, omitempty"`
	Authorization    Authorization `json:"authorization"`
	Domain           *string       `json:"domain, omitempty"`
	Start            *int64        `json:"start, omitempty"`
	Status           *string       `json:"status, omitempty"`
	Quantity         *int          `json:"quantity, omitempty"`
	Amount           *int          `json:"amount, omitempty"`
	SubscriptionCode *string       `json:"subscription_code, omitempty"`
	EmailToken       *string       `json:"email_token, omitempty"`
	EasyCronId       *int          `json:"easy_cron_id, omitempty"`
	CronExpression   *string       `json:"cron_expression, omitempty"`
	NextPaymentDate  *time.Time    `json:"next_payment_date, omitempty"`
	OpenInvoice      *string       `json:"open_invoice, omitempty"`
	Id               *int          `json:"id, omitempty"`
	CreatedAt        *time.Time    `json:"created_at, omitempty"`
	UpdatedAt        *time.Time    `json:"updated_at, omitempty"`
}

func (*Subscription) GetAmount

func (s *Subscription) GetAmount() int

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*Subscription) GetCreatedAt

func (s *Subscription) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Subscription) GetCronExpression

func (s *Subscription) GetCronExpression() string

GetCronExpression returns the CronExpression field if it's non-nil, zero value otherwise.

func (*Subscription) GetDomain

func (s *Subscription) GetDomain() string

GetDomain returns the Domain field if it's non-nil, zero value otherwise.

func (*Subscription) GetEasyCronId

func (s *Subscription) GetEasyCronId() int

GetEasyCronId returns the EasyCronId field if it's non-nil, zero value otherwise.

func (*Subscription) GetEmailToken

func (s *Subscription) GetEmailToken() string

GetEmailToken returns the EmailToken field if it's non-nil, zero value otherwise.

func (*Subscription) GetId

func (s *Subscription) GetId() int

GetId returns the Id field if it's non-nil, zero value otherwise.

func (*Subscription) GetIntegration

func (s *Subscription) GetIntegration() int

GetIntegration returns the Integration field if it's non-nil, zero value otherwise.

func (*Subscription) GetNextPaymentDate

func (s *Subscription) GetNextPaymentDate() time.Time

GetNextPaymentDate returns the NextPaymentDate field if it's non-nil, zero value otherwise.

func (*Subscription) GetOpenInvoice

func (s *Subscription) GetOpenInvoice() string

GetOpenInvoice returns the OpenInvoice field if it's non-nil, zero value otherwise.

func (*Subscription) GetQuantity

func (s *Subscription) GetQuantity() int

GetQuantity returns the Quantity field if it's non-nil, zero value otherwise.

func (*Subscription) GetStatus

func (s *Subscription) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*Subscription) GetSubscriptionCode

func (s *Subscription) GetSubscriptionCode() string

GetSubscriptionCode returns the SubscriptionCode field if it's non-nil, zero value otherwise.

func (*Subscription) GetUpdatedAt

func (s *Subscription) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type SubscriptionOptions

type SubscriptionOptions struct {
	ListOptions
	Customer int  `json:"customer, omitempty"`
	Plan     *int `json:"plan, omitempty"`
}

type SubscriptionRequest

type SubscriptionRequest struct {
	Customer      *string    `json:"customer, omitempty"`
	Plan          *string    `json:"plan, omitempty"`
	Authorization *string    `json:"authorization, omitempty"`
	StartDate     *time.Time `json:"start_date, omitempty"`
	Code          *string    `json:"code, omitempty"`
	Token         *string    `json:"token, omitempty"`
}

func (*SubscriptionRequest) GetAuthorization

func (s *SubscriptionRequest) GetAuthorization() string

GetAuthorization returns the Authorization field if it's non-nil, zero value otherwise.

func (*SubscriptionRequest) GetCode

func (s *SubscriptionRequest) GetCode() string

GetCode returns the Code field if it's non-nil, zero value otherwise.

func (*SubscriptionRequest) GetCustomer

func (s *SubscriptionRequest) GetCustomer() string

GetCustomer returns the Customer field if it's non-nil, zero value otherwise.

func (*SubscriptionRequest) GetPlan

func (s *SubscriptionRequest) GetPlan() string

GetPlan returns the Plan field if it's non-nil, zero value otherwise.

func (*SubscriptionRequest) GetStartDate

func (s *SubscriptionRequest) GetStartDate() time.Time

GetStartDate returns the StartDate field if it's non-nil, zero value otherwise.

func (*SubscriptionRequest) GetToken

func (s *SubscriptionRequest) GetToken() string

GetToken returns the Token field if it's non-nil, zero value otherwise.

type SubscriptionResponse

type SubscriptionResponse struct {
	Customer         *int       `json:"customer, omitempty"`
	Plan             *int       `json:"plan, omitempty"`
	Integration      *int       `json:"integration, omitempty"`
	Domain           *string    `json:"domain, omitempty"`
	Start            *int64     `json:"start, omitempty"`
	Status           *string    `json:"status, omitempty"`
	Quantity         *int       `json:"quantity, omitempty"`
	Amount           *int       `json:"amount, omitempty"`
	Authorization    *int       `json:"authorization, omitempty"`
	SubscriptionCode *string    `json:"subscription_code, omitempty"`
	EmailToken       *string    `json:"email_token, omitempty"`
	Id               *int       `json:"id, omitempty"`
	CreatedAt        *time.Time `json:"created_at, omitempty"`
	UpdatedAt        *time.Time `json:"updated_at, omitempty"`
}

func (*SubscriptionResponse) GetAmount

func (s *SubscriptionResponse) GetAmount() int

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*SubscriptionResponse) GetAuthorization

func (s *SubscriptionResponse) GetAuthorization() int

GetAuthorization returns the Authorization field if it's non-nil, zero value otherwise.

func (*SubscriptionResponse) GetCreatedAt

func (s *SubscriptionResponse) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*SubscriptionResponse) GetCustomer

func (s *SubscriptionResponse) GetCustomer() int

GetCustomer returns the Customer field if it's non-nil, zero value otherwise.

func (*SubscriptionResponse) GetDomain

func (s *SubscriptionResponse) GetDomain() string

GetDomain returns the Domain field if it's non-nil, zero value otherwise.

func (*SubscriptionResponse) GetEmailToken

func (s *SubscriptionResponse) GetEmailToken() string

GetEmailToken returns the EmailToken field if it's non-nil, zero value otherwise.

func (*SubscriptionResponse) GetId

func (s *SubscriptionResponse) GetId() int

GetId returns the Id field if it's non-nil, zero value otherwise.

func (*SubscriptionResponse) GetIntegration

func (s *SubscriptionResponse) GetIntegration() int

GetIntegration returns the Integration field if it's non-nil, zero value otherwise.

func (*SubscriptionResponse) GetPlan

func (s *SubscriptionResponse) GetPlan() int

GetPlan returns the Plan field if it's non-nil, zero value otherwise.

func (*SubscriptionResponse) GetQuantity

func (s *SubscriptionResponse) GetQuantity() int

GetQuantity returns the Quantity field if it's non-nil, zero value otherwise.

func (*SubscriptionResponse) GetStatus

func (s *SubscriptionResponse) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*SubscriptionResponse) GetSubscriptionCode

func (s *SubscriptionResponse) GetSubscriptionCode() string

GetSubscriptionCode returns the SubscriptionCode field if it's non-nil, zero value otherwise.

func (*SubscriptionResponse) GetUpdatedAt

func (s *SubscriptionResponse) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type SubscriptionService

type SubscriptionService service

SubscriptionService handles the communication with the Subscriptions related parts of the Paystack API

func (*SubscriptionService) Create

Create creates a new subscription

Paystack API reference: https://developers.paystack.co/reference#create-subscription

func (*SubscriptionService) Disable

Disable disables a subscription model with the supplied parameters

Paystack API reference: https://developers.paystack.co/reference#disable-subscription

func (*SubscriptionService) Enable

Enable enables a subscription model with the supplied parameters

Paystack API reference: https://developers.paystack.co/reference#enable-subscription

func (*SubscriptionService) Fetch

Fetch fetches a subscription

Paystack API reference: https://developers.paystack.co/reference#fetch-subscription

func (*SubscriptionService) List

List lists all created subscriptions

Paystack API reference: https://developers.paystack.co/reference#list-subscriptions

type Transaction

type Transaction struct {
	Amount          *int                   `json:"amount, omitempty"`
	Currency        *string                `json:"currency, omitempty"`
	TransactionDate *time.Time             `json:"transaction_date, omitempty"`
	Status          *string                `json:"status, omitempty"`
	Reference       *string                `json:"reference, omitempty"`
	Domain          *string                `json:"domain, omitempty"`
	Metadata        map[string]interface{} `json:"metadata, omitempty"` //Paystack API is not consistent with return type
	GatewayResponse *string                `json:"gateway_response, omitempty"`
	Message         *string                `json:"message, omitempty"`
	Channel         *string                `json:"channel, omitempty"`
	IpAddress       *string                `json:"ip_address, omitempty"`
	Log             Log                    `json:"log, omitempty"`
	Fees            *int                   `json:"fees, omitempty"`
	Authorization   Authorization          `json:"authorization, omitempty"`
	Customer        Customer               `json:"customer, omitempty"`
	Plan            Plan                   `json:"plan, omitempty"`
	Id              *int                   `json:"id, omitempty"`
	PaidAt          *time.Time             `json:"paid_at, omitempty"`
	CreatedAt       *time.Time             `json:"created_at, omitempty"`
	FeesSplit       *int                   `json:"fees_split, omitempty"`
	Subaccount      Subaccount             `json:"subaccount, omitempty"`
}

func (*Transaction) GetAmount

func (t *Transaction) GetAmount() int

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*Transaction) GetChannel

func (t *Transaction) GetChannel() string

GetChannel returns the Channel field if it's non-nil, zero value otherwise.

func (*Transaction) GetCreatedAt

func (t *Transaction) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Transaction) GetCurrency

func (t *Transaction) GetCurrency() string

GetCurrency returns the Currency field if it's non-nil, zero value otherwise.

func (*Transaction) GetDomain

func (t *Transaction) GetDomain() string

GetDomain returns the Domain field if it's non-nil, zero value otherwise.

func (*Transaction) GetFees

func (t *Transaction) GetFees() int

GetFees returns the Fees field if it's non-nil, zero value otherwise.

func (*Transaction) GetFeesSplit

func (t *Transaction) GetFeesSplit() int

GetFeesSplit returns the FeesSplit field if it's non-nil, zero value otherwise.

func (*Transaction) GetGatewayResponse

func (t *Transaction) GetGatewayResponse() string

GetGatewayResponse returns the GatewayResponse field if it's non-nil, zero value otherwise.

func (*Transaction) GetId

func (t *Transaction) GetId() int

GetId returns the Id field if it's non-nil, zero value otherwise.

func (*Transaction) GetIpAddress

func (t *Transaction) GetIpAddress() string

GetIpAddress returns the IpAddress field if it's non-nil, zero value otherwise.

func (*Transaction) GetMessage

func (t *Transaction) GetMessage() string

GetMessage returns the Message field if it's non-nil, zero value otherwise.

func (*Transaction) GetPaidAt

func (t *Transaction) GetPaidAt() time.Time

GetPaidAt returns the PaidAt field if it's non-nil, zero value otherwise.

func (*Transaction) GetReference

func (t *Transaction) GetReference() string

GetReference returns the Reference field if it's non-nil, zero value otherwise.

func (*Transaction) GetStatus

func (t *Transaction) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*Transaction) GetTransactionDate

func (t *Transaction) GetTransactionDate() time.Time

GetTransactionDate returns the TransactionDate field if it's non-nil, zero value otherwise.

type TransactionAuthorization

type TransactionAuthorization struct {
	AuthorizationUrl *string `json:"authorization_url, omitempty"`
	AccessCode       *string `json:"access_code, omitempty"`
	Reference        *string `json:"reference, omitempty"`
}

type TransactionOptions

type TransactionOptions struct {
	ListOptions
	Customer    int32     `json:"customer, omitempty"`
	Status      string    `json:"status, omitempty"`
	From        time.Time `json:"from, omitempty"`
	To          time.Time `json:"to, omitempty"`
	Amount      string    `json:"amount, omitempty"`
	Settled     *bool     `json:"settled, omitempty"`
	PaymentPage *int      `json:"payment_page, omitempty"`
	Currency    *string   `json:"currency, omitempty"`
	Settlement  *int      `json:"settlement, omitempty"`
}

func (*TransactionOptions) GetCurrency

func (t *TransactionOptions) GetCurrency() string

GetCurrency returns the Currency field if it's non-nil, zero value otherwise.

func (*TransactionOptions) GetPaymentPage

func (t *TransactionOptions) GetPaymentPage() int

GetPaymentPage returns the PaymentPage field if it's non-nil, zero value otherwise.

func (*TransactionOptions) GetSettled

func (t *TransactionOptions) GetSettled() bool

GetSettled returns the Settled field if it's non-nil, zero value otherwise.

func (*TransactionOptions) GetSettlement

func (t *TransactionOptions) GetSettlement() int

GetSettlement returns the Settlement field if it's non-nil, zero value otherwise.

type TransactionRequest

type TransactionRequest struct {
	CallbackUrl       *string  `json:"callback_url, omitempty"`
	Reference         *string  `json:"reference, omitempty"`
	AuthorizationCode *string  `json:"authorization_code, omitempty"`
	Amount            *string  `json:"amount, omitempty"`
	Currency          *string  `json:"currency"`
	Email             *string  `json:"email, omitempty"`
	Plan              *string  `json:"plan, omitempty"`
	InvoiceLimit      *int32   `json:"invoice_limit, omitempty"`
	Metadata          Metadata `json:"metadata, omitempty"`
	Subaccount        *string  `json:"subaccount, omitempty"`
	TransactionCharge *int32   `json:"transaction_charge, omitempty"`
	Bearer            *string  `json:"bearer, omitempty"`
	Channels          []string `json:"channels, omitempty"`
}

func (*TransactionRequest) GetAmount

func (t *TransactionRequest) GetAmount() string

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*TransactionRequest) GetAuthorizationCode

func (t *TransactionRequest) GetAuthorizationCode() string

GetAuthorizationCode returns the AuthorizationCode field if it's non-nil, zero value otherwise.

func (*TransactionRequest) GetBearer

func (t *TransactionRequest) GetBearer() string

GetBearer returns the Bearer field if it's non-nil, zero value otherwise.

func (*TransactionRequest) GetCallbackUrl

func (t *TransactionRequest) GetCallbackUrl() string

GetCallbackUrl returns the CallbackUrl field if it's non-nil, zero value otherwise.

func (*TransactionRequest) GetCurrency

func (t *TransactionRequest) GetCurrency() string

GetCurrency returns the Currency field if it's non-nil, zero value otherwise.

func (*TransactionRequest) GetEmail

func (t *TransactionRequest) GetEmail() string

GetEmail returns the Email field if it's non-nil, zero value otherwise.

func (*TransactionRequest) GetPlan

func (t *TransactionRequest) GetPlan() string

GetPlan returns the Plan field if it's non-nil, zero value otherwise.

func (*TransactionRequest) GetReference

func (t *TransactionRequest) GetReference() string

GetReference returns the Reference field if it's non-nil, zero value otherwise.

func (*TransactionRequest) GetSubaccount

func (t *TransactionRequest) GetSubaccount() string

GetSubaccount returns the Subaccount field if it's non-nil, zero value otherwise.

type TransactionService

type TransactionService service

TransactionService handles the communication with the Transactions related parts of the Paystack API

func (*TransactionService) ChargeAuthorization

func (s *TransactionService) ChargeAuthorization(ctx context.Context, tr *TransactionRequest) (*Transaction, *Response, error)

ChargeAuthorization

Paystack API reference: https://developers.paystack.co/reference#charge-authorization

func (*TransactionService) CheckAuthorization

func (s *TransactionService) CheckAuthorization(ctx context.Context, opt *TransactionRequest) (*FieldByCurrency, *Response, error)

CheckAuthorization

Paystack API reference: https://developers.paystack.co/reference#check-authorization

func (*TransactionService) Export

Export a transaction

Paystack API reference: https://developers.paystack.co/reference#export-transactions

func (*TransactionService) Fetch

Fetch fetches a transaction

Paystack API reference: https://developers.paystack.co/reference#fetch-transaction

func (*TransactionService) Initialize

Initialize

Paystack API reference: https://developers.paystack.co/reference#initialize-a-transaction

func (*TransactionService) List

List lists all transactions

Paystack API reference: https://developers.paystack.co/reference#list-transactions

func (*TransactionService) RequestReauthorization

func (s *TransactionService) RequestReauthorization(ctx context.Context, opt *TransactionRequest) (*Reauthorization, *Response, error)

RequestReauthorization

Paystack API reference: https://developers.paystack.co/reference#request-reauthorization

func (*TransactionService) Timeline

Timeline fetches a transaction timeline

Paystack API reference: https://developers.paystack.co/reference#view-transaction-timeline

func (*TransactionService) Totals

Totals fetches a transaction timeline

Paystack API reference: https://developers.paystack.co/reference#transaction-totals

func (*TransactionService) Verify

func (s *TransactionService) Verify(ctx context.Context, reference string) (*TransactionVerify, *Response, error)

Verify creates a new customer

Paystack API reference: https://developers.paystack.co/reference#initialize-a-transaction

type TransactionTimeline

type TransactionTimeline struct {
	TimeSpent      *int          `json:"time_spent, omitempty"`
	Attempts       *int          `json:"attempts, omitempty"`
	Authentication *string       `json:"authentication, omitempty"`
	Errors         *int          `json:"errors, omitempty"`
	Success        *bool         `json:"success, omitempty"`
	Mobile         *bool         `json:"mobile, omitempty"`
	Input          []interface{} `json:"input, omitempty"`
	Channel        *string       `json:"channel, omitempty"`
	History        History       `json:"history, omitempty"`
}

func (*TransactionTimeline) GetAttempts

func (t *TransactionTimeline) GetAttempts() int

GetAttempts returns the Attempts field if it's non-nil, zero value otherwise.

func (*TransactionTimeline) GetAuthentication

func (t *TransactionTimeline) GetAuthentication() string

GetAuthentication returns the Authentication field if it's non-nil, zero value otherwise.

func (*TransactionTimeline) GetChannel

func (t *TransactionTimeline) GetChannel() string

GetChannel returns the Channel field if it's non-nil, zero value otherwise.

func (*TransactionTimeline) GetErrors

func (t *TransactionTimeline) GetErrors() int

GetErrors returns the Errors field if it's non-nil, zero value otherwise.

func (*TransactionTimeline) GetMobile

func (t *TransactionTimeline) GetMobile() bool

GetMobile returns the Mobile field if it's non-nil, zero value otherwise.

func (*TransactionTimeline) GetSuccess

func (t *TransactionTimeline) GetSuccess() bool

GetSuccess returns the Success field if it's non-nil, zero value otherwise.

func (*TransactionTimeline) GetTimeSpent

func (t *TransactionTimeline) GetTimeSpent() int

GetTimeSpent returns the TimeSpent field if it's non-nil, zero value otherwise.

type TransactionTotal

type TransactionTotal struct {
	TotalTransactions     int               `json:"total_transactions, omitempty"`
	UniqueCustomers       int               `json:"unique_customers, omitempty"`
	TotalVolume           int64             `json:"total_volume, omitempty"`
	TotalVolumeByCurrency []FieldByCurrency `json:"total_volume_by_currency, omitempty"`
}

type TransactionVerify

type TransactionVerify struct {
	Amount          *int                   `json:"amount, omitempty"`
	Currency        *string                `json:"currency, omitempty"`
	TransactionDate *time.Time             `json:"transaction_date, omitempty"`
	Status          *string                `json:"status, omitempty"`
	Reference       *string                `json:"reference, omitempty"`
	Domain          *string                `json:"domain, omitempty"`
	Metadata        map[string]interface{} `json:"metadata, omitempty"` //Paystack API is not consistent with return type
	GatewayResponse *string                `json:"gateway_response, omitempty"`
	Message         *string                `json:"message, omitempty"`
	Channel         *string                `json:"channel, omitempty"`
	IpAddress       *string                `json:"ip_address, omitempty"`
	Log             Log                    `json:"log, omitempty"`
	Fees            *int                   `json:"fees, omitempty"`
	Authorization   Authorization          `json:"authorization, omitempty"`
	Customer        Customer               `json:"customer, omitempty"`
	Plan            *string                `json:"plan, omitempty"`
	Id              *int                   `json:"id, omitempty"`
	PaidAt          *time.Time             `json:"paid_at, omitempty"`
	CreatedAt       *time.Time             `json:"created_at, omitempty"`
	FeesSplit       *int                   `json:"fees_split, omitempty"`
	Subaccount      Subaccount             `json:"subaccount, omitempty"`
}

type Transfer

type Transfer struct {
	Integration   *int              `json:"integration, omitempty"`
	Recipient     TransferRecipient `json:"recipient, omitempty"`
	Domain        *string           `json:"domain, omitempty"`
	Amount        *int              `json:"amount, omitempty"`
	Currency      *string           `json:"currency, omitempty"`
	Source        *string           `json:"source, omitempty"`
	SourceDetails *string           `json:"source_details, omitempty"`
	Reason        *string           `json:"reason, omitempty"`
	Status        *string           `json:"status, omitempty"`
	Failures      interface{}       `json:"failures, omitempty"`
	TransferCode  *string           `json:"transfer_code, omitempty"`
	Id            *int              `json:"id, omitempty"`
	CreatedAt     *time.Time        `json:"created_at, omitempty"`
	UpdatedAt     *time.Time        `json:"updated_at, omitempty"`
}

func (*Transfer) GetAmount

func (t *Transfer) GetAmount() int

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*Transfer) GetCreatedAt

func (t *Transfer) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*Transfer) GetCurrency

func (t *Transfer) GetCurrency() string

GetCurrency returns the Currency field if it's non-nil, zero value otherwise.

func (*Transfer) GetDomain

func (t *Transfer) GetDomain() string

GetDomain returns the Domain field if it's non-nil, zero value otherwise.

func (*Transfer) GetId

func (t *Transfer) GetId() int

GetId returns the Id field if it's non-nil, zero value otherwise.

func (*Transfer) GetIntegration

func (t *Transfer) GetIntegration() int

GetIntegration returns the Integration field if it's non-nil, zero value otherwise.

func (*Transfer) GetReason

func (t *Transfer) GetReason() string

GetReason returns the Reason field if it's non-nil, zero value otherwise.

func (*Transfer) GetSource

func (t *Transfer) GetSource() string

GetSource returns the Source field if it's non-nil, zero value otherwise.

func (*Transfer) GetSourceDetails

func (t *Transfer) GetSourceDetails() string

GetSourceDetails returns the SourceDetails field if it's non-nil, zero value otherwise.

func (*Transfer) GetStatus

func (t *Transfer) GetStatus() string

GetStatus returns the Status field if it's non-nil, zero value otherwise.

func (*Transfer) GetTransferCode

func (t *Transfer) GetTransferCode() string

GetTransferCode returns the TransferCode field if it's non-nil, zero value otherwise.

func (*Transfer) GetUpdatedAt

func (t *Transfer) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type TransferRecipient

type TransferRecipient struct {
	Domain        *string                  `json:"domain, omitempty"`
	Type          *string                  `json:"type, omitempty"`
	Currency      *string                  `json:"currency, omitempty"`
	Name          *string                  `json:"name, omitempty"`
	Details       TransferRecipientDetails `json:"details, omitempty"`
	Description   *string                  `json:"description"`
	Metadata      Metadata                 `json:"metadata, omitempty"`
	RecipientCode *string                  `json:"recipient_code, omitempty"`
	Active        *bool                    `json:"active, omitempty"`
	Id            *int                     `json:"id, omitempty"`
	Integration   *int                     `json:"integration, omitempty, omitempty"`
	CreatedAt     *time.Time               `json:"created_at, omitempty"`
	UpdatedAt     *time.Time               `json:"updated_at, omitempty"`
}

func (*TransferRecipient) GetActive

func (t *TransferRecipient) GetActive() bool

GetActive returns the Active field if it's non-nil, zero value otherwise.

func (*TransferRecipient) GetCreatedAt

func (t *TransferRecipient) GetCreatedAt() time.Time

GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.

func (*TransferRecipient) GetCurrency

func (t *TransferRecipient) GetCurrency() string

GetCurrency returns the Currency field if it's non-nil, zero value otherwise.

func (*TransferRecipient) GetDescription

func (t *TransferRecipient) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*TransferRecipient) GetDomain

func (t *TransferRecipient) GetDomain() string

GetDomain returns the Domain field if it's non-nil, zero value otherwise.

func (*TransferRecipient) GetId

func (t *TransferRecipient) GetId() int

GetId returns the Id field if it's non-nil, zero value otherwise.

func (*TransferRecipient) GetIntegration

func (t *TransferRecipient) GetIntegration() int

GetIntegration returns the Integration field if it's non-nil, zero value otherwise.

func (*TransferRecipient) GetName

func (t *TransferRecipient) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*TransferRecipient) GetRecipientCode

func (t *TransferRecipient) GetRecipientCode() string

GetRecipientCode returns the RecipientCode field if it's non-nil, zero value otherwise.

func (*TransferRecipient) GetType

func (t *TransferRecipient) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*TransferRecipient) GetUpdatedAt

func (t *TransferRecipient) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

type TransferRecipientDetails

type TransferRecipientDetails struct {
	AccountNumber *string `json:"account_number, omitempty"`
	AccountName   *string `json:"account_name, omitempty"`
	BankCode      *string `json:"bank_code, omitempty"`
	BankName      *string `json:"bank_name, omitempty"`
}

func (*TransferRecipientDetails) GetAccountName

func (t *TransferRecipientDetails) GetAccountName() string

GetAccountName returns the AccountName field if it's non-nil, zero value otherwise.

func (*TransferRecipientDetails) GetAccountNumber

func (t *TransferRecipientDetails) GetAccountNumber() string

GetAccountNumber returns the AccountNumber field if it's non-nil, zero value otherwise.

func (*TransferRecipientDetails) GetBankCode

func (t *TransferRecipientDetails) GetBankCode() string

GetBankCode returns the BankCode field if it's non-nil, zero value otherwise.

func (*TransferRecipientDetails) GetBankName

func (t *TransferRecipientDetails) GetBankName() string

GetBankName returns the BankName field if it's non-nil, zero value otherwise.

type TransferRecipientRequest

type TransferRecipientRequest struct {
	Type          *string  `json:"type, omitempty"`
	Currency      *string  `json:"currency, omitempty"`
	Name          *string  `json:"name, omitempty"`
	Description   *string  `json:"description"`
	Metadata      Metadata `json:"metadata, omitempty"`
	AccountNumber *string  `json:"account_number, omitempty"`
	BankCode      *string  `json:"bank_code, omitempty"`
}

func (*TransferRecipientRequest) GetAccountNumber

func (t *TransferRecipientRequest) GetAccountNumber() string

GetAccountNumber returns the AccountNumber field if it's non-nil, zero value otherwise.

func (*TransferRecipientRequest) GetBankCode

func (t *TransferRecipientRequest) GetBankCode() string

GetBankCode returns the BankCode field if it's non-nil, zero value otherwise.

func (*TransferRecipientRequest) GetCurrency

func (t *TransferRecipientRequest) GetCurrency() string

GetCurrency returns the Currency field if it's non-nil, zero value otherwise.

func (*TransferRecipientRequest) GetDescription

func (t *TransferRecipientRequest) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*TransferRecipientRequest) GetName

func (t *TransferRecipientRequest) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*TransferRecipientRequest) GetType

func (t *TransferRecipientRequest) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

type TransferRecipientService

type TransferRecipientService service

TransferService handles the communication with the Transfers related parts of the Paystack API

func (*TransferRecipientService) Create

Create creates a new transfer recipient

Paystack API reference: https://developers.paystack.co/reference#create-transfer-recipient

func (*TransferRecipientService) List

List returns all created transfer recipients

Paystack API reference: https://developers.paystack.co/reference#list-transfers

type TransferRequest

type TransferRequest struct {
	Recipient    *string `json:"recipient, omitempty"`
	Amount       *int    `json:"amount, omitempty"`
	Currency     *string `json:"currency, omitempty"`
	Source       *string `json:"source, omitempty"`
	Reason       *string `json:"reason, omitempty"`
	TransferCode *string `json:"transfer_code, omitempty"`
}

func (*TransferRequest) GetAmount

func (t *TransferRequest) GetAmount() int

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*TransferRequest) GetCurrency

func (t *TransferRequest) GetCurrency() string

GetCurrency returns the Currency field if it's non-nil, zero value otherwise.

func (*TransferRequest) GetReason

func (t *TransferRequest) GetReason() string

GetReason returns the Reason field if it's non-nil, zero value otherwise.

func (*TransferRequest) GetRecipient

func (t *TransferRequest) GetRecipient() string

GetRecipient returns the Recipient field if it's non-nil, zero value otherwise.

func (*TransferRequest) GetSource

func (t *TransferRequest) GetSource() string

GetSource returns the Source field if it's non-nil, zero value otherwise.

func (*TransferRequest) GetTransferCode

func (t *TransferRequest) GetTransferCode() string

GetTransferCode returns the TransferCode field if it's non-nil, zero value otherwise.

type TransferService

type TransferService service

TransferService handles the communication with the Transfers related parts of the Paystack API

func (*TransferService) DisableOTP

func (s *TransferService) DisableOTP(ctx context.Context) (*Message, *Response, error)

DisableOTP

Paystack API reference: https://developers.paystack.co/reference#update-transfer

func (*TransferService) DisableOTPFinalize

func (s *TransferService) DisableOTPFinalize(ctx context.Context) (*Message, *Response, error)

DisableOTPFinalize

Paystack API reference: https://developers.paystack.co/reference#update-transfer

func (*TransferService) EnableOTP

func (s *TransferService) EnableOTP(ctx context.Context) (*Message, *Response, error)

EnableOTP

Paystack API reference: https://developers.paystack.co/reference#update-transfer

func (*TransferService) Fetch

func (s *TransferService) Fetch(ctx context.Context, id string) (*Transfer, *Response, error)

Fetch fetches a transfer

Paystack API reference: https://developers.paystack.co/reference#fetch-transfer

func (*TransferService) Finalize

Finalize

Paystack API reference: https://developers.paystack.co/reference#finalize-transfer

func (*TransferService) Initiate

Initiate creates a new transfer

Paystack API reference: https://developers.paystack.co/reference#initiate-transfer

func (*TransferService) InitiateBulkTransfer

func (s *TransferService) InitiateBulkTransfer(ctx context.Context, t *BulkTransferRequest) (*Message, *Response, error)

InitiateBulkTransfer creates a new transfer

Paystack API reference: https://developers.paystack.co/reference#initiate-bulk-transfer

func (*TransferService) List

func (s *TransferService) List(ctx context.Context, opt *ListOptions) ([]Transfer, *Response, error)

List returns all created transfers

Paystack API reference: https://developers.paystack.co/reference#list-transfers

func (*TransferService) ResendOTP

func (s *TransferService) ResendOTP(ctx context.Context, sa *TransferRequest) (*Message, *Response, error)

ResendOTP

Paystack API reference: https://developers.paystack.co/reference#resend-otp-for-transfer

Jump to

Keyboard shortcuts

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