Documentation ¶
Index ¶
- type Account
- type AccountResp
- type Card
- type CardResp
- type Client
- func (cl *Client) CreateCard(req CreateCardReq) (CreateCardResp, error)
- func (cl *Client) CreditCard(req PaymentReq) (CardResp, error)
- func (cl *Client) DebitCard(req PaymentReq) (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) 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 *RegisterAccountReq) (AccountResp, error)
- func (cl *Client) RegisterUser(req RegisterUserReq, 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) (AccountResp, error)
- type CreateCardReq
- type CreateCardResp
- type Error
- type HTTPClient
- type Param
- type PaymentReq
- type RegisterAccountReq
- type RegisterUserReq
- type Transaction
- type TransactionResp
- type TransactionsResp
- type UpdateAccountReq
- type UsdcAddress
- type User
- type UserAddress
- type UserResp
- type UsersResp
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 AccountResp ¶
type AccountResp struct {
Data Account `json:"data"`
}
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 CardResp ¶
type CardResp struct { Balance int `json:"balance"` CardNumber string `json:"card_number"` CardType string `json:"card_type"` Cvv2 string `json:"cvv2"` Expiry time.Time `json:"expiry"` Id string `json:"id"` SingleUse bool `json:"single_use"` Status string `json:"status"` 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 CreateCardReq) (CreateCardResp, error)
CreateCard creates a card for a user
func (*Client) CreditCard ¶
func (cl *Client) CreditCard(req PaymentReq) (CardResp, error)
CreditCard top-up a card for a user
func (*Client) DebitCard ¶
func (cl *Client) DebitCard(req PaymentReq) (CardResp, error)
DebitCard debits a card for a user
func (*Client) FreezeCard ¶
FreezeCard freezes a card for a user
func (*Client) GetTransaction ¶
func (cl *Client) GetTransaction(id string) (TransactionResp, error)
GetTransaction gets a particular transaction
func (*Client) ListTransactions ¶
func (cl *Client) ListTransactions(id string, param Param) (TransactionsResp, error)
ListTransactions gets paginated transactions for the given card
func (*Client) RegisterAccount ¶
func (cl *Client) RegisterAccount(req *RegisterAccountReq) (AccountResp, error)
RegisterAccount creates a card integrator account
func (*Client) RegisterUser ¶
func (cl *Client) RegisterUser(req RegisterUserReq, 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 ¶
func (cl *Client) UpdateAccount(webhook, businessAdd, domain string) (AccountResp, error)
UpdateAccount updates the card integrator account
type CreateCardReq ¶
type CreateCardResp ¶
type CreateCardResp struct {
Data Card `json:"data"`
}
type Error ¶
type PaymentReq ¶
type RegisterAccountReq ¶
type RegisterAccountReq 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 RegisterUserReq ¶
type RegisterUserReq 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 TransactionResp ¶
type TransactionResp struct { Data Transaction `json:"data"` Message string `json:"message"` }
type TransactionsResp ¶
type TransactionsResp struct { Data []Transaction `json:"data"` Message string `json:"message"` NextPage interface{} `json:"next_page"` }
type UpdateAccountReq ¶
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"` }