Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat (integrations): add support for integration customers #178

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions customer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ const (
PaymentProviderGocardless CustomerPaymentProvider = "gocardless"
)

type IntegrationType string

const (
IntegrationNetsuite IntegrationType = "netsuite"
)

type CustomerParams struct {
Customer *CustomerInput `json:"customer"`
}
Expand Down Expand Up @@ -79,6 +85,7 @@ type CustomerInput struct {
Timezone string `json:"timezone,omitempty"`
Metadata []CustomerMetadataInput `json:"metadata,omitempty"`
BillingConfiguration CustomerBillingConfigurationInput `json:"billing_configuration,omitempty"`
IntegrationCustomer IntegrationCustomer `json:"integration_customer,omitempty"`
TaxCodes []string `json:"tax_codes,omitempty"`
}

Expand Down Expand Up @@ -106,6 +113,14 @@ type CustomerBillingConfiguration struct {
DocumentLocale string `json:"document_locale,omitempty"`
}

type IntegrationCustomer struct {
ExternalCustomerId string `json:"external_customer_id,omitempty"`
IntegrationType IntegrationType `json:"integration_type,omitempty"`
IntegrationCode bool `json:"integration_code,omitempty"`
SubsidiaryId string `json:"subsidiary_id,omitempty"`
SyncWithProvider bool `json:"sync_with_provider,omitempty"`
}

type CustomerChargeUsage struct {
Units string `json:"units,omitempty"`
EventsCount int `json:"events_count"`
Expand Down Expand Up @@ -198,6 +213,7 @@ type Customer struct {
Phone string `json:"phone,omitempty"`
URL string `json:"url,omitempty"`
BillingConfiguration CustomerBillingConfiguration `json:"billing_configuration,omitempty"`
IntegrationCustomer IntegrationCustomer `json:"integration_customer,omitempty"`
Metadata []MetadataResponse `json:"metadata,omitempty"`
Currency Currency `json:"currency,omitempty"`
Timezone string `json:"timezone,omitempty"`
Expand Down
Loading