transfer

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BulkTransfer

type BulkTransfer struct {
	Currency  string                   `json:"currency,omitempty"`
	Source    string                   `json:"source,omitempty"`
	Transfers []map[string]interface{} `json:"transfers,omitempty"`
}

BulkTransfer represents a Paystack bulk transfer You need to disable the Transfers OTP requirement to use this endpoint

type DefaultTransferService

type DefaultTransferService struct {
	*client.Client
}

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

func (*DefaultTransferService) CreateRecipient

func (s *DefaultTransferService) CreateRecipient(ctx context.Context, recipient *Recipient) (*Recipient, error)

CreateRecipient creates a new transfer recipient For more details see https://developers.paystack.co/v1.0/reference#create-transferrecipient

func (*DefaultTransferService) DisableOTP

DisableOTP disables OTP requirement for Transfers In the event that you want to be able to complete transfers programmatically without use of OTPs, this endpoint helps disable that…. with an OTP. No arguments required. You will get an OTP.

func (*DefaultTransferService) EnableOTP

EnableOTP enables OTP requirement for Transfers In the event that a customer wants to stop being able to complete transfers programmatically, this endpoint helps turn OTP requirement back on. No arguments required.

func (*DefaultTransferService) Finalize

func (s *DefaultTransferService) Finalize(ctx context.Context, code, otp string) (response.Response, error)

Finalize completes a transfer request For more details see https://developers.paystack.co/v1.0/reference#finalize-transfer

func (*DefaultTransferService) FinalizeOTPDisable

func (s *DefaultTransferService) FinalizeOTPDisable(ctx context.Context, otp string) (response.Response, error)

FinalizeOTPDisable finalizes disabling of OTP requirement for Transfers For more details see https://developers.paystack.co/v1.0/reference#finalize-disabling-of-otp-requirement-for-transfers

func (*DefaultTransferService) Get

func (s *DefaultTransferService) Get(ctx context.Context, idCode string) (*Transfer, error)

Get returns the details of a transfer. For more details see https://developers.paystack.co/v1.0/reference#fetch-transfer

func (*DefaultTransferService) Initiate

func (s *DefaultTransferService) Initiate(ctx context.Context, req *Request) (*Transfer, error)

Initiate initiates a new transfer For more details see https://developers.paystack.co/v1.0/reference#initiate-transfer

func (*DefaultTransferService) List

func (s *DefaultTransferService) List(ctx context.Context) (*List, error)

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

func (*DefaultTransferService) ListN

func (s *DefaultTransferService) ListN(ctx context.Context, count, offset int) (*List, error)

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

func (*DefaultTransferService) ListRecipients

func (s *DefaultTransferService) ListRecipients(ctx context.Context) (*RecipientList, error)

ListRecipients returns a list of transfer recipients. For more details see https://developers.paystack.co/v1.0/reference#list-transferrecipients

func (*DefaultTransferService) ListRecipientsN

func (s *DefaultTransferService) ListRecipientsN(ctx context.Context, count, offset int) (*RecipientList, error)

ListRecipientsN returns a list of transfer recipients For more details see https://developers.paystack.co/v1.0/reference#list-transferrecipients

func (*DefaultTransferService) MakeBulkTransfer

func (s *DefaultTransferService) MakeBulkTransfer(ctx context.Context, req *BulkTransfer) (response.Response, error)

MakeBulkTransfer initiates a new bulk transfer request You need to disable the Transfers OTP requirement to use this endpoint For more details see https://developers.paystack.co/v1.0/reference#initiate-bulk-transfer

func (*DefaultTransferService) ResendOTP

func (s *DefaultTransferService) ResendOTP(ctx context.Context, transferCode, reason string) (response.Response, error)

ResendOTP generates a new OTP and sends to customer in the event they are having trouble receiving one. For more details see https://developers.paystack.co/v1.0/reference#resend-otp-for-transfer

type List

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

List is a list object for transfers.

type Recipient

type Recipient struct {
	ID            int                    `json:"id,omitempty"`
	CreatedAt     string                 `json:"createdAt,omitempty"`
	UpdatedAt     string                 `json:"updatedAt,omitempty"`
	Type          string                 `json:",omitempty"`
	Name          string                 `json:"name,omitempty"`
	Metadata      client.Metadata        `json:"metadata,omitempty"`
	AccountNumber string                 `json:"account_number,omitempty"`
	BankCode      string                 `json:"bank_code,omitempty"`
	Currency      string                 `json:"currency,omitempty"`
	Description   string                 `json:"description,omitempty"`
	Active        bool                   `json:"active,omitempty"`
	Details       map[string]interface{} `json:"details,omitempty"`
	Domain        string                 `json:"domain,omitempty"`
	RecipientCode string                 `json:"recipient_code,omitempty"`
}

Recipient represents a Paystack transfer recipient For more details see https://developers.paystack.co/v1.0/reference#create-transfer-recipient

type RecipientList

type RecipientList struct {
	Meta   response.ListMeta
	Values []Recipient `json:"data,omitempty"`
}

RecipientList is a list object for transfer recipient.

type Request

type Request struct {
	Source    string  `json:"source,omitempty"`
	Amount    float32 `json:"amount,omitempty"`
	Currency  string  `json:"currency,omitempty"`
	Reason    string  `json:"reason,omitempty"`
	Recipient string  `json:"recipient,omitempty"`
}

type Service

type Service interface {
	Initiate(ctx context.Context, req *Request) (*Transfer, error)
	Finalize(ctx context.Context, code, otp string) (response.Response, error)
	MakeBulkTransfer(ctx context.Context, req *BulkTransfer) (response.Response, error)
	Get(ctx context.Context, idCode string) (*Transfer, error)
	List(ctx context.Context) (*List, error)
	ListN(ctx context.Context, count, offset int) (*List, error)
	ResendOTP(ctx context.Context, transferCode, reason string) (response.Response, error)
	EnableOTP(ctx context.Context) (response.Response, error)
	FinalizeOTPDisable(ctx context.Context, otp string) (response.Response, error)
	CreateRecipient(ctx context.Context, recipient *Recipient) (*Recipient, error)
	ListRecipients(ctx context.Context) (*RecipientList, error)
	ListRecipientsN(ctx context.Context, count, offset int) (*RecipientList, error)
	DisableOTP(ctx context.Context) (response.Response, error)
}

type Transfer

type Transfer struct {
	ID           int     `json:"id,omitempty"`
	CreatedAt    string  `json:"createdAt,omitempty"`
	UpdatedAt    string  `json:"updatedAt,omitempty"`
	Domain       string  `json:"domain,omitempty"`
	Integration  int     `json:"integration,omitempty"`
	Source       string  `json:"source,omitempty"`
	Amount       float32 `json:"amount,omitempty"`
	Currency     string  `json:"currency,omitempty"`
	Reason       string  `json:"reason,omitempty"`
	TransferCode string  `json:"transfer_code,omitempty"`
	// Initiate returns recipient ID as recipient value, Fetch returns recipient object
	Recipient interface{} `json:"recipient,omitempty"`
	Status    string      `json:"status,omitempty"`
	// confirm types for source_details and failures
	SourceDetails interface{} `json:"source_details,omitempty"`
	Failures      interface{} `json:"failures,omitempty"`
	TransferredAt string      `json:"transferred_at,omitempty"`
	TitanCode     string      `json:"titan_code,omitempty"`
}

Transfer is the resource representing your Paystack transfer. For more details see https://developers.paystack.co/v1.0/reference#initiate-transfer

Jump to

Keyboard shortcuts

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