Documentation
¶
Overview ¶
Package creem creem.io golang SDK
Index ¶
Constants ¶
View Source
const ( BaseURL = "https://api.creem.io" TestBaseURL = "https://test-api.creem.io" )
Variables ¶
View Source
var ( ErrUnknown = errors.New("unknown error") ErrInvalidParameters = errors.New("check that the parameters were correct") ErrMissingAPIKey = errors.New("the API key used was missing") ErrInvalidAPIKey = errors.New("the API key used was invalid") ErrNoResourceFound = errors.New("the resource was not found") ErrExceededRateLimit = errors.New("the rate limit was exceeded") ErrServerError = errors.New("indicates an error with Creem servers") ErrCreateCheckoutSession = errors.New("create checkout session failed") ErrGetCheckoutSession = errors.New("get checkout session failed") ErrCreateProduct = errors.New("create product failed") ErrGetProduct = errors.New("get product failed") ErrListProduct = errors.New("list products failed") ErrGetCustomer = errors.New("get customer failed") ErrListTransaction = errors.New("list transactions failed") ErrValidateLicense = errors.New("validate license failed") ErrActivateLicense = errors.New("activate license failed") ErrDeactivateLicense = errors.New("deactivate license failed") ErrCreateDiscount = errors.New("create discount failed") ErrDeleteDiscount = errors.New("delete discount failed") ErrGetDiscount = errors.New("get discount failed") ErrGetSubscription = errors.New("get subscription failed") ErrUpdateSubscription = errors.New("update subscription failed") ErrUpgradeSubscription = errors.New("upgrade subscription failed") ErrCancelSubscription = errors.New("cancel subscription failed") ErrInvalidSignature = errors.New("invalid signature") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) SetTestMode ¶
func (*Client) SetVerbose ¶ added in v1.0.6
type CustomField ¶ added in v1.0.2
type CustomField struct { // Type the type of the field. Type CustomFieldType `json:"type,omitempty"` // Key Unique key for custom field. Must be unique to this field, alphanumeric, and up to 200 characters. // Maximum length: 200 Key string `json:"key,omitempty"` // Label The label for the field, displayed to the customer, up to 50 characters Label string `json:"label,omitempty"` // Optional Whether the customer is required to complete the field. Defaults to false Optional bool `json:"optional,omitempty"` // Text configuration for type of text field. Text *TextField `json:"text,omitempty"` }
CustomField collect additional information from your customer using custom fields. Up to 3 fields are supported.
type CustomFieldType ¶ added in v1.0.2
type CustomFieldType string
CustomFieldType the type of the field.
const (
TextFieldType CustomFieldType = "text"
)
type DeleteRequest ¶ added in v1.0.2
type DeleteRequest struct{}
func (DeleteRequest) Method ¶ added in v1.0.2
func (r DeleteRequest) Method() string
type GetRequest ¶ added in v1.0.2
type GetRequest struct{}
func (GetRequest) Method ¶ added in v1.0.2
func (r GetRequest) Method() string
type Option ¶
type Option func(*Client)
func WithHTTPClient ¶
func WithTestMode ¶
func WithVerbose ¶ added in v1.0.6
type Pagination ¶
type Pagination struct { // TotalRecords Total number of records in the list TotalRecords int64 `json:"total_records,omitempty"` // TotalPages Total number of pages available TotalPages int64 `json:"total_pages,omitempty"` // CurrentPage The current page number CurrentPage int64 `json:"current_page,omitempty"` // NextPage The next page number, or null if there is no next page NextPage int64 `json:"next_page,omitempty"` // PrevPage The previous page number, or null if there is no previous page PrevPage int64 `json:"prev_page,omitempty"` }
Pagination details for the list
type PostRequest ¶ added in v1.0.2
type PostRequest struct{}
func (PostRequest) Method ¶ added in v1.0.2
func (r PostRequest) Method() string
type TextField ¶ added in v1.0.2
type TextField struct { // MaxLength Maximum character length constraint for the input. MaxLength int `json:"max_length,omitempty"` // MinLength Minimum character length requirement for the input. MinLength int `json:"min_length,omitempty"` }
TextField configuration for type of text field.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package checkouts Checkout related APIs
|
Package checkouts Checkout related APIs |
Package customers Customers related API
|
Package customers Customers related API |
Package discounts Discount related APIs
|
Package discounts Discount related APIs |
Package products Product related APIs
|
Package products Product related APIs |
Package subscriptions includes Subscriptions related APIs
|
Package subscriptions includes Subscriptions related APIs |
Package transactions Transactions related API
|
Package transactions Transactions related API |
Package webhooks webhooks related Utilities
|
Package webhooks webhooks related Utilities |
Click to show internal directories.
Click to hide internal directories.