Documentation ¶
Index ¶
- type Account
- type Card
- type Client
- func (cl *Client) CreateCard(req CreateCardData) (createCardResp, error)
- func (cl *Client) CreditCard(req PaymentData) (cardResp, error)
- func (cl *Client) DebitCard(req PaymentData) (cardResp, error)
- func (cl *Client) FreezeCard(id string) (cardResp, error)
- func (cl *Client) GetCard(id string) (cardResp, error)
- func (cl *Client) GetTransaction(id string) (transactionResp, error)
- func (cl Client) Health() (string, error)
- func (cl *Client) ListCards(limit, page int, id string) ([]cardResp, error)
- func (cl *Client) ListTransactions(id string, param Param) (transactionsResp, error)
- func (cl *Client) ListUsers(limit, page int) (usersResp, error)
- func (cl *Client) RegisterAccount(req *RegisterAccountData) (accountRes, error)
- func (cl *Client) RegisterUser(req RegisterUserData, id string) (userResp, error)
- func (cl *Client) SetAuth(apiKey string) error
- func (cl *Client) SetBaseURL(baseURL string)
- func (cl *Client) SetDebug(debug bool)
- func (cl *Client) SetHTTPClient(httpClient HTTPClient)
- func (cl *Client) UnfreezeCard(id string) (cardResp, error)
- func (cl *Client) UpdateAccount(webhook, businessAdd, domain string) (accountRes, error)
- type CreateCardData
- type Error
- type HTTPClient
- type Param
- type PaymentData
- type RegisterAccountData
- type RegisterUserData
- type Transaction
- type UpdateAccountData
- type UsdcAddress
- type User
- type UserAddress
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { BusinessAddress string `json:"business_address"` BusinessName string `json:"business_name"` Chain string `json:"chain"` ContactNumber string `json:"contact_number"` Country string `json:"country"` Domain string `json:"domain"` Email string `json:"email"` FirstName string `json:"first_name"` FloatCurrencies []string `json:"float_currencies"` Id string `json:"id"` LastName string `json:"last_name"` RegistrationNumber string `json:"registration_number"` UsdcAddress UsdcAddress `json:"usdc_address"` }
type Card ¶
type Card struct { Balance int `json:"balance"` BusinessId string `json:"business_id"` CardName string `json:"card_name"` CardNumber string `json:"card_number"` CardType string `json:"card_type"` Currency string `json:"currency"` Cvv2 string `json:"cvv2"` DesignType string `json:"design_type"` Expiry time.Time `json:"expiry"` Id string `json:"id"` Provider string `json:"provider"` SingleUse bool `json:"single_use"` Status string `json:"status"` UserId string `json:"user_id"` Valid string `json:"valid"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client ...
func NewClient ¶
func NewClient() *Client
NewClient creates a new Spend-Juice API client with the default base URL.
func (*Client) CreateCard ¶
func (cl *Client) CreateCard(req CreateCardData) (createCardResp, error)
CreateCard creates a card for a user
func (*Client) CreditCard ¶
func (cl *Client) CreditCard(req PaymentData) (cardResp, error)
CreditCard top-up a card for a user
func (*Client) DebitCard ¶
func (cl *Client) DebitCard(req PaymentData) (cardResp, error)
DebitCard debits a card for a user
func (*Client) FreezeCard ¶
FreezeCard freezes a card for a user
func (*Client) GetTransaction ¶
GetTransaction gets a particular transaction
func (*Client) ListTransactions ¶
ListTransactions gets paginated transactions for the given card
func (*Client) RegisterAccount ¶
func (cl *Client) RegisterAccount(req *RegisterAccountData) (accountRes, error)
RegisterAccount creates a card integrator account
func (*Client) RegisterUser ¶
func (cl *Client) RegisterUser(req RegisterUserData, id string) (userResp, error)
RegisterUser creates an account for user requesting a card
func (*Client) SetBaseURL ¶
SetBaseURL overrides the default base URL. For internal use.
func (*Client) SetDebug ¶
SetDebug enables or disables debug mode. In debug mode, HTTP requests and responses will be logged.
func (*Client) SetHTTPClient ¶
func (cl *Client) SetHTTPClient(httpClient HTTPClient)
SetHTTPClient sets the HTTP client that will be used for API calls.
func (*Client) UnfreezeCard ¶
UnfreezeCard unfreezes a card for a user
func (*Client) UpdateAccount ¶
UpdateAccount updates the card integrator account
type CreateCardData ¶
type Error ¶
type PaymentData ¶
type RegisterAccountData ¶
type RegisterAccountData struct { FloatCurrencies []string `json:"float_currencies"` BusinessAddress string `json:"business_address"` BusinessName string `json:"business_name"` Chain string `json:"chain"` ContactNumber string `json:"contact_number"` Country string `json:"country"` Domain string `json:"domain"` Email string `json:"email"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Password string `json:"password"` RegistrationNumber string `json:"registration_number"` WebhookUrl string `json:"webhook_url"` }
type RegisterUserData ¶
type RegisterUserData struct { Address UserAddress `json:"address"` Email string `json:"email"` FirstName string `json:"first_name"` IdNumber string `json:"id_number"` IdType string `json:"id_type"` LastName string `json:"last_name"` PhoneNumber string `json:"phone_number"` UserPhoto string `json:"user_photo,omitempty"` }
type Transaction ¶
type Transaction struct { Amount int `json:"amount"` CardBalanceAfter int `json:"card_balance_after"` CardBalanceBefore int `json:"card_balance_before"` ConversionRate int `json:"conversion_rate"` CreatedAt time.Time `json:"created_at"` CreditCurrency interface{} `json:"credit_currency"` CreditId interface{} `json:"credit_id"` DebitCurrency interface{} `json:"debit_currency"` DebitId interface{} `json:"debit_id"` Id string `json:"id"` Narrative interface{} `json:"narrative"` Type string `json:"type"` }
type UpdateAccountData ¶
type UsdcAddress ¶
type User ¶
type User struct { Address UserAddress `json:"address"` Archived bool `json:"archived"` CardIntegratorId string `json:"card_integrator_id"` Email string `json:"email"` FirstName string `json:"first_name"` Id string `json:"id"` IdNumber string `json:"id_number"` IdType string `json:"id_type"` LastName string `json:"last_name"` PhoneNumber string `json:"phone_number"` Verified bool `json:"verified"` }