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 AccountGetBalanceResponse
- type AccountGetBalanceResponseData
- type AccountGetResponse
- type AccountGetResponseData
- type AccountGetResponseDataDetails
- type AccountListParams
- type AccountListResponse
- type AccountListResponseData
- type AccountListResponseDataData
- type AccountListResponseDataDataDetails
- type AccountListResponseDataMeta
- 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 BilaResponse
- 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 CollectionGetResponseData
- type CollectionGetResponseDataCustomer
- type CollectionGetStatusByReferenceResponse
- type CollectionGetStatusByReferenceResponseData
- type CollectionGetStatusByReferenceResponseDataCustomer
- type CollectionInitiateMobileMoneyCollectionParams
- type CollectionInitiateMobileMoneyCollectionParamsBearer
- type CollectionInitiateMobileMoneyCollectionParamsCountry
- type CollectionInitiateMobileMoneyCollectionParamsOperator
- type CollectionInitiateMobileMoneyCollectionResponse
- type CollectionInitiateMobileMoneyCollectionResponseData
- type CollectionInitiateMobileMoneyCollectionResponseDataCustomer
- type CollectionListParams
- type CollectionListParamsStatus
- type CollectionListResponse
- type CollectionListResponseData
- type CollectionListResponseDataData
- type CollectionListResponseDataDataCustomer
- type CollectionListResponseDataMeta
- 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 ResolveBankAccountParams
- type ResolveBankAccountParamsCountry
- type ResolveBankAccountResponse
- type ResolveBankAccountResponseData
- type ResolveMobileMoneyParams
- type ResolveMobileMoneyParamsCountry
- type ResolveMobileMoneyParamsOperator
- type ResolveMobileMoneyResponse
- type ResolveMobileMoneyResponseData
- type ResolveService
- type TransactionGetResponse
- type TransactionGetResponseData
- type TransactionListParams
- type TransactionListParamsType
- type TransactionListResponse
- type TransactionListResponseData
- type TransactionListResponseDataData
- type TransactionListResponseDataMeta
- type TransactionService
- type TransferGetResponse
- type TransferGetResponseData
- type TransferGetResponseDataRecipient
- type TransferGetStatusByReferenceResponse
- type TransferGetStatusByReferenceResponseData
- type TransferGetStatusByReferenceResponseDataRecipient
- type TransferInitiateBankTransferParams
- type TransferInitiateBankTransferParamsCountry
- type TransferInitiateBankTransferResponse
- type TransferInitiateBankTransferResponseData
- type TransferInitiateBankTransferResponseDataRecipient
- type TransferInitiateMobileMoneyTransferParams
- type TransferInitiateMobileMoneyTransferParamsCountry
- type TransferInitiateMobileMoneyTransferParamsOperator
- type TransferInitiateMobileMoneyTransferResponse
- type TransferInitiateMobileMoneyTransferResponseData
- type TransferInitiateMobileMoneyTransferResponseDataRecipient
- type TransferListParams
- type TransferListParamsStatus
- type TransferListParamsType
- type TransferListResponse
- type TransferListResponseData
- type TransferListResponseDataData
- type TransferListResponseDataDataRecipient
- type TransferListResponseDataMeta
- type TransferRecipientGetResponse
- type TransferRecipientGetResponseData
- type TransferRecipientListParams
- type TransferRecipientListParamsType
- type TransferRecipientListResponse
- type TransferRecipientListResponseData
- type TransferRecipientListResponseDataData
- type TransferRecipientListResponseDataMeta
- type TransferRecipientNewBankAccountParams
- type TransferRecipientNewBankAccountParamsCountry
- type TransferRecipientNewBankAccountResponse
- type TransferRecipientNewBankAccountResponseData
- type TransferRecipientNewMobileMoneyParams
- type TransferRecipientNewMobileMoneyParamsCountry
- type TransferRecipientNewMobileMoneyParamsOperator
- type TransferRecipientNewMobileMoneyResponse
- type TransferRecipientNewMobileMoneyResponseData
- 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 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 WebhookGetDeliveriesParams
- type WebhookGetDeliveriesResponse
- type WebhookGetDeliveriesResponseData
- type WebhookGetDeliveriesResponseDataData
- type WebhookGetDeliveriesResponseDataMeta
- type WebhookListEventsResponse
- type WebhookListResponse
- type WebhookListResponseData
- type WebhookNewParams
- type WebhookNewResponse
- type WebhookNewResponseData
- type WebhookRotateSecretResponse
- type WebhookRotateSecretResponseData
- type WebhookService
- func (r *WebhookService) Deactivate(ctx context.Context, id string, opts ...option.RequestOption) (res *BilaResponse, 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
- type WebhookUpdateResponseData
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 AccountGetBalanceResponse ¶
type AccountGetBalanceResponse struct {
Data AccountGetBalanceResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 {
Data AccountGetResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 AccountGetResponseData ¶
type AccountGetResponseData 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 AccountGetResponseDataDetails `json:"details" api:"required"`
// Account status
//
// Any of "active", "inactive", "suspended".
Status string `json:"status" api:"required"`
// Account type
//
// Any of "main", "sub", "virtual".
Type string `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 (AccountGetResponseData) RawJSON ¶
func (r AccountGetResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountGetResponseData) UnmarshalJSON ¶
func (r *AccountGetResponseData) UnmarshalJSON(data []byte) error
type AccountGetResponseDataDetails ¶
type AccountGetResponseDataDetails 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:"-"`
}
Account details
func (AccountGetResponseDataDetails) RawJSON ¶
func (r AccountGetResponseDataDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountGetResponseDataDetails) UnmarshalJSON ¶
func (r *AccountGetResponseDataDetails) 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 {
Data AccountListResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 []AccountListResponseDataData `json:"data" api:"required"`
// Pagination metadata
Meta AccountListResponseDataMeta `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 AccountListResponseDataData ¶
type AccountListResponseDataData 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 AccountListResponseDataDataDetails `json:"details" api:"required"`
// Account status
//
// Any of "active", "inactive", "suspended".
Status string `json:"status" api:"required"`
// Account type
//
// Any of "main", "sub", "virtual".
Type string `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 (AccountListResponseDataData) RawJSON ¶
func (r AccountListResponseDataData) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountListResponseDataData) UnmarshalJSON ¶
func (r *AccountListResponseDataData) UnmarshalJSON(data []byte) error
type AccountListResponseDataDataDetails ¶
type AccountListResponseDataDataDetails 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:"-"`
}
Account details
func (AccountListResponseDataDataDetails) RawJSON ¶
func (r AccountListResponseDataDataDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountListResponseDataDataDetails) UnmarshalJSON ¶
func (r *AccountListResponseDataDataDetails) UnmarshalJSON(data []byte) error
type AccountListResponseDataMeta ¶
type AccountListResponseDataMeta struct {
// Current page number
CurrentPage float64 `json:"currentPage" api:"required"`
// Total number of pages
PageCount float64 `json:"pageCount" api:"required"`
// Items per page
PerPage float64 `json:"perPage" api:"required"`
// Total number of records
Total float64 `json:"total" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CurrentPage respjson.Field
PageCount respjson.Field
PerPage respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Pagination metadata
func (AccountListResponseDataMeta) RawJSON ¶
func (r AccountListResponseDataMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountListResponseDataMeta) UnmarshalJSON ¶
func (r *AccountListResponseDataMeta) UnmarshalJSON(data []byte) error
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 {
Data []BankListResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 BilaResponse ¶
type BilaResponse 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 (BilaResponse) RawJSON ¶
func (r BilaResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BilaResponse) UnmarshalJSON ¶
func (r *BilaResponse) UnmarshalJSON(data []byte) error
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 {
Data CollectionGetResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 CollectionGetResponseData ¶
type CollectionGetResponseData 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 CollectionGetResponseDataCustomer `json:"customer" api:"required"`
// Client reference
Reference string `json:"reference" api:"required"`
// Collection status
//
// Any of "pending", "successful", "failed", "otp-required", "pay-offline".
Status string `json:"status" api:"required"`
// Collection completion timestamp
CompletedAt time.Time `json:"completedAt" format:"date-time"`
// Who bears the collection platform fee
//
// Any of "merchant", "customer".
FeeBearer string `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 (CollectionGetResponseData) RawJSON ¶
func (r CollectionGetResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*CollectionGetResponseData) UnmarshalJSON ¶
func (r *CollectionGetResponseData) UnmarshalJSON(data []byte) error
type CollectionGetResponseDataCustomer ¶
type CollectionGetResponseDataCustomer 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:"-"`
}
Customer details
func (CollectionGetResponseDataCustomer) RawJSON ¶
func (r CollectionGetResponseDataCustomer) RawJSON() string
Returns the unmodified JSON received from the API
func (*CollectionGetResponseDataCustomer) UnmarshalJSON ¶
func (r *CollectionGetResponseDataCustomer) UnmarshalJSON(data []byte) error
type CollectionGetStatusByReferenceResponse ¶
type CollectionGetStatusByReferenceResponse struct {
Data CollectionGetStatusByReferenceResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 CollectionGetStatusByReferenceResponseData ¶
type CollectionGetStatusByReferenceResponseData 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 CollectionGetStatusByReferenceResponseDataCustomer `json:"customer" api:"required"`
// Client reference
Reference string `json:"reference" api:"required"`
// Collection status
//
// Any of "pending", "successful", "failed", "otp-required", "pay-offline".
Status string `json:"status" api:"required"`
// Collection completion timestamp
CompletedAt time.Time `json:"completedAt" format:"date-time"`
// Who bears the collection platform fee
//
// Any of "merchant", "customer".
FeeBearer string `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 (CollectionGetStatusByReferenceResponseData) RawJSON ¶
func (r CollectionGetStatusByReferenceResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*CollectionGetStatusByReferenceResponseData) UnmarshalJSON ¶
func (r *CollectionGetStatusByReferenceResponseData) UnmarshalJSON(data []byte) error
type CollectionGetStatusByReferenceResponseDataCustomer ¶
type CollectionGetStatusByReferenceResponseDataCustomer 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:"-"`
}
Customer details
func (CollectionGetStatusByReferenceResponseDataCustomer) RawJSON ¶
func (r CollectionGetStatusByReferenceResponseDataCustomer) RawJSON() string
Returns the unmodified JSON received from the API
func (*CollectionGetStatusByReferenceResponseDataCustomer) UnmarshalJSON ¶
func (r *CollectionGetStatusByReferenceResponseDataCustomer) UnmarshalJSON(data []byte) error
type CollectionInitiateMobileMoneyCollectionParams ¶
type CollectionInitiateMobileMoneyCollectionParams struct {
// Collection amount
Amount float64 `json:"amount" api:"required"`
// Country code
//
// Any of "zm", "ng".
Country CollectionInitiateMobileMoneyCollectionParamsCountry `json:"country,omitzero" api:"required"`
// Mobile money operator
//
// Any of "airtel", "mtn", "zamtel", "vodacom".
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" CollectionInitiateMobileMoneyCollectionParamsCountryNg CollectionInitiateMobileMoneyCollectionParamsCountry = "ng" )
type CollectionInitiateMobileMoneyCollectionParamsOperator ¶
type CollectionInitiateMobileMoneyCollectionParamsOperator string
Mobile money operator
const ( CollectionInitiateMobileMoneyCollectionParamsOperatorAirtel CollectionInitiateMobileMoneyCollectionParamsOperator = "airtel" CollectionInitiateMobileMoneyCollectionParamsOperatorMtn CollectionInitiateMobileMoneyCollectionParamsOperator = "mtn" CollectionInitiateMobileMoneyCollectionParamsOperatorZamtel CollectionInitiateMobileMoneyCollectionParamsOperator = "zamtel" CollectionInitiateMobileMoneyCollectionParamsOperatorVodacom CollectionInitiateMobileMoneyCollectionParamsOperator = "vodacom" )
type CollectionInitiateMobileMoneyCollectionResponse ¶
type CollectionInitiateMobileMoneyCollectionResponse struct {
Data CollectionInitiateMobileMoneyCollectionResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 CollectionInitiateMobileMoneyCollectionResponseData ¶
type CollectionInitiateMobileMoneyCollectionResponseData 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 CollectionInitiateMobileMoneyCollectionResponseDataCustomer `json:"customer" api:"required"`
// Client reference
Reference string `json:"reference" api:"required"`
// Collection status
//
// Any of "pending", "successful", "failed", "otp-required", "pay-offline".
Status string `json:"status" api:"required"`
// Collection completion timestamp
CompletedAt time.Time `json:"completedAt" format:"date-time"`
// Who bears the collection platform fee
//
// Any of "merchant", "customer".
FeeBearer string `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 (CollectionInitiateMobileMoneyCollectionResponseData) RawJSON ¶
func (r CollectionInitiateMobileMoneyCollectionResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*CollectionInitiateMobileMoneyCollectionResponseData) UnmarshalJSON ¶
func (r *CollectionInitiateMobileMoneyCollectionResponseData) UnmarshalJSON(data []byte) error
type CollectionInitiateMobileMoneyCollectionResponseDataCustomer ¶
type CollectionInitiateMobileMoneyCollectionResponseDataCustomer 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:"-"`
}
Customer details
func (CollectionInitiateMobileMoneyCollectionResponseDataCustomer) RawJSON ¶
func (r CollectionInitiateMobileMoneyCollectionResponseDataCustomer) RawJSON() string
Returns the unmodified JSON received from the API
func (*CollectionInitiateMobileMoneyCollectionResponseDataCustomer) UnmarshalJSON ¶
func (r *CollectionInitiateMobileMoneyCollectionResponseDataCustomer) 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 {
Data CollectionListResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 []CollectionListResponseDataData `json:"data" api:"required"`
// Pagination metadata
Meta CollectionListResponseDataMeta `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 CollectionListResponseDataData ¶
type CollectionListResponseDataData 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 CollectionListResponseDataDataCustomer `json:"customer" api:"required"`
// Client reference
Reference string `json:"reference" api:"required"`
// Collection status
//
// Any of "pending", "successful", "failed", "otp-required", "pay-offline".
Status string `json:"status" api:"required"`
// Collection completion timestamp
CompletedAt time.Time `json:"completedAt" format:"date-time"`
// Who bears the collection platform fee
//
// Any of "merchant", "customer".
FeeBearer string `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 (CollectionListResponseDataData) RawJSON ¶
func (r CollectionListResponseDataData) RawJSON() string
Returns the unmodified JSON received from the API
func (*CollectionListResponseDataData) UnmarshalJSON ¶
func (r *CollectionListResponseDataData) UnmarshalJSON(data []byte) error
type CollectionListResponseDataDataCustomer ¶
type CollectionListResponseDataDataCustomer 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:"-"`
}
Customer details
func (CollectionListResponseDataDataCustomer) RawJSON ¶
func (r CollectionListResponseDataDataCustomer) RawJSON() string
Returns the unmodified JSON received from the API
func (*CollectionListResponseDataDataCustomer) UnmarshalJSON ¶
func (r *CollectionListResponseDataDataCustomer) UnmarshalJSON(data []byte) error
type CollectionListResponseDataMeta ¶
type CollectionListResponseDataMeta struct {
// Current page number
CurrentPage float64 `json:"currentPage" api:"required"`
// Total number of pages
PageCount float64 `json:"pageCount" api:"required"`
// Items per page
PerPage float64 `json:"perPage" api:"required"`
// Total number of records
Total float64 `json:"total" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CurrentPage respjson.Field
PageCount respjson.Field
PerPage respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Pagination metadata
func (CollectionListResponseDataMeta) RawJSON ¶
func (r CollectionListResponseDataMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*CollectionListResponseDataMeta) UnmarshalJSON ¶
func (r *CollectionListResponseDataMeta) 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 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", "ng".
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" ResolveBankAccountParamsCountryNg ResolveBankAccountParamsCountry = "ng" )
type ResolveBankAccountResponse ¶
type ResolveBankAccountResponse struct {
Data ResolveBankAccountResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 ResolveBankAccountResponseData ¶
type ResolveBankAccountResponseData 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 (ResolveBankAccountResponseData) RawJSON ¶
func (r ResolveBankAccountResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResolveBankAccountResponseData) UnmarshalJSON ¶
func (r *ResolveBankAccountResponseData) UnmarshalJSON(data []byte) error
type ResolveMobileMoneyParams ¶
type ResolveMobileMoneyParams struct {
// Country code
//
// Any of "zm", "ng".
Country ResolveMobileMoneyParamsCountry `json:"country,omitzero" api:"required"`
// Mobile money operator
//
// Any of "airtel", "mtn", "zamtel", "vodacom".
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" ResolveMobileMoneyParamsCountryNg ResolveMobileMoneyParamsCountry = "ng" )
type ResolveMobileMoneyParamsOperator ¶
type ResolveMobileMoneyParamsOperator string
Mobile money operator
const ( ResolveMobileMoneyParamsOperatorAirtel ResolveMobileMoneyParamsOperator = "airtel" ResolveMobileMoneyParamsOperatorMtn ResolveMobileMoneyParamsOperator = "mtn" ResolveMobileMoneyParamsOperatorZamtel ResolveMobileMoneyParamsOperator = "zamtel" ResolveMobileMoneyParamsOperatorVodacom ResolveMobileMoneyParamsOperator = "vodacom" )
type ResolveMobileMoneyResponse ¶
type ResolveMobileMoneyResponse struct {
Data ResolveMobileMoneyResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 ResolveMobileMoneyResponseData ¶
type ResolveMobileMoneyResponseData 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 (ResolveMobileMoneyResponseData) RawJSON ¶
func (r ResolveMobileMoneyResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResolveMobileMoneyResponseData) UnmarshalJSON ¶
func (r *ResolveMobileMoneyResponseData) 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 TransactionGetResponse ¶
type TransactionGetResponse struct {
Data TransactionGetResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 TransactionGetResponseData ¶
type TransactionGetResponseData 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 string `json:"status" api:"required"`
// Transaction type
//
// Any of "credit", "debit".
Type string `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 (TransactionGetResponseData) RawJSON ¶
func (r TransactionGetResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransactionGetResponseData) UnmarshalJSON ¶
func (r *TransactionGetResponseData) 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 {
Data TransactionListResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 []TransactionListResponseDataData `json:"data" api:"required"`
// Pagination metadata
Meta TransactionListResponseDataMeta `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 TransactionListResponseDataData ¶
type TransactionListResponseDataData 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 string `json:"status" api:"required"`
// Transaction type
//
// Any of "credit", "debit".
Type string `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 (TransactionListResponseDataData) RawJSON ¶
func (r TransactionListResponseDataData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransactionListResponseDataData) UnmarshalJSON ¶
func (r *TransactionListResponseDataData) UnmarshalJSON(data []byte) error
type TransactionListResponseDataMeta ¶
type TransactionListResponseDataMeta struct {
// Current page number
CurrentPage float64 `json:"currentPage" api:"required"`
// Total number of pages
PageCount float64 `json:"pageCount" api:"required"`
// Items per page
PerPage float64 `json:"perPage" api:"required"`
// Total number of records
Total float64 `json:"total" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CurrentPage respjson.Field
PageCount respjson.Field
PerPage respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Pagination metadata
func (TransactionListResponseDataMeta) RawJSON ¶
func (r TransactionListResponseDataMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransactionListResponseDataMeta) UnmarshalJSON ¶
func (r *TransactionListResponseDataMeta) UnmarshalJSON(data []byte) error
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 {
Data TransferGetResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 TransferGetResponseData ¶
type TransferGetResponseData 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 TransferGetResponseDataRecipient `json:"recipient" api:"required"`
// Client reference
Reference string `json:"reference" api:"required"`
// Transfer status
//
// Any of "pending", "successful", "failed".
Status string `json:"status" api:"required"`
// Transfer type
//
// Any of "bank-account", "mobile-money".
Type string `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 (TransferGetResponseData) RawJSON ¶
func (r TransferGetResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferGetResponseData) UnmarshalJSON ¶
func (r *TransferGetResponseData) UnmarshalJSON(data []byte) error
type TransferGetResponseDataRecipient ¶
type TransferGetResponseDataRecipient 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:"-"`
}
Recipient details
func (TransferGetResponseDataRecipient) RawJSON ¶
func (r TransferGetResponseDataRecipient) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferGetResponseDataRecipient) UnmarshalJSON ¶
func (r *TransferGetResponseDataRecipient) UnmarshalJSON(data []byte) error
type TransferGetStatusByReferenceResponse ¶
type TransferGetStatusByReferenceResponse struct {
Data TransferGetStatusByReferenceResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 TransferGetStatusByReferenceResponseData ¶
type TransferGetStatusByReferenceResponseData 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 TransferGetStatusByReferenceResponseDataRecipient `json:"recipient" api:"required"`
// Client reference
Reference string `json:"reference" api:"required"`
// Transfer status
//
// Any of "pending", "successful", "failed".
Status string `json:"status" api:"required"`
// Transfer type
//
// Any of "bank-account", "mobile-money".
Type string `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 (TransferGetStatusByReferenceResponseData) RawJSON ¶
func (r TransferGetStatusByReferenceResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferGetStatusByReferenceResponseData) UnmarshalJSON ¶
func (r *TransferGetStatusByReferenceResponseData) UnmarshalJSON(data []byte) error
type TransferGetStatusByReferenceResponseDataRecipient ¶
type TransferGetStatusByReferenceResponseDataRecipient 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:"-"`
}
Recipient details
func (TransferGetStatusByReferenceResponseDataRecipient) RawJSON ¶
func (r TransferGetStatusByReferenceResponseDataRecipient) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferGetStatusByReferenceResponseDataRecipient) UnmarshalJSON ¶
func (r *TransferGetStatusByReferenceResponseDataRecipient) 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", "ng".
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" TransferInitiateBankTransferParamsCountryNg TransferInitiateBankTransferParamsCountry = "ng" )
type TransferInitiateBankTransferResponse ¶
type TransferInitiateBankTransferResponse struct {
Data TransferInitiateBankTransferResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 TransferInitiateBankTransferResponseData ¶
type TransferInitiateBankTransferResponseData 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 TransferInitiateBankTransferResponseDataRecipient `json:"recipient" api:"required"`
// Client reference
Reference string `json:"reference" api:"required"`
// Transfer status
//
// Any of "pending", "successful", "failed".
Status string `json:"status" api:"required"`
// Transfer type
//
// Any of "bank-account", "mobile-money".
Type string `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 (TransferInitiateBankTransferResponseData) RawJSON ¶
func (r TransferInitiateBankTransferResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferInitiateBankTransferResponseData) UnmarshalJSON ¶
func (r *TransferInitiateBankTransferResponseData) UnmarshalJSON(data []byte) error
type TransferInitiateBankTransferResponseDataRecipient ¶
type TransferInitiateBankTransferResponseDataRecipient 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:"-"`
}
Recipient details
func (TransferInitiateBankTransferResponseDataRecipient) RawJSON ¶
func (r TransferInitiateBankTransferResponseDataRecipient) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferInitiateBankTransferResponseDataRecipient) UnmarshalJSON ¶
func (r *TransferInitiateBankTransferResponseDataRecipient) UnmarshalJSON(data []byte) error
type TransferInitiateMobileMoneyTransferParams ¶
type TransferInitiateMobileMoneyTransferParams struct {
// Transfer amount
Amount float64 `json:"amount" api:"required"`
// Country code
//
// Any of "zm", "ng".
Country TransferInitiateMobileMoneyTransferParamsCountry `json:"country,omitzero" api:"required"`
// Mobile money operator
//
// Any of "airtel", "mtn", "zamtel", "vodacom".
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" TransferInitiateMobileMoneyTransferParamsCountryNg TransferInitiateMobileMoneyTransferParamsCountry = "ng" )
type TransferInitiateMobileMoneyTransferParamsOperator ¶
type TransferInitiateMobileMoneyTransferParamsOperator string
Mobile money operator
const ( TransferInitiateMobileMoneyTransferParamsOperatorAirtel TransferInitiateMobileMoneyTransferParamsOperator = "airtel" TransferInitiateMobileMoneyTransferParamsOperatorMtn TransferInitiateMobileMoneyTransferParamsOperator = "mtn" TransferInitiateMobileMoneyTransferParamsOperatorZamtel TransferInitiateMobileMoneyTransferParamsOperator = "zamtel" TransferInitiateMobileMoneyTransferParamsOperatorVodacom TransferInitiateMobileMoneyTransferParamsOperator = "vodacom" )
type TransferInitiateMobileMoneyTransferResponse ¶
type TransferInitiateMobileMoneyTransferResponse struct {
Data TransferInitiateMobileMoneyTransferResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 TransferInitiateMobileMoneyTransferResponseData ¶
type TransferInitiateMobileMoneyTransferResponseData 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 TransferInitiateMobileMoneyTransferResponseDataRecipient `json:"recipient" api:"required"`
// Client reference
Reference string `json:"reference" api:"required"`
// Transfer status
//
// Any of "pending", "successful", "failed".
Status string `json:"status" api:"required"`
// Transfer type
//
// Any of "bank-account", "mobile-money".
Type string `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 (TransferInitiateMobileMoneyTransferResponseData) RawJSON ¶
func (r TransferInitiateMobileMoneyTransferResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferInitiateMobileMoneyTransferResponseData) UnmarshalJSON ¶
func (r *TransferInitiateMobileMoneyTransferResponseData) UnmarshalJSON(data []byte) error
type TransferInitiateMobileMoneyTransferResponseDataRecipient ¶
type TransferInitiateMobileMoneyTransferResponseDataRecipient 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:"-"`
}
Recipient details
func (TransferInitiateMobileMoneyTransferResponseDataRecipient) RawJSON ¶
func (r TransferInitiateMobileMoneyTransferResponseDataRecipient) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferInitiateMobileMoneyTransferResponseDataRecipient) UnmarshalJSON ¶
func (r *TransferInitiateMobileMoneyTransferResponseDataRecipient) 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 {
Data TransferListResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 []TransferListResponseDataData `json:"data" api:"required"`
// Pagination metadata
Meta TransferListResponseDataMeta `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 TransferListResponseDataData ¶
type TransferListResponseDataData 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 TransferListResponseDataDataRecipient `json:"recipient" api:"required"`
// Client reference
Reference string `json:"reference" api:"required"`
// Transfer status
//
// Any of "pending", "successful", "failed".
Status string `json:"status" api:"required"`
// Transfer type
//
// Any of "bank-account", "mobile-money".
Type string `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 (TransferListResponseDataData) RawJSON ¶
func (r TransferListResponseDataData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferListResponseDataData) UnmarshalJSON ¶
func (r *TransferListResponseDataData) UnmarshalJSON(data []byte) error
type TransferListResponseDataDataRecipient ¶
type TransferListResponseDataDataRecipient 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:"-"`
}
Recipient details
func (TransferListResponseDataDataRecipient) RawJSON ¶
func (r TransferListResponseDataDataRecipient) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferListResponseDataDataRecipient) UnmarshalJSON ¶
func (r *TransferListResponseDataDataRecipient) UnmarshalJSON(data []byte) error
type TransferListResponseDataMeta ¶
type TransferListResponseDataMeta struct {
// Current page number
CurrentPage float64 `json:"currentPage" api:"required"`
// Total number of pages
PageCount float64 `json:"pageCount" api:"required"`
// Items per page
PerPage float64 `json:"perPage" api:"required"`
// Total number of records
Total float64 `json:"total" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CurrentPage respjson.Field
PageCount respjson.Field
PerPage respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Pagination metadata
func (TransferListResponseDataMeta) RawJSON ¶
func (r TransferListResponseDataMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferListResponseDataMeta) UnmarshalJSON ¶
func (r *TransferListResponseDataMeta) UnmarshalJSON(data []byte) error
type TransferRecipientGetResponse ¶
type TransferRecipientGetResponse struct {
Data TransferRecipientGetResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 TransferRecipientGetResponseData ¶
type TransferRecipientGetResponseData 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"`
// Recipient type
//
// Any of "bank-account", "mobile-money".
Type string `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 (TransferRecipientGetResponseData) RawJSON ¶
func (r TransferRecipientGetResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferRecipientGetResponseData) UnmarshalJSON ¶
func (r *TransferRecipientGetResponseData) 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 {
Data TransferRecipientListResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 []TransferRecipientListResponseDataData `json:"data" api:"required"`
// Pagination metadata
Meta TransferRecipientListResponseDataMeta `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 TransferRecipientListResponseDataData ¶
type TransferRecipientListResponseDataData 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"`
// Recipient type
//
// Any of "bank-account", "mobile-money".
Type string `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 (TransferRecipientListResponseDataData) RawJSON ¶
func (r TransferRecipientListResponseDataData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferRecipientListResponseDataData) UnmarshalJSON ¶
func (r *TransferRecipientListResponseDataData) UnmarshalJSON(data []byte) error
type TransferRecipientListResponseDataMeta ¶
type TransferRecipientListResponseDataMeta struct {
// Current page number
CurrentPage float64 `json:"currentPage" api:"required"`
// Total number of pages
PageCount float64 `json:"pageCount" api:"required"`
// Items per page
PerPage float64 `json:"perPage" api:"required"`
// Total number of records
Total float64 `json:"total" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CurrentPage respjson.Field
PageCount respjson.Field
PerPage respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Pagination metadata
func (TransferRecipientListResponseDataMeta) RawJSON ¶
func (r TransferRecipientListResponseDataMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferRecipientListResponseDataMeta) UnmarshalJSON ¶
func (r *TransferRecipientListResponseDataMeta) 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", "ng".
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" TransferRecipientNewBankAccountParamsCountryNg TransferRecipientNewBankAccountParamsCountry = "ng" )
type TransferRecipientNewBankAccountResponse ¶
type TransferRecipientNewBankAccountResponse struct {
Data TransferRecipientNewBankAccountResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 TransferRecipientNewBankAccountResponseData ¶
type TransferRecipientNewBankAccountResponseData 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"`
// Recipient type
//
// Any of "bank-account", "mobile-money".
Type string `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 (TransferRecipientNewBankAccountResponseData) RawJSON ¶
func (r TransferRecipientNewBankAccountResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferRecipientNewBankAccountResponseData) UnmarshalJSON ¶
func (r *TransferRecipientNewBankAccountResponseData) UnmarshalJSON(data []byte) error
type TransferRecipientNewMobileMoneyParams ¶
type TransferRecipientNewMobileMoneyParams struct {
// Country code
//
// Any of "zm", "ng".
Country TransferRecipientNewMobileMoneyParamsCountry `json:"country,omitzero" api:"required"`
// Mobile money operator
//
// Any of "airtel", "mtn", "zamtel", "vodacom".
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" TransferRecipientNewMobileMoneyParamsCountryNg TransferRecipientNewMobileMoneyParamsCountry = "ng" )
type TransferRecipientNewMobileMoneyParamsOperator ¶
type TransferRecipientNewMobileMoneyParamsOperator string
Mobile money operator
const ( TransferRecipientNewMobileMoneyParamsOperatorAirtel TransferRecipientNewMobileMoneyParamsOperator = "airtel" TransferRecipientNewMobileMoneyParamsOperatorMtn TransferRecipientNewMobileMoneyParamsOperator = "mtn" TransferRecipientNewMobileMoneyParamsOperatorZamtel TransferRecipientNewMobileMoneyParamsOperator = "zamtel" TransferRecipientNewMobileMoneyParamsOperatorVodacom TransferRecipientNewMobileMoneyParamsOperator = "vodacom" )
type TransferRecipientNewMobileMoneyResponse ¶
type TransferRecipientNewMobileMoneyResponse struct {
Data TransferRecipientNewMobileMoneyResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 TransferRecipientNewMobileMoneyResponseData ¶
type TransferRecipientNewMobileMoneyResponseData 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"`
// Recipient type
//
// Any of "bank-account", "mobile-money".
Type string `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 (TransferRecipientNewMobileMoneyResponseData) RawJSON ¶
func (r TransferRecipientNewMobileMoneyResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*TransferRecipientNewMobileMoneyResponseData) UnmarshalJSON ¶
func (r *TransferRecipientNewMobileMoneyResponseData) 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 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 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 {
Data WebhookGetDeliveriesResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 WebhookGetDeliveriesResponseDataMeta `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 WebhookGetDeliveriesResponseDataMeta ¶
type WebhookGetDeliveriesResponseDataMeta struct {
// Current page number
CurrentPage float64 `json:"currentPage" api:"required"`
// Total number of pages
PageCount float64 `json:"pageCount" api:"required"`
// Items per page
PerPage float64 `json:"perPage" api:"required"`
// Total number of records
Total float64 `json:"total" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CurrentPage respjson.Field
PageCount respjson.Field
PerPage respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Pagination metadata
func (WebhookGetDeliveriesResponseDataMeta) RawJSON ¶
func (r WebhookGetDeliveriesResponseDataMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookGetDeliveriesResponseDataMeta) UnmarshalJSON ¶
func (r *WebhookGetDeliveriesResponseDataMeta) UnmarshalJSON(data []byte) error
type WebhookListEventsResponse ¶
type WebhookListEventsResponse struct {
Data []string `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 {
Data []WebhookListResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 WebhookListResponseData ¶
type WebhookListResponseData 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 (WebhookListResponseData) RawJSON ¶
func (r WebhookListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookListResponseData) UnmarshalJSON ¶
func (r *WebhookListResponseData) 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 {
Data WebhookNewResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 WebhookNewResponseData ¶
type WebhookNewResponseData 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 (WebhookNewResponseData) RawJSON ¶
func (r WebhookNewResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookNewResponseData) UnmarshalJSON ¶
func (r *WebhookNewResponseData) UnmarshalJSON(data []byte) error
type WebhookRotateSecretResponse ¶
type WebhookRotateSecretResponse struct {
Data WebhookRotateSecretResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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 *BilaResponse, 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 {
Data WebhookUpdateResponseData `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BilaResponse
}
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
type WebhookUpdateResponseData ¶
type WebhookUpdateResponseData 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 (WebhookUpdateResponseData) RawJSON ¶
func (r WebhookUpdateResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookUpdateResponseData) UnmarshalJSON ¶
func (r *WebhookUpdateResponseData) 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
|
|
|
shared
|
|