Documentation ¶
Index ¶
- func Bool(v bool) *bool
- func CheckResponse(r *http.Response) error
- func Int(v int) *int
- func SecretKey(key string) func(*Client)
- func String(v string) *string
- type AccountData
- type AuthError
- type Authorization
- func (a *Authorization) GetAuthorizationCode() string
- func (a *Authorization) GetBank() string
- func (a *Authorization) GetBin() string
- func (a *Authorization) GetCardType() string
- func (a *Authorization) GetChannel() string
- func (a *Authorization) GetCountryCode() string
- func (a *Authorization) GetCustomer() string
- func (a *Authorization) GetExpMonth() string
- func (a *Authorization) GetExpYear() string
- func (a *Authorization) GetLast4() string
- func (a *Authorization) GetReusable() bool
- func (a *Authorization) GetSignature() string
- type BadRequestError
- type Balance
- type BalanceService
- type Bank
- func (b *Bank) GetActive() bool
- func (b *Bank) GetCode() string
- func (b *Bank) GetCreatedAt() time.Time
- func (b *Bank) GetGateway() string
- func (b *Bank) GetId() int
- func (b *Bank) GetLongcode() string
- func (b *Bank) GetName() string
- func (b *Bank) GetSlug() string
- func (b *Bank) GetUpdatedAt() time.Time
- type Bin
- type BirthdayRequest
- type BulkBatch
- type BulkBatchRequest
- type BulkCharge
- func (b *BulkCharge) GetAmount() int
- func (b *BulkCharge) GetBulkcharge() int
- func (b *BulkCharge) GetCreatedAt() time.Time
- func (b *BulkCharge) GetCurrency() string
- func (b *BulkCharge) GetDomain() string
- func (b *BulkCharge) GetId() int
- func (b *BulkCharge) GetIntegration() int
- func (b *BulkCharge) GetStatus() string
- func (b *BulkCharge) GetUpdatedAt() time.Time
- type BulkChargeService
- func (s *BulkChargeService) FetchBatch(ctx context.Context, id string) (*BulkBatch, *Response, error)
- func (s *BulkChargeService) FetchBatchCharges(ctx context.Context, id string, opt *BullkChargeOptions) ([]*BulkCharge, *Response, error)
- func (s *BulkChargeService) Initiate(ctx context.Context, request []*BulkBatchRequest) (*BulkBatch, *Response, error)
- func (s *BulkChargeService) ListBatches(ctx context.Context, opt *ListOptions) ([]*BulkBatch, *Response, error)
- func (s *BulkChargeService) PauseBatch(ctx context.Context, batch_code string) (*Message, *Response, error)
- func (s *BulkChargeService) ResumeBatch(ctx context.Context, batch_code string) (*Message, *Response, error)
- type BulkTransferRequest
- type BullkChargeOptions
- type BvnData
- type Card
- type ChargeRequest
- type ChargeService
- func (s *ChargeService) Charge(ctx context.Context, request *ChargeRequest) (*Transaction, *Response, error)
- func (s *ChargeService) CheckPending(ctx context.Context, reference *string) (*Transaction, *Response, error)
- func (s *ChargeService) SubmitBirthday(ctx context.Context, request *BirthdayRequest) (*Transaction, *Response, error)
- func (s *ChargeService) SubmitOTP(ctx context.Context, request *OTPRequest) (*Transaction, *Response, error)
- func (s *ChargeService) SubmitPIN(ctx context.Context, request *PinRequest) (*Transaction, *Response, error)
- func (s *ChargeService) SubmitPhone(ctx context.Context, request *PhoneRequest) (*Transaction, *Response, error)
- func (s *ChargeService) Tokenize(ctx context.Context, request *ChargeRequest) (*Authorization, *Response, error)
- type Client
- type CustomFields
- type Customer
- func (c *Customer) GetCreatedAt() time.Time
- func (c *Customer) GetCustomerCode() string
- func (c *Customer) GetDomain() string
- func (c *Customer) GetEmail() string
- func (c *Customer) GetFirstName() string
- func (c *Customer) GetId() int
- func (c *Customer) GetIntegration() int
- func (c *Customer) GetLastName() string
- func (c *Customer) GetPhone() string
- func (c *Customer) GetRiskAction() string
- func (c *Customer) GetUpdatedAt() time.Time
- type CustomerOptions
- type CustomerRequest
- type CustomerService
- func (s *CustomerService) Create(ctx context.Context, cr *CustomerRequest) (*Customer, *Response, error)
- func (s *CustomerService) DeactivateAuthorization(ctx context.Context, a *Authorization) (*Message, *Response, error)
- func (s *CustomerService) Fetch(ctx context.Context, id string, options *CustomerOptions) (*Customer, *Response, error)
- func (s *CustomerService) List(ctx context.Context, opt *ListOptions) ([]*Customer, *Response, error)
- func (s *CustomerService) SetRiskAction(ctx context.Context, rap *RiskActionPayload) (*Customer, *Response, error)
- func (s *CustomerService) Update(ctx context.Context, cr *CustomerRequest, customerCode string) (*Customer, *Response, error)
- type ErrorResponse
- type ExportPath
- type ExportRequest
- type FieldByCurrency
- type FinalizeTransferRequest
- type History
- type IntegrationOptions
- type IntegrationService
- type ListOptions
- type Log
- type Message
- type Meta
- type MetaResponse
- type Metadata
- type MiscellaneousService
- func (s *MiscellaneousService) ListBanks(ctx context.Context, opt *ListOptions) ([]Bank, *Response, error)
- func (s *MiscellaneousService) ResolveAccountNumber(ctx context.Context, opt *ListOptions) (*AccountData, *Response, error)
- func (s *MiscellaneousService) ResolveBvn(ctx context.Context, id string) (*BvnData, *Response, error)
- func (s *MiscellaneousService) ResolveCardBin(ctx context.Context, id string) (*Bin, *Response, error)
- type NotFoundError
- type OTPRequest
- type Page
- func (p *Page) GetActive() bool
- func (p *Page) GetAmount() int
- func (p *Page) GetCreatedAt() time.Time
- func (p *Page) GetCurrency() string
- func (p *Page) GetDescription() string
- func (p *Page) GetDomain() string
- func (p *Page) GetId() int
- func (p *Page) GetIntegration() int
- func (p *Page) GetName() string
- func (p *Page) GetPlan() int
- func (p *Page) GetRedirectUrl() string
- func (p *Page) GetSlug() string
- func (p *Page) GetUpdatedAt() time.Time
- type PageRequest
- func (p *PageRequest) GetActive() bool
- func (p *PageRequest) GetAmount() int
- func (p *PageRequest) GetCurrency() string
- func (p *PageRequest) GetDescription() string
- func (p *PageRequest) GetId() int
- func (p *PageRequest) GetName() string
- func (p *PageRequest) GetRedirectUrl() string
- func (p *PageRequest) GetSlug() string
- type PageService
- func (s *PageService) CheckSlugAvailability(ctx context.Context, id string) (*Message, *Response, error)
- func (s *PageService) Create(ctx context.Context, sa *PageRequest) (*Page, *Response, error)
- func (s *PageService) Fetch(ctx context.Context, id string) (*Page, *Response, error)
- func (s *PageService) List(ctx context.Context, opt *ListOptions) ([]Page, *Response, error)
- func (s *PageService) Update(ctx context.Context, sa *PageRequest, id string) (*Page, *Response, error)
- type PaymentSession
- type PhoneRequest
- type Photo
- type PinRequest
- type Plan
- func (p *Plan) GetAmount() int
- func (p *Plan) GetCreatedAt() time.Time
- func (p *Plan) GetCurrency() string
- func (p *Plan) GetDescription() string
- func (p *Plan) GetDomain() string
- func (p *Plan) GetHostedPage() bool
- func (p *Plan) GetHostedPageSummary() string
- func (p *Plan) GetHostedPageURL() string
- func (p *Plan) GetId() int
- func (p *Plan) GetIntegration() int
- func (p *Plan) GetInterval() string
- func (p *Plan) GetInvoiceLimit() string
- func (p *Plan) GetName() string
- func (p *Plan) GetPlanCode() string
- func (p *Plan) GetSendInvoices() bool
- func (p *Plan) GetSendSms() bool
- func (p *Plan) GetUpdatedAt() time.Time
- type PlanOptions
- type PlanRequest
- func (p *PlanRequest) GetAmount() int
- func (p *PlanRequest) GetCurrency() string
- func (p *PlanRequest) GetDescription() string
- func (p *PlanRequest) GetInterval() string
- func (p *PlanRequest) GetInvoiceLimit() string
- func (p *PlanRequest) GetName() string
- func (p *PlanRequest) GetSendInvoices() bool
- func (p *PlanRequest) GetSendSms() bool
- type PlanService
- func (s *PlanService) Create(ctx context.Context, p *PlanRequest) (*Plan, *Response, error)
- func (s *PlanService) Fetch(ctx context.Context, id string) (*Plan, *Response, error)
- func (s *PlanService) List(ctx context.Context, opt *PlanOptions) ([]Plan, *Response, error)
- func (s *PlanService) Update(ctx context.Context, sa *Plan, id string) (*PlanSubscription, *Response, error)
- type PlanSubscription
- func (p *PlanSubscription) GetAmount() int
- func (p *PlanSubscription) GetAuthorization() int
- func (p *PlanSubscription) GetCreatedAt() time.Time
- func (p *PlanSubscription) GetCronExpression() string
- func (p *PlanSubscription) GetCustomer() int
- func (p *PlanSubscription) GetDomain() string
- func (p *PlanSubscription) GetEasyCronId() int
- func (p *PlanSubscription) GetEmailToken() string
- func (p *PlanSubscription) GetId() int
- func (p *PlanSubscription) GetIntegration() int
- func (p *PlanSubscription) GetNextPaymentDate() time.Time
- func (p *PlanSubscription) GetPlan() int
- func (p *PlanSubscription) GetQuantity() int
- func (p *PlanSubscription) GetStatus() string
- func (p *PlanSubscription) GetSubscriptionCode() string
- func (p *PlanSubscription) GetUpdatedAt() time.Time
- type Reauthorization
- type Response
- type RiskAction
- type RiskActionPayload
- type ServerError
- type Settlement
- func (s *Settlement) GetCreatedAt() time.Time
- func (s *Settlement) GetDomain() string
- func (s *Settlement) GetId() int
- func (s *Settlement) GetIntegration() int
- func (s *Settlement) GetSettledDate() time.Time
- func (s *Settlement) GetStatus() string
- func (s *Settlement) GetTotalAmount() int
- func (s *Settlement) GetUpdatedAt() time.Time
- type SettlementOptions
- type SettlementService
- type StandardListResponse
- type StandardResponse
- type Subaccount
- func (s *Subaccount) GetAccountNumber() string
- func (s *Subaccount) GetActive() bool
- func (s *Subaccount) GetBusinessName() string
- func (s *Subaccount) GetCreatedAt() time.Time
- func (s *Subaccount) GetDescription() string
- func (s *Subaccount) GetDomain() string
- func (s *Subaccount) GetId() int
- func (s *Subaccount) GetIntegration() int
- func (s *Subaccount) GetIsVerified() bool
- func (s *Subaccount) GetMigrate() bool
- func (s *Subaccount) GetPrimaryContactEmail() string
- func (s *Subaccount) GetPrimaryContactName() string
- func (s *Subaccount) GetPrimaryContactPhone() string
- func (s *Subaccount) GetSettlementBank() string
- func (s *Subaccount) GetSettlementSchedule() string
- func (s *Subaccount) GetSubaccountCode() string
- func (s *Subaccount) GetUpdatedAt() time.Time
- type SubaccountRequest
- func (s *SubaccountRequest) GetAccountNumber() string
- func (s *SubaccountRequest) GetBusinessName() string
- func (s *SubaccountRequest) GetPrimaryContactEmail() string
- func (s *SubaccountRequest) GetPrimaryContactName() string
- func (s *SubaccountRequest) GetPrimaryContactPhone() string
- func (s *SubaccountRequest) GetSettlementBank() string
- func (s *SubaccountRequest) GetSettlementSchedule() string
- type SubaccountService
- func (s *SubaccountService) Create(ctx context.Context, sr *SubaccountRequest) (*Subaccount, *Response, error)
- func (s *SubaccountService) Fetch(ctx context.Context, id string) (*Subaccount, *Response, error)
- func (s *SubaccountService) List(ctx context.Context, opt *ListOptions) ([]Subaccount, *Response, error)
- func (s *SubaccountService) Update(ctx context.Context, sa *SubaccountRequest, id string) (*Subaccount, *Response, error)
- type Subscription
- func (s *Subscription) GetAmount() int
- func (s *Subscription) GetCreatedAt() time.Time
- func (s *Subscription) GetCronExpression() string
- func (s *Subscription) GetDomain() string
- func (s *Subscription) GetEasyCronId() int
- func (s *Subscription) GetEmailToken() string
- func (s *Subscription) GetId() int
- func (s *Subscription) GetIntegration() int
- func (s *Subscription) GetNextPaymentDate() time.Time
- func (s *Subscription) GetOpenInvoice() string
- func (s *Subscription) GetQuantity() int
- func (s *Subscription) GetStatus() string
- func (s *Subscription) GetSubscriptionCode() string
- func (s *Subscription) GetUpdatedAt() time.Time
- type SubscriptionOptions
- type SubscriptionRequest
- func (s *SubscriptionRequest) GetAuthorization() string
- func (s *SubscriptionRequest) GetCode() string
- func (s *SubscriptionRequest) GetCustomer() string
- func (s *SubscriptionRequest) GetPlan() string
- func (s *SubscriptionRequest) GetStartDate() time.Time
- func (s *SubscriptionRequest) GetToken() string
- type SubscriptionResponse
- func (s *SubscriptionResponse) GetAmount() int
- func (s *SubscriptionResponse) GetAuthorization() int
- func (s *SubscriptionResponse) GetCreatedAt() time.Time
- func (s *SubscriptionResponse) GetCustomer() int
- func (s *SubscriptionResponse) GetDomain() string
- func (s *SubscriptionResponse) GetEmailToken() string
- func (s *SubscriptionResponse) GetId() int
- func (s *SubscriptionResponse) GetIntegration() int
- func (s *SubscriptionResponse) GetPlan() int
- func (s *SubscriptionResponse) GetQuantity() int
- func (s *SubscriptionResponse) GetStatus() string
- func (s *SubscriptionResponse) GetSubscriptionCode() string
- func (s *SubscriptionResponse) GetUpdatedAt() time.Time
- type SubscriptionService
- func (s *SubscriptionService) Create(ctx context.Context, sa *Subscription) (*SubscriptionResponse, *Response, error)
- func (s *SubscriptionService) Disable(ctx context.Context, sa *SubscriptionRequest) (*Message, *Response, error)
- func (s *SubscriptionService) Enable(ctx context.Context, sa *SubscriptionRequest) (*Message, *Response, error)
- func (s *SubscriptionService) Fetch(ctx context.Context, id string) (*Subscription, *Response, error)
- func (s *SubscriptionService) List(ctx context.Context, opt *SubscriptionOptions) ([]Subscription, *Response, error)
- type Transaction
- func (t *Transaction) GetAmount() int
- func (t *Transaction) GetChannel() string
- func (t *Transaction) GetCreatedAt() time.Time
- func (t *Transaction) GetCurrency() string
- func (t *Transaction) GetDomain() string
- func (t *Transaction) GetFees() int
- func (t *Transaction) GetFeesSplit() int
- func (t *Transaction) GetGatewayResponse() string
- func (t *Transaction) GetId() int
- func (t *Transaction) GetIpAddress() string
- func (t *Transaction) GetMessage() string
- func (t *Transaction) GetPaidAt() time.Time
- func (t *Transaction) GetReference() string
- func (t *Transaction) GetStatus() string
- func (t *Transaction) GetTransactionDate() time.Time
- type TransactionAuthorization
- type TransactionOptions
- type TransactionRequest
- func (t *TransactionRequest) GetAmount() string
- func (t *TransactionRequest) GetAuthorizationCode() string
- func (t *TransactionRequest) GetBearer() string
- func (t *TransactionRequest) GetCallbackUrl() string
- func (t *TransactionRequest) GetCurrency() string
- func (t *TransactionRequest) GetEmail() string
- func (t *TransactionRequest) GetPlan() string
- func (t *TransactionRequest) GetReference() string
- func (t *TransactionRequest) GetSubaccount() string
- type TransactionService
- func (s *TransactionService) ChargeAuthorization(ctx context.Context, tr *TransactionRequest) (*Transaction, *Response, error)
- func (s *TransactionService) CheckAuthorization(ctx context.Context, opt *TransactionRequest) (*FieldByCurrency, *Response, error)
- func (s *TransactionService) Export(ctx context.Context, opt *TransactionOptions) (*ExportPath, *Response, error)
- func (s *TransactionService) Fetch(ctx context.Context, id string) (*Transaction, *Response, error)
- func (s *TransactionService) Initialize(ctx context.Context, tr *TransactionRequest) (*TransactionAuthorization, *Response, error)
- func (s *TransactionService) List(ctx context.Context, opt *TransactionOptions) ([]Transaction, *Response, error)
- func (s *TransactionService) RequestReauthorization(ctx context.Context, opt *TransactionRequest) (*Reauthorization, *Response, error)
- func (s *TransactionService) Timeline(ctx context.Context, id string) (*TransactionTimeline, *Response, error)
- func (s *TransactionService) Totals(ctx context.Context, opt *TransactionOptions) (*TransactionTotal, *Response, error)
- func (s *TransactionService) Verify(ctx context.Context, reference string) (*TransactionVerify, *Response, error)
- type TransactionTimeline
- func (t *TransactionTimeline) GetAttempts() int
- func (t *TransactionTimeline) GetAuthentication() string
- func (t *TransactionTimeline) GetChannel() string
- func (t *TransactionTimeline) GetErrors() int
- func (t *TransactionTimeline) GetMobile() bool
- func (t *TransactionTimeline) GetSuccess() bool
- func (t *TransactionTimeline) GetTimeSpent() int
- type TransactionTotal
- type TransactionVerify
- type Transfer
- func (t *Transfer) GetAmount() int
- func (t *Transfer) GetCreatedAt() time.Time
- func (t *Transfer) GetCurrency() string
- func (t *Transfer) GetDomain() string
- func (t *Transfer) GetId() int
- func (t *Transfer) GetIntegration() int
- func (t *Transfer) GetReason() string
- func (t *Transfer) GetSource() string
- func (t *Transfer) GetSourceDetails() string
- func (t *Transfer) GetStatus() string
- func (t *Transfer) GetTransferCode() string
- func (t *Transfer) GetUpdatedAt() time.Time
- type TransferRecipient
- func (t *TransferRecipient) GetActive() bool
- func (t *TransferRecipient) GetCreatedAt() time.Time
- func (t *TransferRecipient) GetCurrency() string
- func (t *TransferRecipient) GetDescription() string
- func (t *TransferRecipient) GetDomain() string
- func (t *TransferRecipient) GetId() int
- func (t *TransferRecipient) GetIntegration() int
- func (t *TransferRecipient) GetName() string
- func (t *TransferRecipient) GetRecipientCode() string
- func (t *TransferRecipient) GetType() string
- func (t *TransferRecipient) GetUpdatedAt() time.Time
- type TransferRecipientDetails
- type TransferRecipientRequest
- func (t *TransferRecipientRequest) GetAccountNumber() string
- func (t *TransferRecipientRequest) GetBankCode() string
- func (t *TransferRecipientRequest) GetCurrency() string
- func (t *TransferRecipientRequest) GetDescription() string
- func (t *TransferRecipientRequest) GetName() string
- func (t *TransferRecipientRequest) GetType() string
- type TransferRecipientService
- type TransferRequest
- type TransferService
- func (s *TransferService) DisableOTP(ctx context.Context) (*Message, *Response, error)
- func (s *TransferService) DisableOTPFinalize(ctx context.Context) (*Message, *Response, error)
- func (s *TransferService) EnableOTP(ctx context.Context) (*Message, *Response, error)
- func (s *TransferService) Fetch(ctx context.Context, id string) (*Transfer, *Response, error)
- func (s *TransferService) Finalize(ctx context.Context, sa *FinalizeTransferRequest) (*Response, error)
- func (s *TransferService) Initiate(ctx context.Context, t *TransferRequest) (*Transfer, *Response, error)
- func (s *TransferService) InitiateBulkTransfer(ctx context.Context, t *BulkTransferRequest) (*Message, *Response, error)
- func (s *TransferService) List(ctx context.Context, opt *ListOptions) ([]Transfer, *Response, error)
- func (s *TransferService) ResendOTP(ctx context.Context, sa *TransferRequest) (*Message, *Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func CheckResponse ¶
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 ¶
Int is a helper routine that allocates a new int 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.
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 ¶
GetBalance returns the Balance field if it's non-nil, zero value otherwise.
func (*Balance) GetCurrency ¶
GetCurrency returns the Currency field if it's non-nil, zero value otherwise.
type BalanceService ¶
type BalanceService service
func (*BalanceService) Check ¶
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) GetCreatedAt ¶
GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.
func (*Bank) GetGateway ¶
GetGateway returns the Gateway field if it's non-nil, zero value otherwise.
func (*Bank) GetLongcode ¶
GetLongcode returns the Longcode field if it's non-nil, zero value otherwise.
func (*Bank) GetUpdatedAt ¶
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) GetCardType ¶
GetCardType returns the CardType field if it's non-nil, zero value otherwise.
func (*Bin) GetCountryCode ¶
GetCountryCode returns the CountryCode field if it's non-nil, zero value otherwise.
func (*Bin) GetCountryName ¶
GetCountryName returns the CountryName field if it's non-nil, zero value otherwise.
func (*Bin) GetLinkedBankId ¶
GetLinkedBankId returns the LinkedBankId field if it's non-nil, zero value otherwise.
func (*Bin) GetSubBrand ¶
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 ¶
GetBatchCode returns the BatchCode field if it's non-nil, zero value otherwise.
func (*BulkBatch) GetCreatedAt ¶
GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.
func (*BulkBatch) GetDomain ¶
GetDomain returns the Domain field if it's non-nil, zero value otherwise.
func (*BulkBatch) GetIntegration ¶
GetIntegration returns the Integration field if it's non-nil, zero value otherwise.
func (*BulkBatch) GetStatus ¶
GetStatus returns the Status field if it's non-nil, zero value otherwise.
func (*BulkBatch) GetUpdatedAt ¶
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) GetFirstName ¶
GetFirstName returns the FirstName field if it's non-nil, zero value otherwise.
func (*BvnData) GetLastName ¶
GetLastName returns the LastName 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) GetExpiryMonth ¶
GetExpiryMonth returns the ExpiryMonth field if it's non-nil, zero value otherwise.
func (*Card) GetExpiryYear ¶
GetExpiryYear returns the ExpiryYear 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 ¶
NewClient returns a new Paystack API client. If a nil httpClient is provided, http.DefaultClient will be used.
func (*Client) Do ¶
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 ¶
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 ¶
GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.
func (*Customer) GetCustomerCode ¶
GetCustomerCode returns the CustomerCode field if it's non-nil, zero value otherwise.
func (*Customer) GetDomain ¶
GetDomain returns the Domain field if it's non-nil, zero value otherwise.
func (*Customer) GetFirstName ¶
GetFirstName returns the FirstName field if it's non-nil, zero value otherwise.
func (*Customer) GetIntegration ¶
GetIntegration returns the Integration field if it's non-nil, zero value otherwise.
func (*Customer) GetLastName ¶
GetLastName returns the LastName field if it's non-nil, zero value otherwise.
func (*Customer) GetRiskAction ¶
GetRiskAction returns the RiskAction field if it's non-nil, zero value otherwise.
func (*Customer) GetUpdatedAt ¶
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 ¶
func (s *CustomerService) Create(ctx context.Context, cr *CustomerRequest) (*Customer, *Response, error)
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 ¶
GetMessage returns the Message 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 ¶
GetChannel returns the Channel field if it's non-nil, zero value otherwise.
func (*Log) GetSuccess ¶
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 ¶
GetMessage returns the Message field if it's non-nil, zero value otherwise.
type MetaResponse ¶
type MetaResponse struct {
Meta Meta `json:"meta"`
}
Object to model the meta json object returned by the Paystack API
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) GetCreatedAt ¶
GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.
func (*Page) GetCurrency ¶
GetCurrency returns the Currency field if it's non-nil, zero value otherwise.
func (*Page) GetDescription ¶
GetDescription returns the Description field if it's non-nil, zero value otherwise.
func (*Page) GetIntegration ¶
GetIntegration returns the Integration field if it's non-nil, zero value otherwise.
func (*Page) GetRedirectUrl ¶
GetRedirectUrl returns the RedirectUrl field if it's non-nil, zero value otherwise.
func (*Page) GetUpdatedAt ¶
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 ¶
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 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) GetCreatedAt ¶
GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.
func (*Plan) GetCurrency ¶
GetCurrency returns the Currency field if it's non-nil, zero value otherwise.
func (*Plan) GetDescription ¶
GetDescription returns the Description field if it's non-nil, zero value otherwise.
func (*Plan) GetHostedPage ¶
GetHostedPage returns the HostedPage field if it's non-nil, zero value otherwise.
func (*Plan) GetHostedPageSummary ¶
GetHostedPageSummary returns the HostedPageSummary field if it's non-nil, zero value otherwise.
func (*Plan) GetHostedPageURL ¶
GetHostedPageURL returns the HostedPageURL field if it's non-nil, zero value otherwise.
func (*Plan) GetIntegration ¶
GetIntegration returns the Integration field if it's non-nil, zero value otherwise.
func (*Plan) GetInterval ¶
GetInterval returns the Interval field if it's non-nil, zero value otherwise.
func (*Plan) GetInvoiceLimit ¶
GetInvoiceLimit returns the InvoiceLimit field if it's non-nil, zero value otherwise.
func (*Plan) GetPlanCode ¶
GetPlanCode returns the PlanCode field if it's non-nil, zero value otherwise.
func (*Plan) GetSendInvoices ¶
GetSendInvoices returns the SendInvoices field if it's non-nil, zero value otherwise.
func (*Plan) GetSendSms ¶
GetSendSms returns the SendSms field if it's non-nil, zero value otherwise.
func (*Plan) GetUpdatedAt ¶
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 ¶
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 {}
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 ¶
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 ¶
func (s *SettlementService) Fetch(ctx context.Context, opt *SettlementOptions) ([]Settlement, *Response, error)
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 ¶
func (s *SubaccountService) Create(ctx context.Context, sr *SubaccountRequest) (*Subaccount, *Response, error)
Create returns a new subaccount
Paystack API reference: https://developers.paystack.co/reference#create-subaccount
func (*SubaccountService) Fetch ¶
func (s *SubaccountService) Fetch(ctx context.Context, id string) (*Subaccount, *Response, error)
Fetch returns a subaccount with the passed id
Paystack API reference: https://developers.paystack.co/reference#fetch-subaccount
func (*SubaccountService) List ¶
func (s *SubaccountService) List(ctx context.Context, opt *ListOptions) ([]Subaccount, *Response, error)
List returns an array of all created subaccounts
Paystack API reference: https://developers.paystack.co/reference#list-subaccounts
func (*SubaccountService) Update ¶
func (s *SubaccountService) Update(ctx context.Context, sa *SubaccountRequest, id string) (*Subaccount, *Response, error)
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 ¶
func (s *SubscriptionService) Create(ctx context.Context, sa *Subscription) (*SubscriptionResponse, *Response, error)
Create creates a new subscription
Paystack API reference: https://developers.paystack.co/reference#create-subscription
func (*SubscriptionService) Disable ¶
func (s *SubscriptionService) Disable(ctx context.Context, sa *SubscriptionRequest) (*Message, *Response, error)
Disable disables a subscription model with the supplied parameters
Paystack API reference: https://developers.paystack.co/reference#disable-subscription
func (*SubscriptionService) Enable ¶
func (s *SubscriptionService) Enable(ctx context.Context, sa *SubscriptionRequest) (*Message, *Response, error)
Enable enables a subscription model with the supplied parameters
Paystack API reference: https://developers.paystack.co/reference#enable-subscription
func (*SubscriptionService) Fetch ¶
func (s *SubscriptionService) Fetch(ctx context.Context, id string) (*Subscription, *Response, error)
Fetch fetches a subscription
Paystack API reference: https://developers.paystack.co/reference#fetch-subscription
func (*SubscriptionService) List ¶
func (s *SubscriptionService) List(ctx context.Context, opt *SubscriptionOptions) ([]Subscription, *Response, error)
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 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 ¶
func (s *TransactionService) Export(ctx context.Context, opt *TransactionOptions) (*ExportPath, *Response, error)
Export a transaction
Paystack API reference: https://developers.paystack.co/reference#export-transactions
func (*TransactionService) Fetch ¶
func (s *TransactionService) Fetch(ctx context.Context, id string) (*Transaction, *Response, error)
Fetch fetches a transaction
Paystack API reference: https://developers.paystack.co/reference#fetch-transaction
func (*TransactionService) Initialize ¶
func (s *TransactionService) Initialize(ctx context.Context, tr *TransactionRequest) (*TransactionAuthorization, *Response, error)
Initialize
Paystack API reference: https://developers.paystack.co/reference#initialize-a-transaction
func (*TransactionService) List ¶
func (s *TransactionService) List(ctx context.Context, opt *TransactionOptions) ([]Transaction, *Response, error)
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 ¶
func (s *TransactionService) Timeline(ctx context.Context, id string) (*TransactionTimeline, *Response, error)
Timeline fetches a transaction timeline
Paystack API reference: https://developers.paystack.co/reference#view-transaction-timeline
func (*TransactionService) Totals ¶
func (s *TransactionService) Totals(ctx context.Context, opt *TransactionOptions) (*TransactionTotal, *Response, error)
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 ¶
GetAmount returns the Amount field if it's non-nil, zero value otherwise.
func (*Transfer) GetCreatedAt ¶
GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.
func (*Transfer) GetCurrency ¶
GetCurrency returns the Currency field if it's non-nil, zero value otherwise.
func (*Transfer) GetDomain ¶
GetDomain returns the Domain field if it's non-nil, zero value otherwise.
func (*Transfer) GetIntegration ¶
GetIntegration returns the Integration field if it's non-nil, zero value otherwise.
func (*Transfer) GetReason ¶
GetReason returns the Reason field if it's non-nil, zero value otherwise.
func (*Transfer) GetSource ¶
GetSource returns the Source field if it's non-nil, zero value otherwise.
func (*Transfer) GetSourceDetails ¶
GetSourceDetails returns the SourceDetails field if it's non-nil, zero value otherwise.
func (*Transfer) GetStatus ¶
GetStatus returns the Status field if it's non-nil, zero value otherwise.
func (*Transfer) GetTransferCode ¶
GetTransferCode returns the TransferCode field if it's non-nil, zero value otherwise.
func (*Transfer) GetUpdatedAt ¶
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 ¶
func (s *TransferRecipientService) Create(ctx context.Context, t *TransferRecipientRequest) (*TransferRecipient, *Response, error)
Create creates a new transfer recipient
Paystack API reference: https://developers.paystack.co/reference#create-transfer-recipient
func (*TransferRecipientService) List ¶
func (s *TransferRecipientService) List(ctx context.Context, opt *ListOptions) ([]TransferRecipient, *Response, error)
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 ¶
DisableOTP
Paystack API reference: https://developers.paystack.co/reference#update-transfer
func (*TransferService) DisableOTPFinalize ¶
DisableOTPFinalize
Paystack API reference: https://developers.paystack.co/reference#update-transfer
func (*TransferService) EnableOTP ¶
EnableOTP
Paystack API reference: https://developers.paystack.co/reference#update-transfer
func (*TransferService) Fetch ¶
Fetch fetches a transfer
Paystack API reference: https://developers.paystack.co/reference#fetch-transfer
func (*TransferService) Finalize ¶
func (s *TransferService) Finalize(ctx context.Context, sa *FinalizeTransferRequest) (*Response, error)
Finalize
Paystack API reference: https://developers.paystack.co/reference#finalize-transfer
func (*TransferService) Initiate ¶
func (s *TransferService) Initiate(ctx context.Context, t *TransferRequest) (*Transfer, *Response, error)
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