Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type AccountDetailsDto
- type AccountGetBalanceResponse
- type AccountGetBalanceResponseData
- type AccountGetResponse
- type AccountListParams
- type AccountListResponse
- type AccountListResponseData
- type AccountResponseDto
- type AccountResponseDtoStatus
- type AccountResponseDtoType
- type AccountService
- func (r *AccountService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *AccountGetResponse, err error)
- func (r *AccountService) GetBalance(ctx context.Context, id string, opts ...option.RequestOption) (res *AccountGetBalanceResponse, err error)
- func (r *AccountService) List(ctx context.Context, query AccountListParams, opts ...option.RequestOption) (res *AccountListResponse, err error)
- type BankListParams
- type BankListResponse
- type BankListResponseData
- type BankService
- type BilaCollectionCustomerDto
- type BilaCollectionResponseDto
- type BilaCollectionResponseDtoFeeBearer
- type BilaCollectionResponseDtoStatus
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type CollectionGetResponse
- type CollectionGetStatusByReferenceResponse
- type CollectionInitiateMobileMoneyCollectionParams
- type CollectionInitiateMobileMoneyCollectionParamsBearer
- type CollectionInitiateMobileMoneyCollectionParamsCountry
- type CollectionInitiateMobileMoneyCollectionParamsOperator
- type CollectionInitiateMobileMoneyCollectionResponse
- type CollectionListParams
- type CollectionListParamsStatus
- type CollectionListResponse
- type CollectionListResponseData
- type CollectionService
- func (r *CollectionService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *CollectionGetResponse, err error)
- func (r *CollectionService) GetStatusByReference(ctx context.Context, reference string, opts ...option.RequestOption) (res *CollectionGetStatusByReferenceResponse, err error)
- func (r *CollectionService) InitiateMobileMoneyCollection(ctx context.Context, body CollectionInitiateMobileMoneyCollectionParams, ...) (res *CollectionInitiateMobileMoneyCollectionResponse, err error)
- func (r *CollectionService) List(ctx context.Context, query CollectionListParams, opts ...option.RequestOption) (res *CollectionListResponse, err error)
- type Error
- type PaginationMetaDto
- type RecipientResponseDto
- type RecipientResponseDtoType
- type ResolveBankAccountParams
- type ResolveBankAccountParamsCountry
- type ResolveBankAccountResponse
- type ResolveMobileMoneyParams
- type ResolveMobileMoneyParamsCountry
- type ResolveMobileMoneyParamsOperator
- type ResolveMobileMoneyResponse
- type ResolveService
- type ResolvedAccountResponseDto
- type TransactionGetResponse
- type TransactionListParams
- type TransactionListParamsType
- type TransactionListResponse
- type TransactionListResponseData
- type TransactionResponseDto
- type TransactionResponseDtoStatus
- type TransactionResponseDtoType
- type TransactionService
- type TransferGetResponse
- type TransferGetStatusByReferenceResponse
- type TransferInitiateBankTransferParams
- type TransferInitiateBankTransferParamsCountry
- type TransferInitiateBankTransferResponse
- type TransferInitiateMobileMoneyTransferParams
- type TransferInitiateMobileMoneyTransferParamsCountry
- type TransferInitiateMobileMoneyTransferParamsOperator
- type TransferInitiateMobileMoneyTransferResponse
- type TransferListParams
- type TransferListParamsStatus
- type TransferListParamsType
- type TransferListResponse
- type TransferListResponseData
- type TransferRecipientDto
- type TransferRecipientGetResponse
- type TransferRecipientListParams
- type TransferRecipientListParamsType
- type TransferRecipientListResponse
- type TransferRecipientListResponseData
- type TransferRecipientNewBankAccountParams
- type TransferRecipientNewBankAccountParamsCountry
- type TransferRecipientNewBankAccountResponse
- type TransferRecipientNewMobileMoneyParams
- type TransferRecipientNewMobileMoneyParamsCountry
- type TransferRecipientNewMobileMoneyParamsOperator
- type TransferRecipientNewMobileMoneyResponse
- type TransferRecipientService
- func (r *TransferRecipientService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *TransferRecipientGetResponse, err error)
- func (r *TransferRecipientService) List(ctx context.Context, query TransferRecipientListParams, ...) (res *TransferRecipientListResponse, err error)
- func (r *TransferRecipientService) NewBankAccount(ctx context.Context, body TransferRecipientNewBankAccountParams, ...) (res *TransferRecipientNewBankAccountResponse, err error)
- func (r *TransferRecipientService) NewMobileMoney(ctx context.Context, body TransferRecipientNewMobileMoneyParams, ...) (res *TransferRecipientNewMobileMoneyResponse, err error)
- type TransferResponseDto
- type TransferResponseDtoStatus
- type TransferResponseDtoType
- type TransferService
- func (r *TransferService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *TransferGetResponse, err error)
- func (r *TransferService) GetStatusByReference(ctx context.Context, reference string, opts ...option.RequestOption) (res *TransferGetStatusByReferenceResponse, err error)
- func (r *TransferService) InitiateBankTransfer(ctx context.Context, body TransferInitiateBankTransferParams, ...) (res *TransferInitiateBankTransferResponse, err error)
- func (r *TransferService) InitiateMobileMoneyTransfer(ctx context.Context, body TransferInitiateMobileMoneyTransferParams, ...) (res *TransferInitiateMobileMoneyTransferResponse, err error)
- func (r *TransferService) List(ctx context.Context, query TransferListParams, opts ...option.RequestOption) (res *TransferListResponse, err error)
- type WebhookConfigResponseDto
- type WebhookDeactivateResponse
- type WebhookGetDeliveriesParams
- type WebhookGetDeliveriesResponse
- type WebhookGetDeliveriesResponseData
- type WebhookGetDeliveriesResponseDataData
- type WebhookListEventsResponse
- type WebhookListResponse
- type WebhookNewParams
- type WebhookNewResponse
- type WebhookRotateSecretResponse
- type WebhookRotateSecretResponseData
- type WebhookService
- func (r *WebhookService) Deactivate(ctx context.Context, id string, opts ...option.RequestOption) (res *WebhookDeactivateResponse, err error)
- func (r *WebhookService) GetDeliveries(ctx context.Context, id string, query WebhookGetDeliveriesParams, ...) (res *WebhookGetDeliveriesResponse, err error)
- func (r *WebhookService) List(ctx context.Context, opts ...option.RequestOption) (res *WebhookListResponse, err error)
- func (r *WebhookService) ListEvents(ctx context.Context, opts ...option.RequestOption) (res *WebhookListEventsResponse, err error)
- func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *WebhookNewResponse, err error)
- func (r *WebhookService) RotateSecret(ctx context.Context, id string, opts ...option.RequestOption) (res *WebhookRotateSecretResponse, err error)
- func (r *WebhookService) Update(ctx context.Context, id string, body WebhookUpdateParams, ...) (res *WebhookUpdateResponse, err error)
- type WebhookUpdateParams
- type WebhookUpdateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (BILA_API_KEY, BILA_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type AccountDetailsDto ¶ added in v0.1.0
type AccountDetailsDto struct {
// Account holder name
AccountName string `json:"accountName" api:"required"`
// Account detail type
Type string `json:"type" api:"required"`
// Till number (for mobile money)
TillNumber string `json:"tillNumber"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AccountName respjson.Field
Type respjson.Field
TillNumber respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccountDetailsDto) RawJSON ¶ added in v0.1.0
func (r AccountDetailsDto) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountDetailsDto) UnmarshalJSON ¶ added in v0.1.0
func (r *AccountDetailsDto) UnmarshalJSON(data []byte) error
type AccountGetBalanceResponse ¶
type AccountGetBalanceResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data AccountGetBalanceResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccountGetBalanceResponse) RawJSON ¶
func (r AccountGetBalanceResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountGetBalanceResponse) UnmarshalJSON ¶
func (r *AccountGetBalanceResponse) UnmarshalJSON(data []byte) error
type AccountGetBalanceResponseData ¶
type AccountGetBalanceResponseData struct {
// Available balance
AvailableBalance string `json:"availableBalance" api:"required"`
// Currency code
Currency string `json:"currency" api:"required"`
// Ledger balance
LedgerBalance string `json:"ledgerBalance" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AvailableBalance respjson.Field
Currency respjson.Field
LedgerBalance respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccountGetBalanceResponseData) RawJSON ¶
func (r AccountGetBalanceResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountGetBalanceResponseData) UnmarshalJSON ¶
func (r *AccountGetBalanceResponseData) UnmarshalJSON(data []byte) error
type AccountGetResponse ¶
type AccountGetResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data AccountResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccountGetResponse) RawJSON ¶
func (r AccountGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountGetResponse) UnmarshalJSON ¶
func (r *AccountGetResponse) UnmarshalJSON(data []byte) error
type AccountListParams ¶
type AccountListParams struct {
// Page number (default: 1)
Page param.Opt[float64] `query:"page,omitzero" json:"-"`
// Items per page (default: 50)
PerPage param.Opt[float64] `query:"perPage,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AccountListParams) URLQuery ¶
func (r AccountListParams) URLQuery() (v url.Values, err error)
URLQuery serializes AccountListParams's query parameters as `url.Values`.
type AccountListResponse ¶
type AccountListResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data AccountListResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccountListResponse) RawJSON ¶
func (r AccountListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountListResponse) UnmarshalJSON ¶
func (r *AccountListResponse) UnmarshalJSON(data []byte) error
type AccountListResponseData ¶
type AccountListResponseData struct {
// List of accounts
Data []AccountResponseDto `json:"data" api:"required"`
// Pagination metadata
Meta shared.PaginationMetaDto `json:"meta" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccountListResponseData) RawJSON ¶
func (r AccountListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountListResponseData) UnmarshalJSON ¶
func (r *AccountListResponseData) UnmarshalJSON(data []byte) error
type AccountResponseDto ¶ added in v0.1.0
type AccountResponseDto struct {
// Account UUID
ID string `json:"id" api:"required" format:"uuid"`
// Account creation timestamp
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Currency code
Currency string `json:"currency" api:"required"`
// Account details
Details AccountDetailsDto `json:"details" api:"required"`
// Account status
//
// Any of "active", "inactive", "suspended".
Status AccountResponseDtoStatus `json:"status" api:"required"`
// Account type
//
// Any of "main", "sub", "virtual".
Type AccountResponseDtoType `json:"type" api:"required"`
// Available balance
AvailableBalance string `json:"availableBalance"`
// Ledger balance
LedgerBalance string `json:"ledgerBalance"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Currency respjson.Field
Details respjson.Field
Status respjson.Field
Type respjson.Field
AvailableBalance respjson.Field
LedgerBalance respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccountResponseDto) RawJSON ¶ added in v0.1.0
func (r AccountResponseDto) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountResponseDto) UnmarshalJSON ¶ added in v0.1.0
func (r *AccountResponseDto) UnmarshalJSON(data []byte) error
type AccountResponseDtoStatus ¶ added in v0.1.0
type AccountResponseDtoStatus string
Account status
const ( AccountResponseDtoStatusActive AccountResponseDtoStatus = "active" AccountResponseDtoStatusInactive AccountResponseDtoStatus = "inactive" AccountResponseDtoStatusSuspended AccountResponseDtoStatus = "suspended" )
type AccountResponseDtoType ¶ added in v0.1.0
type AccountResponseDtoType string
Account type
const ( AccountResponseDtoTypeMain AccountResponseDtoType = "main" AccountResponseDtoTypeSub AccountResponseDtoType = "sub" AccountResponseDtoTypeVirtual AccountResponseDtoType = "virtual" )
type AccountService ¶
type AccountService struct {
// contains filtered or unexported fields
}
Account/wallet management endpoints
AccountService contains methods and other services that help with interacting with the bila API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAccountService method instead.
func NewAccountService ¶
func NewAccountService(opts ...option.RequestOption) (r AccountService)
NewAccountService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AccountService) Get ¶
func (r *AccountService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *AccountGetResponse, err error)
Retrieve a single account by its UUID
func (*AccountService) GetBalance ¶
func (r *AccountService) GetBalance(ctx context.Context, id string, opts ...option.RequestOption) (res *AccountGetBalanceResponse, err error)
Retrieve the balance of a specific account
func (*AccountService) List ¶
func (r *AccountService) List(ctx context.Context, query AccountListParams, opts ...option.RequestOption) (res *AccountListResponse, err error)
Retrieve a paginated list of accounts/wallets for the authenticated merchant
type BankListParams ¶
type BankListParams struct {
// Filter banks by country code
Country param.Opt[string] `query:"country,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BankListParams) URLQuery ¶
func (r BankListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BankListParams's query parameters as `url.Values`.
type BankListResponse ¶
type BankListResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data []BankListResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BankListResponse) RawJSON ¶
func (r BankListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BankListResponse) UnmarshalJSON ¶
func (r *BankListResponse) UnmarshalJSON(data []byte) error
type BankListResponseData ¶
type BankListResponseData struct {
// Bank ID
ID string `json:"id" api:"required"`
// Bank code
Code string `json:"code" api:"required"`
// Country code
Country string `json:"country" api:"required"`
// Bank name
Name string `json:"name" api:"required"`
// Bank type
Type string `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Code respjson.Field
Country respjson.Field
Name respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BankListResponseData) RawJSON ¶
func (r BankListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*BankListResponseData) UnmarshalJSON ¶
func (r *BankListResponseData) UnmarshalJSON(data []byte) error
type BankService ¶
type BankService struct {
// contains filtered or unexported fields
}
Bank reference data endpoints
BankService contains methods and other services that help with interacting with the bila API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBankService method instead.
func NewBankService ¶
func NewBankService(opts ...option.RequestOption) (r BankService)
NewBankService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*BankService) List ¶
func (r *BankService) List(ctx context.Context, query BankListParams, opts ...option.RequestOption) (res *BankListResponse, err error)
Retrieve a list of all supported banks and financial institutions
type BilaCollectionCustomerDto ¶ added in v0.1.0
type BilaCollectionCustomerDto struct {
// Customer name
Name string `json:"name" api:"required"`
// Mobile money operator
Operator string `json:"operator" api:"required"`
// Customer phone number
Phone string `json:"phone" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Operator respjson.Field
Phone respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BilaCollectionCustomerDto) RawJSON ¶ added in v0.1.0
func (r BilaCollectionCustomerDto) RawJSON() string
Returns the unmodified JSON received from the API
func (*BilaCollectionCustomerDto) UnmarshalJSON ¶ added in v0.1.0
func (r *BilaCollectionCustomerDto) UnmarshalJSON(data []byte) error
type BilaCollectionResponseDto ¶ added in v0.1.0
type BilaCollectionResponseDto struct {
// Collection ID
ID string `json:"id" api:"required"`
// Collection amount
Amount float64 `json:"amount" api:"required"`
// Collection creation timestamp
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Currency code
Currency string `json:"currency" api:"required"`
// Customer details
Customer BilaCollectionCustomerDto `json:"customer" api:"required"`
// Client reference
Reference string `json:"reference" api:"required"`
// Collection status
//
// Any of "pending", "successful", "failed", "otp-required", "pay-offline".
Status BilaCollectionResponseDtoStatus `json:"status" api:"required"`
// Collection completion timestamp
CompletedAt time.Time `json:"completedAt" format:"date-time"`
// Who bears the transaction fee
//
// Any of "merchant", "customer".
FeeBearer BilaCollectionResponseDtoFeeBearer `json:"feeBearer"`
// Collection narration
Narration string `json:"narration"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Amount respjson.Field
CreatedAt respjson.Field
Currency respjson.Field
Customer respjson.Field
Reference respjson.Field
Status respjson.Field
CompletedAt respjson.Field
FeeBearer respjson.Field
Narration respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BilaCollectionResponseDto) RawJSON ¶ added in v0.1.0
func (r BilaCollectionResponseDto) RawJSON() string
Returns the unmodified JSON received from the API
func (*BilaCollectionResponseDto) UnmarshalJSON ¶ added in v0.1.0
func (r *BilaCollectionResponseDto) UnmarshalJSON(data []byte) error
type BilaCollectionResponseDtoFeeBearer ¶ added in v0.1.0
type BilaCollectionResponseDtoFeeBearer string
Who bears the transaction fee
const ( BilaCollectionResponseDtoFeeBearerMerchant BilaCollectionResponseDtoFeeBearer = "merchant" BilaCollectionResponseDtoFeeBearerCustomer BilaCollectionResponseDtoFeeBearer = "customer" )
type BilaCollectionResponseDtoStatus ¶ added in v0.1.0
type BilaCollectionResponseDtoStatus string
Collection status
const ( BilaCollectionResponseDtoStatusPending BilaCollectionResponseDtoStatus = "pending" BilaCollectionResponseDtoStatusSuccessful BilaCollectionResponseDtoStatus = "successful" BilaCollectionResponseDtoStatusFailed BilaCollectionResponseDtoStatus = "failed" BilaCollectionResponseDtoStatusOtpRequired BilaCollectionResponseDtoStatus = "otp-required" BilaCollectionResponseDtoStatusPayOffline BilaCollectionResponseDtoStatus = "pay-offline" )
type Client ¶
type Client struct {
// Account/wallet management endpoints
Accounts AccountService
// Transfer recipient management endpoints
TransferRecipients TransferRecipientService
// Payout/transfer operation endpoints
Transfers TransferService
// Payment collection operation endpoints
Collections CollectionService
// Transaction history endpoints
Transactions TransactionService
// Webhook configuration and delivery history
Webhooks WebhookService
// Bank reference data endpoints
Banks BankService
// Account resolution/verification endpoints
Resolve ResolveService
// contains filtered or unexported fields
}
Client creates a struct with services and top level methods that help with interacting with the bila API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (BILA_API_KEY, BILA_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type CollectionGetResponse ¶
type CollectionGetResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data BilaCollectionResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CollectionGetResponse) RawJSON ¶
func (r CollectionGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*CollectionGetResponse) UnmarshalJSON ¶
func (r *CollectionGetResponse) UnmarshalJSON(data []byte) error
type CollectionGetStatusByReferenceResponse ¶
type CollectionGetStatusByReferenceResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data BilaCollectionResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CollectionGetStatusByReferenceResponse) RawJSON ¶
func (r CollectionGetStatusByReferenceResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*CollectionGetStatusByReferenceResponse) UnmarshalJSON ¶
func (r *CollectionGetStatusByReferenceResponse) UnmarshalJSON(data []byte) error
type CollectionInitiateMobileMoneyCollectionParams ¶
type CollectionInitiateMobileMoneyCollectionParams struct {
// Collection amount
Amount float64 `json:"amount" api:"required"`
// Country code
//
// Any of "zm".
Country CollectionInitiateMobileMoneyCollectionParamsCountry `json:"country,omitzero" api:"required"`
// Mobile money operator
//
// Any of "airtel", "mtn", "zamtel".
Operator CollectionInitiateMobileMoneyCollectionParamsOperator `json:"operator,omitzero" api:"required"`
// Customer phone number
Phone string `json:"phone" api:"required"`
// Unique client reference
Reference string `json:"reference" api:"required"`
// Target wallet ID to credit
WalletID string `json:"walletId" api:"required" format:"uuid"`
// Customer name for the transaction record
CustomerName param.Opt[string] `json:"customerName,omitzero"`
// Collection narration
Narration param.Opt[string] `json:"narration,omitzero"`
// Who bears the transaction fee
//
// Any of "merchant", "customer".
Bearer CollectionInitiateMobileMoneyCollectionParamsBearer `json:"bearer,omitzero"`
// contains filtered or unexported fields
}
func (CollectionInitiateMobileMoneyCollectionParams) MarshalJSON ¶
func (r CollectionInitiateMobileMoneyCollectionParams) MarshalJSON() (data []byte, err error)
func (*CollectionInitiateMobileMoneyCollectionParams) UnmarshalJSON ¶
func (r *CollectionInitiateMobileMoneyCollectionParams) UnmarshalJSON(data []byte) error
type CollectionInitiateMobileMoneyCollectionParamsBearer ¶
type CollectionInitiateMobileMoneyCollectionParamsBearer string
Who bears the transaction fee
const ( CollectionInitiateMobileMoneyCollectionParamsBearerMerchant CollectionInitiateMobileMoneyCollectionParamsBearer = "merchant" CollectionInitiateMobileMoneyCollectionParamsBearerCustomer CollectionInitiateMobileMoneyCollectionParamsBearer = "customer" )
type CollectionInitiateMobileMoneyCollectionParamsCountry ¶
type CollectionInitiateMobileMoneyCollectionParamsCountry string
Country code
const (
CollectionInitiateMobileMoneyCollectionParamsCountryZm CollectionInitiateMobileMoneyCollectionParamsCountry = "zm"
)
type CollectionInitiateMobileMoneyCollectionParamsOperator ¶
type CollectionInitiateMobileMoneyCollectionParamsOperator string
Mobile money operator
const ( CollectionInitiateMobileMoneyCollectionParamsOperatorAirtel CollectionInitiateMobileMoneyCollectionParamsOperator = "airtel" CollectionInitiateMobileMoneyCollectionParamsOperatorMtn CollectionInitiateMobileMoneyCollectionParamsOperator = "mtn" CollectionInitiateMobileMoneyCollectionParamsOperatorZamtel CollectionInitiateMobileMoneyCollectionParamsOperator = "zamtel" )
type CollectionInitiateMobileMoneyCollectionResponse ¶
type CollectionInitiateMobileMoneyCollectionResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data BilaCollectionResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CollectionInitiateMobileMoneyCollectionResponse) RawJSON ¶
func (r CollectionInitiateMobileMoneyCollectionResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*CollectionInitiateMobileMoneyCollectionResponse) UnmarshalJSON ¶
func (r *CollectionInitiateMobileMoneyCollectionResponse) UnmarshalJSON(data []byte) error
type CollectionListParams ¶
type CollectionListParams struct {
// Filter by account ID
AccountID param.Opt[string] `query:"accountId,omitzero" json:"-"`
// Filter by end date (ISO 8601)
EndDate param.Opt[string] `query:"endDate,omitzero" json:"-"`
// Page number (default: 1)
Page param.Opt[float64] `query:"page,omitzero" json:"-"`
// Items per page (default: 50)
PerPage param.Opt[float64] `query:"perPage,omitzero" json:"-"`
// Filter by start date (ISO 8601)
StartDate param.Opt[string] `query:"startDate,omitzero" json:"-"`
// Filter by collection status
//
// Any of "pending", "successful", "failed", "otp-required", "pay-offline".
Status CollectionListParamsStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (CollectionListParams) URLQuery ¶
func (r CollectionListParams) URLQuery() (v url.Values, err error)
URLQuery serializes CollectionListParams's query parameters as `url.Values`.
type CollectionListParamsStatus ¶
type CollectionListParamsStatus string
Filter by collection status
const ( CollectionListParamsStatusPending CollectionListParamsStatus = "pending" CollectionListParamsStatusSuccessful CollectionListParamsStatus = "successful" CollectionListParamsStatusFailed CollectionListParamsStatus = "failed" CollectionListParamsStatusOtpRequired CollectionListParamsStatus = "otp-required" CollectionListParamsStatusPayOffline CollectionListParamsStatus = "pay-offline" )
type CollectionListResponse ¶
type CollectionListResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data CollectionListResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CollectionListResponse) RawJSON ¶
func (r CollectionListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*CollectionListResponse) UnmarshalJSON ¶
func (r *CollectionListResponse) UnmarshalJSON(data []byte) error
type CollectionListResponseData ¶
type CollectionListResponseData struct {
// List of collections
Data []BilaCollectionResponseDto `json:"data" api:"required"`
// Pagination metadata
Meta shared.PaginationMetaDto `json:"meta" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CollectionListResponseData) RawJSON ¶
func (r CollectionListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*CollectionListResponseData) UnmarshalJSON ¶
func (r *CollectionListResponseData) UnmarshalJSON(data []byte) error
type CollectionService ¶
type CollectionService struct {
// contains filtered or unexported fields
}
Payment collection operation endpoints
CollectionService contains methods and other services that help with interacting with the bila API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCollectionService method instead.
func NewCollectionService ¶
func NewCollectionService(opts ...option.RequestOption) (r CollectionService)
NewCollectionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*CollectionService) Get ¶
func (r *CollectionService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *CollectionGetResponse, err error)
Retrieve a single collection by its UUID
func (*CollectionService) GetStatusByReference ¶
func (r *CollectionService) GetStatusByReference(ctx context.Context, reference string, opts ...option.RequestOption) (res *CollectionGetStatusByReferenceResponse, err error)
Retrieve collection status by client reference
func (*CollectionService) InitiateMobileMoneyCollection ¶
func (r *CollectionService) InitiateMobileMoneyCollection(ctx context.Context, body CollectionInitiateMobileMoneyCollectionParams, opts ...option.RequestOption) (res *CollectionInitiateMobileMoneyCollectionResponse, err error)
Initiate a payment collection from a mobile money account. Creates a transaction record in your dashboard.
func (*CollectionService) List ¶
func (r *CollectionService) List(ctx context.Context, query CollectionListParams, opts ...option.RequestOption) (res *CollectionListResponse, err error)
Retrieve a paginated list of payment collections for the authenticated merchant
type PaginationMetaDto ¶ added in v0.1.0
type PaginationMetaDto = shared.PaginationMetaDto
This is an alias to an internal type.
type RecipientResponseDto ¶ added in v0.1.0
type RecipientResponseDto struct {
// Recipient UUID
ID string `json:"id" api:"required" format:"uuid"`
// Account holder name
AccountName string `json:"accountName" api:"required"`
// Country code
Country string `json:"country" api:"required"`
// Creation timestamp
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Transfer recipient type
//
// Any of "bank-account", "mobile-money".
Type RecipientResponseDtoType `json:"type" api:"required"`
// Bank account number (bank-account only)
AccountNumber string `json:"accountNumber"`
// Bank ID (bank-account only)
BankID string `json:"bankId"`
// Bank name (bank-account only)
BankName string `json:"bankName"`
// Mobile money operator (mobile-money only)
Operator string `json:"operator"`
// Phone number (mobile-money only)
Phone string `json:"phone"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AccountName respjson.Field
Country respjson.Field
CreatedAt respjson.Field
Type respjson.Field
AccountNumber respjson.Field
BankID respjson.Field
BankName respjson.Field
Operator respjson.Field
Phone respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RecipientResponseDto) RawJSON ¶ added in v0.1.0
func (r RecipientResponseDto) RawJSON() string
Returns the unmodified JSON received from the API
func (*RecipientResponseDto) UnmarshalJSON ¶ added in v0.1.0
func (r *RecipientResponseDto) UnmarshalJSON(data []byte) error
type RecipientResponseDtoType ¶ added in v0.1.0
type RecipientResponseDtoType string
Transfer recipient type
const ( RecipientResponseDtoTypeBankAccount RecipientResponseDtoType = "bank-account" RecipientResponseDtoTypeMobileMoney RecipientResponseDtoType = "mobile-money" )
type ResolveBankAccountParams ¶
type ResolveBankAccountParams struct {
// Bank account number
AccountNumber string `json:"accountNumber" api:"required"`
// Bank ID
BankID string `json:"bankId" api:"required"`
// Country code
//
// Any of "zm".
Country ResolveBankAccountParamsCountry `json:"country,omitzero"`
// contains filtered or unexported fields
}
func (ResolveBankAccountParams) MarshalJSON ¶
func (r ResolveBankAccountParams) MarshalJSON() (data []byte, err error)
func (*ResolveBankAccountParams) UnmarshalJSON ¶
func (r *ResolveBankAccountParams) UnmarshalJSON(data []byte) error
type ResolveBankAccountParamsCountry ¶
type ResolveBankAccountParamsCountry string
Country code
const (
ResolveBankAccountParamsCountryZm ResolveBankAccountParamsCountry = "zm"
)
type ResolveBankAccountResponse ¶
type ResolveBankAccountResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data ResolvedAccountResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResolveBankAccountResponse) RawJSON ¶
func (r ResolveBankAccountResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResolveBankAccountResponse) UnmarshalJSON ¶
func (r *ResolveBankAccountResponse) UnmarshalJSON(data []byte) error
type ResolveMobileMoneyParams ¶
type ResolveMobileMoneyParams struct {
// Country code
//
// Any of "zm".
Country ResolveMobileMoneyParamsCountry `json:"country,omitzero" api:"required"`
// Mobile money operator
//
// Any of "airtel", "mtn", "zamtel".
Operator ResolveMobileMoneyParamsOperator `json:"operator,omitzero" api:"required"`
// Mobile phone number
Phone string `json:"phone" api:"required"`
// contains filtered or unexported fields
}
func (ResolveMobileMoneyParams) MarshalJSON ¶
func (r ResolveMobileMoneyParams) MarshalJSON() (data []byte, err error)
func (*ResolveMobileMoneyParams) UnmarshalJSON ¶
func (r *ResolveMobileMoneyParams) UnmarshalJSON(data []byte) error
type ResolveMobileMoneyParamsCountry ¶
type ResolveMobileMoneyParamsCountry string
Country code
const (
ResolveMobileMoneyParamsCountryZm ResolveMobileMoneyParamsCountry = "zm"
)
type ResolveMobileMoneyParamsOperator ¶
type ResolveMobileMoneyParamsOperator string
Mobile money operator
const ( ResolveMobileMoneyParamsOperatorAirtel ResolveMobileMoneyParamsOperator = "airtel" ResolveMobileMoneyParamsOperatorMtn ResolveMobileMoneyParamsOperator = "mtn" ResolveMobileMoneyParamsOperatorZamtel ResolveMobileMoneyParamsOperator = "zamtel" )
type ResolveMobileMoneyResponse ¶
type ResolveMobileMoneyResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data ResolvedAccountResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResolveMobileMoneyResponse) RawJSON ¶
func (r ResolveMobileMoneyResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResolveMobileMoneyResponse) UnmarshalJSON ¶
func (r *ResolveMobileMoneyResponse) UnmarshalJSON(data []byte) error
type ResolveService ¶
type ResolveService struct {
// contains filtered or unexported fields
}
Account resolution/verification endpoints
ResolveService contains methods and other services that help with interacting with the bila API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewResolveService method instead.
func NewResolveService ¶
func NewResolveService(opts ...option.RequestOption) (r ResolveService)
NewResolveService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ResolveService) BankAccount ¶
func (r *ResolveService) BankAccount(ctx context.Context, body ResolveBankAccountParams, opts ...option.RequestOption) (res *ResolveBankAccountResponse, err error)
Verify and retrieve bank account holder details
func (*ResolveService) MobileMoney ¶
func (r *ResolveService) MobileMoney(ctx context.Context, body ResolveMobileMoneyParams, opts ...option.RequestOption) (res *ResolveMobileMoneyResponse, err error)
Verify and retrieve mobile money account holder details
type ResolvedAccountResponseDto ¶ added in v0.1.0
type ResolvedAccountResponseDto struct {
// Account holder name
AccountName string `json:"accountName" api:"required"`
// Country code
Country string `json:"country" api:"required"`
// Bank account number
AccountNumber string `json:"accountNumber"`
// Bank ID
BankID string `json:"bankId"`
// Bank name
BankName string `json:"bankName"`
// Mobile money operator
Operator string `json:"operator"`
// Phone number
Phone string `json:"phone"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AccountName respjson.Field
Country respjson.Field
AccountNumber respjson.Field
BankID respjson.Field
BankName respjson.Field
Operator respjson.Field
Phone respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResolvedAccountResponseDto) RawJSON ¶ added in v0.1.0
func (r ResolvedAccountResponseDto) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResolvedAccountResponseDto) UnmarshalJSON ¶ added in v0.1.0
func (r *ResolvedAccountResponseDto) UnmarshalJSON(data []byte) error
type TransactionGetResponse ¶
type TransactionGetResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data TransactionResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransactionGetResponse) RawJSON ¶
func (r TransactionGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransactionGetResponse) UnmarshalJSON ¶
func (r *TransactionGetResponse) UnmarshalJSON(data []byte) error
type TransactionListParams ¶
type TransactionListParams struct {
// Filter by account ID
AccountID param.Opt[string] `query:"accountId,omitzero" json:"-"`
// Filter by end date (ISO 8601)
EndDate param.Opt[string] `query:"endDate,omitzero" json:"-"`
// Page number (default: 1)
Page param.Opt[float64] `query:"page,omitzero" json:"-"`
// Items per page (default: 50)
PerPage param.Opt[float64] `query:"perPage,omitzero" json:"-"`
// Filter by start date (ISO 8601)
StartDate param.Opt[string] `query:"startDate,omitzero" json:"-"`
// Filter by transaction type
//
// Any of "credit", "debit".
Type TransactionListParamsType `query:"type,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TransactionListParams) URLQuery ¶
func (r TransactionListParams) URLQuery() (v url.Values, err error)
URLQuery serializes TransactionListParams's query parameters as `url.Values`.
type TransactionListParamsType ¶
type TransactionListParamsType string
Filter by transaction type
const ( TransactionListParamsTypeCredit TransactionListParamsType = "credit" TransactionListParamsTypeDebit TransactionListParamsType = "debit" )
type TransactionListResponse ¶
type TransactionListResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data TransactionListResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransactionListResponse) RawJSON ¶
func (r TransactionListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransactionListResponse) UnmarshalJSON ¶
func (r *TransactionListResponse) UnmarshalJSON(data []byte) error
type TransactionListResponseData ¶
type TransactionListResponseData struct {
// List of transactions
Data []TransactionResponseDto `json:"data" api:"required"`
// Pagination metadata
Meta shared.PaginationMetaDto `json:"meta" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransactionListResponseData) RawJSON ¶
func (r TransactionListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransactionListResponseData) UnmarshalJSON ¶
func (r *TransactionListResponseData) UnmarshalJSON(data []byte) error
type TransactionResponseDto ¶ added in v0.1.0
type TransactionResponseDto struct {
// Transaction UUID
ID string `json:"id" api:"required"`
// Account / wallet ID
AccountID string `json:"accountId" api:"required"`
// Transaction amount
Amount float64 `json:"amount" api:"required"`
// Balance after transaction
BalanceAfter float64 `json:"balanceAfter" api:"required"`
// Balance before transaction
BalanceBefore float64 `json:"balanceBefore" api:"required"`
// Transaction timestamp
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Currency code
Currency string `json:"currency" api:"required"`
// Transaction status
//
// Any of "pending", "successful", "failed", "cancelled".
Status TransactionResponseDtoStatus `json:"status" api:"required"`
// Transaction type
//
// Any of "credit", "debit".
Type TransactionResponseDtoType `json:"type" api:"required"`
// Transaction description
Description string `json:"description"`
// Client reference
Reference string `json:"reference"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AccountID respjson.Field
Amount respjson.Field
BalanceAfter respjson.Field
BalanceBefore respjson.Field
CreatedAt respjson.Field
Currency respjson.Field
Status respjson.Field
Type respjson.Field
Description respjson.Field
Reference respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransactionResponseDto) RawJSON ¶ added in v0.1.0
func (r TransactionResponseDto) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransactionResponseDto) UnmarshalJSON ¶ added in v0.1.0
func (r *TransactionResponseDto) UnmarshalJSON(data []byte) error
type TransactionResponseDtoStatus ¶ added in v0.1.0
type TransactionResponseDtoStatus string
Transaction status
const ( TransactionResponseDtoStatusPending TransactionResponseDtoStatus = "pending" TransactionResponseDtoStatusSuccessful TransactionResponseDtoStatus = "successful" TransactionResponseDtoStatusFailed TransactionResponseDtoStatus = "failed" TransactionResponseDtoStatusCancelled TransactionResponseDtoStatus = "cancelled" )
type TransactionResponseDtoType ¶ added in v0.1.0
type TransactionResponseDtoType string
Transaction type
const ( TransactionResponseDtoTypeCredit TransactionResponseDtoType = "credit" TransactionResponseDtoTypeDebit TransactionResponseDtoType = "debit" )
type TransactionService ¶
type TransactionService struct {
// contains filtered or unexported fields
}
Transaction history endpoints
TransactionService contains methods and other services that help with interacting with the bila API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTransactionService method instead.
func NewTransactionService ¶
func NewTransactionService(opts ...option.RequestOption) (r TransactionService)
NewTransactionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TransactionService) Get ¶
func (r *TransactionService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *TransactionGetResponse, err error)
Retrieve a single transaction by its UUID
func (*TransactionService) List ¶
func (r *TransactionService) List(ctx context.Context, query TransactionListParams, opts ...option.RequestOption) (res *TransactionListResponse, err error)
Retrieve a paginated list of transactions
type TransferGetResponse ¶
type TransferGetResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data TransferResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransferGetResponse) RawJSON ¶
func (r TransferGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferGetResponse) UnmarshalJSON ¶
func (r *TransferGetResponse) UnmarshalJSON(data []byte) error
type TransferGetStatusByReferenceResponse ¶
type TransferGetStatusByReferenceResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data TransferResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransferGetStatusByReferenceResponse) RawJSON ¶
func (r TransferGetStatusByReferenceResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferGetStatusByReferenceResponse) UnmarshalJSON ¶
func (r *TransferGetStatusByReferenceResponse) UnmarshalJSON(data []byte) error
type TransferInitiateBankTransferParams ¶
type TransferInitiateBankTransferParams struct {
// Source account UUID
AccountID string `json:"accountId" api:"required" format:"uuid"`
// Transfer amount
Amount float64 `json:"amount" api:"required"`
// Unique client reference (alphanumeric, dots, underscores, hyphens)
Reference string `json:"reference" api:"required"`
// Bank account number (required if no transferRecipientId)
AccountNumber param.Opt[string] `json:"accountNumber,omitzero"`
// Bank ID (required if no transferRecipientId)
BankID param.Opt[string] `json:"bankId,omitzero"`
// Transfer narration
Narration param.Opt[string] `json:"narration,omitzero"`
// Recipient name for the transaction record
RecipientName param.Opt[string] `json:"recipientName,omitzero"`
// Transfer recipient UUID (use this OR accountNumber+bankId)
TransferRecipientID param.Opt[string] `json:"transferRecipientId,omitzero" format:"uuid"`
// Source wallet ID to debit (optional, uses main wallet if not specified)
WalletID param.Opt[string] `json:"walletId,omitzero"`
// Country code
//
// Any of "zm".
Country TransferInitiateBankTransferParamsCountry `json:"country,omitzero"`
// contains filtered or unexported fields
}
func (TransferInitiateBankTransferParams) MarshalJSON ¶
func (r TransferInitiateBankTransferParams) MarshalJSON() (data []byte, err error)
func (*TransferInitiateBankTransferParams) UnmarshalJSON ¶
func (r *TransferInitiateBankTransferParams) UnmarshalJSON(data []byte) error
type TransferInitiateBankTransferParamsCountry ¶
type TransferInitiateBankTransferParamsCountry string
Country code
const (
TransferInitiateBankTransferParamsCountryZm TransferInitiateBankTransferParamsCountry = "zm"
)
type TransferInitiateBankTransferResponse ¶
type TransferInitiateBankTransferResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data TransferResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransferInitiateBankTransferResponse) RawJSON ¶
func (r TransferInitiateBankTransferResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferInitiateBankTransferResponse) UnmarshalJSON ¶
func (r *TransferInitiateBankTransferResponse) UnmarshalJSON(data []byte) error
type TransferInitiateMobileMoneyTransferParams ¶
type TransferInitiateMobileMoneyTransferParams struct {
// Transfer amount
Amount float64 `json:"amount" api:"required"`
// Country code
//
// Any of "zm".
Country TransferInitiateMobileMoneyTransferParamsCountry `json:"country,omitzero" api:"required"`
// Mobile money operator
//
// Any of "airtel", "mtn", "zamtel".
Operator TransferInitiateMobileMoneyTransferParamsOperator `json:"operator,omitzero" api:"required"`
// Recipient phone number
Phone string `json:"phone" api:"required"`
// Unique client reference
Reference string `json:"reference" api:"required"`
// Transfer narration
Narration param.Opt[string] `json:"narration,omitzero"`
// Recipient name for the transaction record
RecipientName param.Opt[string] `json:"recipientName,omitzero"`
// Source wallet ID to debit (defaults to main wallet if omitted)
WalletID param.Opt[string] `json:"walletId,omitzero" format:"uuid"`
// contains filtered or unexported fields
}
func (TransferInitiateMobileMoneyTransferParams) MarshalJSON ¶
func (r TransferInitiateMobileMoneyTransferParams) MarshalJSON() (data []byte, err error)
func (*TransferInitiateMobileMoneyTransferParams) UnmarshalJSON ¶
func (r *TransferInitiateMobileMoneyTransferParams) UnmarshalJSON(data []byte) error
type TransferInitiateMobileMoneyTransferParamsCountry ¶
type TransferInitiateMobileMoneyTransferParamsCountry string
Country code
const (
TransferInitiateMobileMoneyTransferParamsCountryZm TransferInitiateMobileMoneyTransferParamsCountry = "zm"
)
type TransferInitiateMobileMoneyTransferParamsOperator ¶
type TransferInitiateMobileMoneyTransferParamsOperator string
Mobile money operator
const ( TransferInitiateMobileMoneyTransferParamsOperatorAirtel TransferInitiateMobileMoneyTransferParamsOperator = "airtel" TransferInitiateMobileMoneyTransferParamsOperatorMtn TransferInitiateMobileMoneyTransferParamsOperator = "mtn" TransferInitiateMobileMoneyTransferParamsOperatorZamtel TransferInitiateMobileMoneyTransferParamsOperator = "zamtel" )
type TransferInitiateMobileMoneyTransferResponse ¶
type TransferInitiateMobileMoneyTransferResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data TransferResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransferInitiateMobileMoneyTransferResponse) RawJSON ¶
func (r TransferInitiateMobileMoneyTransferResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferInitiateMobileMoneyTransferResponse) UnmarshalJSON ¶
func (r *TransferInitiateMobileMoneyTransferResponse) UnmarshalJSON(data []byte) error
type TransferListParams ¶
type TransferListParams struct {
// Filter by account ID
AccountID param.Opt[string] `query:"accountId,omitzero" json:"-"`
// Filter by end date (ISO 8601)
EndDate param.Opt[string] `query:"endDate,omitzero" json:"-"`
// Page number (default: 1)
Page param.Opt[float64] `query:"page,omitzero" json:"-"`
// Items per page (default: 50)
PerPage param.Opt[float64] `query:"perPage,omitzero" json:"-"`
// Filter by start date (ISO 8601)
StartDate param.Opt[string] `query:"startDate,omitzero" json:"-"`
// Filter by transfer status
//
// Any of "pending", "successful", "failed".
Status TransferListParamsStatus `query:"status,omitzero" json:"-"`
// Filter by transfer type
//
// Any of "bank-account", "mobile-money".
Type TransferListParamsType `query:"type,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TransferListParams) URLQuery ¶
func (r TransferListParams) URLQuery() (v url.Values, err error)
URLQuery serializes TransferListParams's query parameters as `url.Values`.
type TransferListParamsStatus ¶
type TransferListParamsStatus string
Filter by transfer status
const ( TransferListParamsStatusPending TransferListParamsStatus = "pending" TransferListParamsStatusSuccessful TransferListParamsStatus = "successful" TransferListParamsStatusFailed TransferListParamsStatus = "failed" )
type TransferListParamsType ¶
type TransferListParamsType string
Filter by transfer type
const ( TransferListParamsTypeBankAccount TransferListParamsType = "bank-account" TransferListParamsTypeMobileMoney TransferListParamsType = "mobile-money" )
type TransferListResponse ¶
type TransferListResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data TransferListResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransferListResponse) RawJSON ¶
func (r TransferListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferListResponse) UnmarshalJSON ¶
func (r *TransferListResponse) UnmarshalJSON(data []byte) error
type TransferListResponseData ¶
type TransferListResponseData struct {
// List of transfers
Data []TransferResponseDto `json:"data" api:"required"`
// Pagination metadata
Meta shared.PaginationMetaDto `json:"meta" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransferListResponseData) RawJSON ¶
func (r TransferListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferListResponseData) UnmarshalJSON ¶
func (r *TransferListResponseData) UnmarshalJSON(data []byte) error
type TransferRecipientDto ¶ added in v0.1.0
type TransferRecipientDto struct {
// Account holder / recipient name
AccountName string `json:"accountName" api:"required"`
// Bank account number (bank-account only)
AccountNumber string `json:"accountNumber"`
// Bank name (bank-account only)
BankName string `json:"bankName"`
// Mobile money operator (mobile-money only)
Operator string `json:"operator"`
// Phone number (mobile-money only)
Phone string `json:"phone"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AccountName respjson.Field
AccountNumber respjson.Field
BankName respjson.Field
Operator respjson.Field
Phone respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransferRecipientDto) RawJSON ¶ added in v0.1.0
func (r TransferRecipientDto) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferRecipientDto) UnmarshalJSON ¶ added in v0.1.0
func (r *TransferRecipientDto) UnmarshalJSON(data []byte) error
type TransferRecipientGetResponse ¶
type TransferRecipientGetResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data RecipientResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransferRecipientGetResponse) RawJSON ¶
func (r TransferRecipientGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferRecipientGetResponse) UnmarshalJSON ¶
func (r *TransferRecipientGetResponse) UnmarshalJSON(data []byte) error
type TransferRecipientListParams ¶
type TransferRecipientListParams struct {
// Page number (default: 1)
Page param.Opt[float64] `query:"page,omitzero" json:"-"`
// Items per page (default: 50)
PerPage param.Opt[float64] `query:"perPage,omitzero" json:"-"`
// Filter by recipient type
//
// Any of "bank-account", "mobile-money".
Type TransferRecipientListParamsType `query:"type,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TransferRecipientListParams) URLQuery ¶
func (r TransferRecipientListParams) URLQuery() (v url.Values, err error)
URLQuery serializes TransferRecipientListParams's query parameters as `url.Values`.
type TransferRecipientListParamsType ¶
type TransferRecipientListParamsType string
Filter by recipient type
const ( TransferRecipientListParamsTypeBankAccount TransferRecipientListParamsType = "bank-account" TransferRecipientListParamsTypeMobileMoney TransferRecipientListParamsType = "mobile-money" )
type TransferRecipientListResponse ¶
type TransferRecipientListResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data TransferRecipientListResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransferRecipientListResponse) RawJSON ¶
func (r TransferRecipientListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferRecipientListResponse) UnmarshalJSON ¶
func (r *TransferRecipientListResponse) UnmarshalJSON(data []byte) error
type TransferRecipientListResponseData ¶
type TransferRecipientListResponseData struct {
// List of recipients
Data []RecipientResponseDto `json:"data" api:"required"`
// Pagination metadata
Meta shared.PaginationMetaDto `json:"meta" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransferRecipientListResponseData) RawJSON ¶
func (r TransferRecipientListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferRecipientListResponseData) UnmarshalJSON ¶
func (r *TransferRecipientListResponseData) UnmarshalJSON(data []byte) error
type TransferRecipientNewBankAccountParams ¶
type TransferRecipientNewBankAccountParams struct {
// Bank account number
AccountNumber string `json:"accountNumber" api:"required"`
// Bank ID
BankID string `json:"bankId" api:"required"`
// Account holder name (optional, will be resolved)
AccountName param.Opt[string] `json:"accountName,omitzero"`
// Country code
//
// Any of "zm".
Country TransferRecipientNewBankAccountParamsCountry `json:"country,omitzero"`
// contains filtered or unexported fields
}
func (TransferRecipientNewBankAccountParams) MarshalJSON ¶
func (r TransferRecipientNewBankAccountParams) MarshalJSON() (data []byte, err error)
func (*TransferRecipientNewBankAccountParams) UnmarshalJSON ¶
func (r *TransferRecipientNewBankAccountParams) UnmarshalJSON(data []byte) error
type TransferRecipientNewBankAccountParamsCountry ¶
type TransferRecipientNewBankAccountParamsCountry string
Country code
const (
TransferRecipientNewBankAccountParamsCountryZm TransferRecipientNewBankAccountParamsCountry = "zm"
)
type TransferRecipientNewBankAccountResponse ¶
type TransferRecipientNewBankAccountResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data RecipientResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransferRecipientNewBankAccountResponse) RawJSON ¶
func (r TransferRecipientNewBankAccountResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferRecipientNewBankAccountResponse) UnmarshalJSON ¶
func (r *TransferRecipientNewBankAccountResponse) UnmarshalJSON(data []byte) error
type TransferRecipientNewMobileMoneyParams ¶
type TransferRecipientNewMobileMoneyParams struct {
// Country code
//
// Any of "zm".
Country TransferRecipientNewMobileMoneyParamsCountry `json:"country,omitzero" api:"required"`
// Mobile money operator
//
// Any of "airtel", "mtn", "zamtel".
Operator TransferRecipientNewMobileMoneyParamsOperator `json:"operator,omitzero" api:"required"`
// Mobile phone number
Phone string `json:"phone" api:"required"`
// Account holder name (optional, will be resolved)
AccountName param.Opt[string] `json:"accountName,omitzero"`
// contains filtered or unexported fields
}
func (TransferRecipientNewMobileMoneyParams) MarshalJSON ¶
func (r TransferRecipientNewMobileMoneyParams) MarshalJSON() (data []byte, err error)
func (*TransferRecipientNewMobileMoneyParams) UnmarshalJSON ¶
func (r *TransferRecipientNewMobileMoneyParams) UnmarshalJSON(data []byte) error
type TransferRecipientNewMobileMoneyParamsCountry ¶
type TransferRecipientNewMobileMoneyParamsCountry string
Country code
const (
TransferRecipientNewMobileMoneyParamsCountryZm TransferRecipientNewMobileMoneyParamsCountry = "zm"
)
type TransferRecipientNewMobileMoneyParamsOperator ¶
type TransferRecipientNewMobileMoneyParamsOperator string
Mobile money operator
const ( TransferRecipientNewMobileMoneyParamsOperatorAirtel TransferRecipientNewMobileMoneyParamsOperator = "airtel" TransferRecipientNewMobileMoneyParamsOperatorMtn TransferRecipientNewMobileMoneyParamsOperator = "mtn" TransferRecipientNewMobileMoneyParamsOperatorZamtel TransferRecipientNewMobileMoneyParamsOperator = "zamtel" )
type TransferRecipientNewMobileMoneyResponse ¶
type TransferRecipientNewMobileMoneyResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data RecipientResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransferRecipientNewMobileMoneyResponse) RawJSON ¶
func (r TransferRecipientNewMobileMoneyResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferRecipientNewMobileMoneyResponse) UnmarshalJSON ¶
func (r *TransferRecipientNewMobileMoneyResponse) UnmarshalJSON(data []byte) error
type TransferRecipientService ¶
type TransferRecipientService struct {
// contains filtered or unexported fields
}
Transfer recipient management endpoints
TransferRecipientService contains methods and other services that help with interacting with the bila API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTransferRecipientService method instead.
func NewTransferRecipientService ¶
func NewTransferRecipientService(opts ...option.RequestOption) (r TransferRecipientService)
NewTransferRecipientService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TransferRecipientService) Get ¶
func (r *TransferRecipientService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *TransferRecipientGetResponse, err error)
Retrieve a single transfer recipient by its UUID
func (*TransferRecipientService) List ¶
func (r *TransferRecipientService) List(ctx context.Context, query TransferRecipientListParams, opts ...option.RequestOption) (res *TransferRecipientListResponse, err error)
Retrieve a paginated list of saved transfer recipients
func (*TransferRecipientService) NewBankAccount ¶
func (r *TransferRecipientService) NewBankAccount(ctx context.Context, body TransferRecipientNewBankAccountParams, opts ...option.RequestOption) (res *TransferRecipientNewBankAccountResponse, err error)
Create a new bank account transfer recipient
func (*TransferRecipientService) NewMobileMoney ¶
func (r *TransferRecipientService) NewMobileMoney(ctx context.Context, body TransferRecipientNewMobileMoneyParams, opts ...option.RequestOption) (res *TransferRecipientNewMobileMoneyResponse, err error)
Create a new mobile money transfer recipient
type TransferResponseDto ¶ added in v0.1.0
type TransferResponseDto struct {
// Transfer ID
ID string `json:"id" api:"required"`
// Transfer amount
Amount float64 `json:"amount" api:"required"`
// Creation timestamp (from Payment)
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Currency code
Currency string `json:"currency" api:"required"`
// Recipient details
Recipient TransferRecipientDto `json:"recipient" api:"required"`
// Client reference
Reference string `json:"reference" api:"required"`
// Transfer status
//
// Any of "pending", "successful", "failed".
Status TransferResponseDtoStatus `json:"status" api:"required"`
// Transfer recipient type
//
// Any of "bank-account", "mobile-money".
Type TransferResponseDtoType `json:"type" api:"required"`
// Completion timestamp (from Payment.processedAt)
CompletedAt time.Time `json:"completedAt" format:"date-time"`
// Transfer narration
Narration string `json:"narration"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Amount respjson.Field
CreatedAt respjson.Field
Currency respjson.Field
Recipient respjson.Field
Reference respjson.Field
Status respjson.Field
Type respjson.Field
CompletedAt respjson.Field
Narration respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TransferResponseDto) RawJSON ¶ added in v0.1.0
func (r TransferResponseDto) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferResponseDto) UnmarshalJSON ¶ added in v0.1.0
func (r *TransferResponseDto) UnmarshalJSON(data []byte) error
type TransferResponseDtoStatus ¶ added in v0.1.0
type TransferResponseDtoStatus string
Transfer status
const ( TransferResponseDtoStatusPending TransferResponseDtoStatus = "pending" TransferResponseDtoStatusSuccessful TransferResponseDtoStatus = "successful" TransferResponseDtoStatusFailed TransferResponseDtoStatus = "failed" )
type TransferResponseDtoType ¶ added in v0.1.0
type TransferResponseDtoType string
Transfer recipient type
const ( TransferResponseDtoTypeBankAccount TransferResponseDtoType = "bank-account" TransferResponseDtoTypeMobileMoney TransferResponseDtoType = "mobile-money" )
type TransferService ¶
type TransferService struct {
// contains filtered or unexported fields
}
Payout/transfer operation endpoints
TransferService contains methods and other services that help with interacting with the bila API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTransferService method instead.
func NewTransferService ¶
func NewTransferService(opts ...option.RequestOption) (r TransferService)
NewTransferService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TransferService) Get ¶
func (r *TransferService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *TransferGetResponse, err error)
Retrieve a single transfer by its UUID
func (*TransferService) GetStatusByReference ¶
func (r *TransferService) GetStatusByReference(ctx context.Context, reference string, opts ...option.RequestOption) (res *TransferGetStatusByReferenceResponse, err error)
Retrieve transfer status by client reference
func (*TransferService) InitiateBankTransfer ¶
func (r *TransferService) InitiateBankTransfer(ctx context.Context, body TransferInitiateBankTransferParams, opts ...option.RequestOption) (res *TransferInitiateBankTransferResponse, err error)
Initiate a transfer to a bank account. Creates a transaction record in your dashboard.
func (*TransferService) InitiateMobileMoneyTransfer ¶
func (r *TransferService) InitiateMobileMoneyTransfer(ctx context.Context, body TransferInitiateMobileMoneyTransferParams, opts ...option.RequestOption) (res *TransferInitiateMobileMoneyTransferResponse, err error)
Initiate a transfer to a mobile money account. Creates a transaction record in your dashboard.
func (*TransferService) List ¶
func (r *TransferService) List(ctx context.Context, query TransferListParams, opts ...option.RequestOption) (res *TransferListResponse, err error)
Retrieve a paginated list of transfers/payouts for the authenticated merchant
type WebhookConfigResponseDto ¶ added in v0.1.0
type WebhookConfigResponseDto struct {
// Webhook config UUID
ID string `json:"id" api:"required" format:"uuid"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Subscribed event types
Events []string `json:"events" api:"required"`
// Whether the webhook is active
IsActive bool `json:"isActive" api:"required"`
// Merchant UUID
MerchantID string `json:"merchantId" api:"required" format:"uuid"`
// Signing secret; plaintext only on create/rotate-secret, otherwise masked
Secret string `json:"secret" api:"required"`
UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
// Webhook endpoint URL
URL string `json:"url" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Events respjson.Field
IsActive respjson.Field
MerchantID respjson.Field
Secret respjson.Field
UpdatedAt respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookConfigResponseDto) RawJSON ¶ added in v0.1.0
func (r WebhookConfigResponseDto) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookConfigResponseDto) UnmarshalJSON ¶ added in v0.1.0
func (r *WebhookConfigResponseDto) UnmarshalJSON(data []byte) error
type WebhookDeactivateResponse ¶ added in v0.1.0
type WebhookDeactivateResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookDeactivateResponse) RawJSON ¶ added in v0.1.0
func (r WebhookDeactivateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookDeactivateResponse) UnmarshalJSON ¶ added in v0.1.0
func (r *WebhookDeactivateResponse) UnmarshalJSON(data []byte) error
type WebhookGetDeliveriesParams ¶
type WebhookGetDeliveriesParams struct {
// ISO 8601 end of createdAt range (inclusive)
EndDate param.Opt[string] `query:"endDate,omitzero" json:"-"`
// Filter by event type
EventType param.Opt[string] `query:"eventType,omitzero" json:"-"`
// Page number
Page param.Opt[float64] `query:"page,omitzero" json:"-"`
// Items per page
PerPage param.Opt[float64] `query:"perPage,omitzero" json:"-"`
// ISO 8601 start of createdAt range (inclusive)
StartDate param.Opt[string] `query:"startDate,omitzero" json:"-"`
// Filter by status (QUEUED, DELIVERED, FAILED, RETRYING)
Status param.Opt[string] `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (WebhookGetDeliveriesParams) URLQuery ¶
func (r WebhookGetDeliveriesParams) URLQuery() (v url.Values, err error)
URLQuery serializes WebhookGetDeliveriesParams's query parameters as `url.Values`.
type WebhookGetDeliveriesResponse ¶
type WebhookGetDeliveriesResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data WebhookGetDeliveriesResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookGetDeliveriesResponse) RawJSON ¶
func (r WebhookGetDeliveriesResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookGetDeliveriesResponse) UnmarshalJSON ¶
func (r *WebhookGetDeliveriesResponse) UnmarshalJSON(data []byte) error
type WebhookGetDeliveriesResponseData ¶
type WebhookGetDeliveriesResponseData struct {
// List of webhook deliveries
Data []WebhookGetDeliveriesResponseDataData `json:"data" api:"required"`
// Pagination metadata
Meta shared.PaginationMetaDto `json:"meta" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookGetDeliveriesResponseData) RawJSON ¶
func (r WebhookGetDeliveriesResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookGetDeliveriesResponseData) UnmarshalJSON ¶
func (r *WebhookGetDeliveriesResponseData) UnmarshalJSON(data []byte) error
type WebhookGetDeliveriesResponseDataData ¶
type WebhookGetDeliveriesResponseDataData struct {
// Delivery UUID
ID string `json:"id" api:"required" format:"uuid"`
// Number of delivery attempts
Attempts float64 `json:"attempts" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// When the delivery succeeded
DeliveredAt time.Time `json:"deliveredAt" api:"required" format:"date-time"`
// Webhook event type
EventType string `json:"eventType" api:"required"`
// When the delivery permanently failed
FailedAt time.Time `json:"failedAt" api:"required" format:"date-time"`
// Maximum delivery attempts
MaxAttempts float64 `json:"maxAttempts" api:"required"`
// When the next retry is scheduled
NextRetryAt time.Time `json:"nextRetryAt" api:"required" format:"date-time"`
// Event payload JSON as stored for delivery
Payload map[string]any `json:"payload" api:"required"`
// Response body from the merchant endpoint (truncated)
ResponseBody string `json:"responseBody" api:"required"`
// HTTP status code from the merchant endpoint
ResponseStatus float64 `json:"responseStatus" api:"required"`
// Delivery status
//
// Any of "QUEUED", "DELIVERED", "FAILED", "RETRYING".
Status string `json:"status" api:"required"`
// Webhook config UUID
WebhookConfigID string `json:"webhookConfigId" api:"required" format:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Attempts respjson.Field
CreatedAt respjson.Field
DeliveredAt respjson.Field
EventType respjson.Field
FailedAt respjson.Field
MaxAttempts respjson.Field
NextRetryAt respjson.Field
Payload respjson.Field
ResponseBody respjson.Field
ResponseStatus respjson.Field
Status respjson.Field
WebhookConfigID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookGetDeliveriesResponseDataData) RawJSON ¶
func (r WebhookGetDeliveriesResponseDataData) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookGetDeliveriesResponseDataData) UnmarshalJSON ¶
func (r *WebhookGetDeliveriesResponseDataData) UnmarshalJSON(data []byte) error
type WebhookListEventsResponse ¶
type WebhookListEventsResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data []string `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookListEventsResponse) RawJSON ¶
func (r WebhookListEventsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookListEventsResponse) UnmarshalJSON ¶
func (r *WebhookListEventsResponse) UnmarshalJSON(data []byte) error
type WebhookListResponse ¶
type WebhookListResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data []WebhookConfigResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookListResponse) RawJSON ¶
func (r WebhookListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookListResponse) UnmarshalJSON ¶
func (r *WebhookListResponse) UnmarshalJSON(data []byte) error
type WebhookNewParams ¶
type WebhookNewParams struct {
// Event types to subscribe to
//
// Any of "order.created", "order.paid", "order.cancelled", "stock.low",
// "payment.created", "payment.completed", "payment.failed", "collection.pending",
// "collection.completed", "collection.failed", "withdrawal.created",
// "withdrawal.completed", "withdrawal.failed", "transaction.updated",
// "transfer.pending", "transfer.completed", "transfer.failed",
// "settlement.completed".
Events []string `json:"events,omitzero" api:"required"`
// Webhook endpoint URL
URL string `json:"url" api:"required"`
// contains filtered or unexported fields
}
func (WebhookNewParams) MarshalJSON ¶
func (r WebhookNewParams) MarshalJSON() (data []byte, err error)
func (*WebhookNewParams) UnmarshalJSON ¶
func (r *WebhookNewParams) UnmarshalJSON(data []byte) error
type WebhookNewResponse ¶
type WebhookNewResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data WebhookConfigResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookNewResponse) RawJSON ¶
func (r WebhookNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookNewResponse) UnmarshalJSON ¶
func (r *WebhookNewResponse) UnmarshalJSON(data []byte) error
type WebhookRotateSecretResponse ¶
type WebhookRotateSecretResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data WebhookRotateSecretResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookRotateSecretResponse) RawJSON ¶
func (r WebhookRotateSecretResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookRotateSecretResponse) UnmarshalJSON ¶
func (r *WebhookRotateSecretResponse) UnmarshalJSON(data []byte) error
type WebhookRotateSecretResponseData ¶
type WebhookRotateSecretResponseData struct {
// New signing secret (64-character hex, shown once)
Secret string `json:"secret" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Secret respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookRotateSecretResponseData) RawJSON ¶
func (r WebhookRotateSecretResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookRotateSecretResponseData) UnmarshalJSON ¶
func (r *WebhookRotateSecretResponseData) UnmarshalJSON(data []byte) error
type WebhookService ¶
type WebhookService struct {
// contains filtered or unexported fields
}
Webhook configuration and delivery history
WebhookService contains methods and other services that help with interacting with the bila API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWebhookService method instead.
func NewWebhookService ¶
func NewWebhookService(opts ...option.RequestOption) (r WebhookService)
NewWebhookService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WebhookService) Deactivate ¶
func (r *WebhookService) Deactivate(ctx context.Context, id string, opts ...option.RequestOption) (res *WebhookDeactivateResponse, err error)
Deactivate a webhook
func (*WebhookService) GetDeliveries ¶
func (r *WebhookService) GetDeliveries(ctx context.Context, id string, query WebhookGetDeliveriesParams, opts ...option.RequestOption) (res *WebhookGetDeliveriesResponse, err error)
Get delivery history
func (*WebhookService) List ¶
func (r *WebhookService) List(ctx context.Context, opts ...option.RequestOption) (res *WebhookListResponse, err error)
List webhook configs
func (*WebhookService) ListEvents ¶
func (r *WebhookService) ListEvents(ctx context.Context, opts ...option.RequestOption) (res *WebhookListEventsResponse, err error)
List webhook event types
func (*WebhookService) New ¶
func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *WebhookNewResponse, err error)
Create a webhook config
func (*WebhookService) RotateSecret ¶
func (r *WebhookService) RotateSecret(ctx context.Context, id string, opts ...option.RequestOption) (res *WebhookRotateSecretResponse, err error)
Rotate webhook signing secret
func (*WebhookService) Update ¶
func (r *WebhookService) Update(ctx context.Context, id string, body WebhookUpdateParams, opts ...option.RequestOption) (res *WebhookUpdateResponse, err error)
Update a webhook config
type WebhookUpdateParams ¶
type WebhookUpdateParams struct {
// Whether the webhook is active
IsActive param.Opt[bool] `json:"isActive,omitzero"`
// Webhook endpoint URL
URL param.Opt[string] `json:"url,omitzero"`
// Event types to subscribe to
//
// Any of "order.created", "order.paid", "order.cancelled", "stock.low",
// "payment.created", "payment.completed", "payment.failed", "collection.pending",
// "collection.completed", "collection.failed", "withdrawal.created",
// "withdrawal.completed", "withdrawal.failed", "transaction.updated",
// "transfer.pending", "transfer.completed", "transfer.failed",
// "settlement.completed".
Events []string `json:"events,omitzero"`
// contains filtered or unexported fields
}
func (WebhookUpdateParams) MarshalJSON ¶
func (r WebhookUpdateParams) MarshalJSON() (data []byte, err error)
func (*WebhookUpdateParams) UnmarshalJSON ¶
func (r *WebhookUpdateParams) UnmarshalJSON(data []byte) error
type WebhookUpdateResponse ¶
type WebhookUpdateResponse struct {
// Response message
Message string `json:"message" api:"required"`
// Request success status
Status bool `json:"status" api:"required"`
Data WebhookConfigResponseDto `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookUpdateResponse) RawJSON ¶
func (r WebhookUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookUpdateResponse) UnmarshalJSON ¶
func (r *WebhookUpdateResponse) UnmarshalJSON(data []byte) error
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|