Documentation
¶
Index ¶
- type Address
- type CancelSubscriptionResponse
- type Card
- type CatalogObject
- type CatalogResponse
- type CreateCardRequest
- type CreateCardResponse
- type CreateCustomerRequest
- type CreateCustomerResponse
- type CreateSubscriptionRequest
- type CreateSubscriptionResponse
- type Customer
- type CustomerPreferences
- type CustomerTaxIds
- type DeleteCustomerRequest
- type DeleteCustomerResponse
- type DisableCardResponse
- type Error
- type ListCardsRequest
- type ListCardsResponse
- type ListCatalogRequest
- type ListCatalogResponse
- type Money
- type Phase
- type Price
- type Pricing
- type RetrieveCardResponse
- type RetrieveCustomerResponse
- type SearchSubscriptionsQuery
- type SearchSubscriptionsRequest
- type SearchSubscriptionsResponse
- type Subscription
- type SubscriptionAction
- type SubscriptionPlanData
- type SubscriptionPlanVariation
- type SubscriptionPlanVariationData
- type SubscriptionSource
- type UpdateSubscriptionRequest
- type UpdateSubscriptionResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶ added in v0.1.3
type Address struct {
AddressLine1 string `json:"address_line_1,omitempty"`
AddressLine2 string `json:"address_line_2,omitempty"`
AddressLine3 string `json:"address_line_3,omitempty"`
Locality string `json:"locality,omitempty"`
Sublocality string `json:"sublocality,omitempty"`
Sublocality2 string `json:"sublocality_2,omitempty"`
Sublocality3 string `json:"sublocality_3,omitempty"`
AdministrativeDistrictLevel1 string `json:"administrative_district_level_1,omitempty"`
AdministrativeDistrictLevel2 string `json:"administrative_district_level_2,omitempty"`
AdministrativeDistrictLevel3 string `json:"administrative_district_level_3,omitempty"`
PostalCode string `json:"postal_code,omitempty"`
Country string `json:"country,omitempty"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
}
Address represents a postal address in a country.
type CancelSubscriptionResponse ¶ added in v0.1.11
type CancelSubscriptionResponse struct {
Subscription Subscription `json:"subscription,omitempty"`
SubscriptionAction SubscriptionAction `json:"subscription_action,omitempty"`
Errors []Error `json:"errors,omitempty"`
}
type Card ¶ added in v0.1.3
type Card struct {
ID string `json:"id,omitempty"`
CardBrand string `json:"card_brand,omitempty"`
Last4 string `json:"last_4,omitempty"`
ExpMonth int64 `json:"exp_month,omitempty"`
ExpYear int64 `json:"exp_year,omitempty"`
CardholderName string `json:"cardholder_name,omitempty"`
BillingAddress Address `json:"billing_address,omitempty"`
Fingerprint string `json:"fingerprint,omitempty"`
CustomerId string `json:"customer_id,omitempty"`
MerchantId string `json:"merchant_id,omitempty"`
ReferenceId string `json:"reference_id,omitempty"`
Enabled bool `json:"enabled,omitempty"`
CardType string `json:"card_type,omitempty"`
PrepaidType string `json:"prepaid_type,omitempty"`
Bin string `json:"bin,omitempty"`
Version int64 `json:"version,omitempty"`
CardCoBrand string `json:"card_co_brand,omitempty"`
}
Card represents the payment details of a card to be used for payments.
type CatalogObject ¶ added in v0.1.4
type CatalogObject struct {
Type string `json:"type"` // Correctly matches "SUBSCRIPTION_PLAN" or other types as per the JSON
ID string `json:"id"`
UpdatedAt string `json:"updated_at"`
CreatedAt string `json:"created_at"`
Version int64 `json:"version"`
IsDeleted bool `json:"is_deleted"`
PresentAtAllLocations bool `json:"present_at_all_locations"`
// SubscriptionPlanData shows only if the type is SUBSCRIPTION_PLAN
SubscriptionPlanData SubscriptionPlanData `json:"subscription_plan_data,omitempty"`
// SubscriptionPlanVariationData shows only if the type is SUBSCRIPTION_PLAN_VARIATION
SubscriptionPlanVariationData SubscriptionPlanVariationData `json:"subscription_plan_variation_data,omitempty"`
}
type CatalogResponse ¶ added in v0.1.15
type CatalogResponse struct {
Errors []Error `json:"errors,omitempty"`
Cursor string `json:"cursor,omitempty"`
Object CatalogObject `json:"object,omitempty"`
}
type CreateCardRequest ¶ added in v0.1.4
type CreateCardRequest struct {
IdempotencyKey string `json:"idempotency_key"`
SourceId string `json:"source_id"`
VerificationToken string `json:"verification_token,omitempty"`
Card Card `json:"card"`
}
CreateCardRequest creates a card from the source (nonce, payment id, etc).t
type CreateCardResponse ¶ added in v0.1.4
type CreateCardResponse struct {
Errors []Error `json:"errors,omitempty"`
Card Card `json:"card,omitempty"`
}
CreateCardResponse Defines the fields that are included in the response body of a request to the [CreateCard]($e/Cards/CreateCard) endpoint. Note: if there are errors processing the request, the card field will not be present.
type CreateCustomerRequest ¶
type CreateCustomerRequest struct {
IdempotencyKey string `json:"idempotency_key"`
GivenName string `json:"given_name,omitempty"`
FamilyName string `json:"family_name,omitempty"`
CompanyName string `json:"company_name,omitempty"`
Nickname string `json:"nickname,omitempty"`
EmailAddress string `json:"email_address,omitempty"`
Address Address `json:"address,omitempty"`
PhoneNumber string `json:"phone_number,omitempty"`
ReferenceId string `json:"reference_id"`
Note string `json:"note,omitempty"`
Birthday string `json:"birthday,omitempty"`
TaxIds CustomerTaxIds `json:"tax_ids,omitempty"`
}
CreateCustomerRequest defines the body parameters that can be included in a request to the `CreateCustomer` endpoint.
type CreateCustomerResponse ¶
type CreateCustomerResponse struct {
Customer Customer `json:"customer"`
Errors []Error `json:"errors"`
}
CreateCustomerResponse defines the fields that are included in the response body of a request to the `CreateCustomer` endpoint. Either `errors` or `customer` is present in a given response (never both).
type CreateSubscriptionRequest ¶ added in v0.1.4
type CreateSubscriptionRequest struct {
CustomerId string `json:"customer_id"`
LocationId string `json:"location_id"`
PlanId string `json:"plan_id"`
PlanVariationId string `json:"plan_variation_id"`
IdempotencyKey string `json:"idempotency_key"`
StartDate string `json:"start_date,omitempty"`
CanceledDate string `json:"canceled_date,omitempty"`
TaxPercentage string `json:"tax_percentage,omitempty"`
PriceOverrideMoney Money `json:"price_override_money,omitempty"`
CardId string `json:"card_id,omitempty"`
Timezone string `json:"timezone,omitempty"`
Source SubscriptionSource `json:"source,omitempty"`
}
CreateSubscriptionRequest Defines input parameters in a request to the [CreateSubscription]($e/Subscriptions/CreateSubscription) endpoint.
type CreateSubscriptionResponse ¶ added in v0.1.4
type CreateSubscriptionResponse struct {
Errors []Error `json:"errors,omitempty"`
Subscription Subscription `json:"subscription,omitempty"`
}
type Customer ¶ added in v0.1.3
type Customer struct {
ID string `json:"id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Cards []Card `json:"cards"`
GivenName string `json:"given_name"`
FamilyName string `json:"family_name"`
Nickname string `json:"nickname"`
CompanyName string `json:"company_name"`
EmailAddress string `json:"email_address"`
Address Address `json:"address"`
PhoneNumber string `json:"phone_number"`
Birthday string `json:"birthday"`
ReferenceId string `json:"reference_id"`
Note string `json:"note"`
Preferences CustomerPreferences `json:"preferences"`
CreationSource string `json:"creation_source"`
GroupIds []string `json:"group_ids"`
SegmentIds []string `json:"segment_ids"`
Version int64 `json:"version"`
TaxIds CustomerTaxIds `json:"tax_ids"`
}
Customer represents a Square customer profile in the Customer Directory of a Square seller
type CustomerPreferences ¶ added in v0.1.3
type CustomerPreferences struct {
EmailUnsubscribed bool `json:"email_unsubscribed"`
}
CustomerPreferences represents communication preferences for the customer profile.
type CustomerTaxIds ¶ added in v0.1.3
type CustomerTaxIds struct {
EuVat string `json:"eu_vat"`
}
Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom.
type DeleteCustomerRequest ¶ added in v0.1.11
type DeleteCustomerRequest struct {
CustomerId string `json:"customer_id"`
Version int64 `json:"version"`
}
DeleteCustomerRequest represents the request body for DeleteCustomer API
type DeleteCustomerResponse ¶ added in v0.1.11
type DeleteCustomerResponse struct {
Errors []Error `json:"errors"`
}
DeleteCustomerResponse defines the fields that are included in the response body of a request to the `DeleteCustomer` endpoint.
type DisableCardResponse ¶ added in v0.1.11
type Error ¶ added in v0.1.3
type Error struct {
Category string `json:"category"`
Code string `json:"code"`
Detail string `json:"detail"`
Field string `json:"field"`
}
Error represents an error encountered during a request to the Connect API.
type ListCardsRequest ¶ added in v0.1.11
type ListCardsResponse ¶ added in v0.1.11
type ListCatalogRequest ¶ added in v0.1.4
type ListCatalogResponse ¶ added in v0.1.4
type ListCatalogResponse struct {
Errors []Error `json:"errors,omitempty"`
Cursor string `json:"cursor,omitempty"`
Objects []CatalogObject `json:"objects,omitempty"`
}
type RetrieveCardResponse ¶ added in v0.1.11
type RetrieveCustomerResponse ¶ added in v0.1.11
type SearchSubscriptionsQuery ¶ added in v0.1.20
type SearchSubscriptionsQuery struct {
// Define the fields as per the Square API documentation
FilterConditions map[string]interface{} `json:"filter,omitempty"`
}
SearchSubscriptionsQuery represents the query conditions for searching subscriptions
type SearchSubscriptionsRequest ¶ added in v0.1.20
type SearchSubscriptionsRequest struct {
Cursor string `json:"cursor,omitempty"`
Limit int `json:"limit,omitempty"`
Query SearchSubscriptionsQuery `json:"query,omitempty"`
Include []string `json:"include,omitempty"`
}
SearchSubscriptionsRequest represents the request body for searching subscriptions
type SearchSubscriptionsResponse ¶ added in v0.1.20
type SearchSubscriptionsResponse struct {
Errors []Error `json:"errors,omitempty"`
Subscriptions []Subscription `json:"subscriptions,omitempty"`
Cursor string `json:"cursor,omitempty"`
}
SearchSubscriptionsResponse represents the response body for searching subscriptions
type Subscription ¶ added in v0.1.4
type Subscription struct {
ID string `json:"id,omitempty"`
LocationId string `json:"location_id,omitempty"`
PlanId string `json:"plan_id,omitempty"`
CustomerId string `json:"customer_id,omitempty"`
StartDate string `json:"start_date,omitempty"`
CanceledDate string `json:"canceled_date,omitempty"`
ChargedThroughDate string `json:"charged_through_date,omitempty"`
Status string `json:"status,omitempty"`
TaxPercentage string `json:"tax_percentage,omitempty"`
InvoiceIds []string `json:"invoice_ids,omitempty"`
PriceOverrideMoney Money `json:"price_override_money,omitempty"`
Version int64 `json:"version,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
CardId string `json:"card_id,omitempty"`
Timezone string `json:"timezone,omitempty"`
Source SubscriptionSource `json:"source,omitempty"`
Actions []SubscriptionAction `json:"actions,omitempty"`
}
type SubscriptionAction ¶ added in v0.1.4
type SubscriptionPlanData ¶ added in v0.1.15
type SubscriptionPlanData struct {
Name string `json:"name"`
SubscriptionPlanVariations []SubscriptionPlanVariation `json:"subscription_plan_variations,omitempty"`
Variations []SubscriptionPlanVariation `json:"variations,omitempty"`
EligibleItemIds []string `json:"eligible_item_ids"`
AllItems bool `json:"all_items"`
}
type SubscriptionPlanVariation ¶ added in v0.1.15
type SubscriptionPlanVariation struct {
Type string `json:"type"` // "SUBSCRIPTION_PLAN_VARIATION"
ID string `json:"id"`
UpdatedAt string `json:"updated_at"`
CreatedAt string `json:"created_at"`
Version int64 `json:"version"`
IsDeleted bool `json:"is_deleted"`
PresentAtAllLocations bool `json:"present_at_all_locations"`
SubscriptionPlanVariationData SubscriptionPlanVariationData `json:"subscription_plan_variation_data"`
}
type SubscriptionPlanVariationData ¶ added in v0.1.15
type SubscriptionSource ¶ added in v0.1.4
type SubscriptionSource struct {
Name string `json:"name,omitempty"`
}
type UpdateSubscriptionRequest ¶ added in v0.1.11
type UpdateSubscriptionRequest struct {
Subscription Subscription `json:"subscription,omitempty"`
}
type UpdateSubscriptionResponse ¶ added in v0.1.11
type UpdateSubscriptionResponse struct {
Subscription Subscription `json:"subscription,omitempty"`
Errors []Error `json:"errors,omitempty"`
}
Source Files
¶
- address.go
- cancel_subscription_response.go
- card.go
- catalog_object.go
- create_card_request.go
- create_card_response.go
- create_customer_request.go
- create_customer_response.go
- create_subscription_request.go
- create_subscription_response.go
- customer.go
- customer_preferences.go
- customer_tax_ids.go
- delete_customer_request.go
- delete_customer_response.go
- disable_card_response.go
- error.go
- list_cards_request.go
- list_cards_response.go
- list_catalog_request.go
- list_catalog_response.go
- money.go
- retrieve_card_response.go
- retrieve_customer_response.go
- search_subscription_request.go
- search_subscription_response.go
- subscription.go
- subscription_action.go
- subscription_source.go
- update_subscription_request.go
- update_subscription_response.go