diff --git a/customers.go b/customers.go index 5fbcc05..0d9e54d 100644 --- a/customers.go +++ b/customers.go @@ -184,5 +184,6 @@ func (c *CustomersClient) GenerateCustomerAuthenticationToken(ctx context.Contex if err := c.doer.Do(ctx, "POST", "/customers/{customer_id}/auth-token", req, &res); err != nil { return nil, err } + return res, nil } diff --git a/discounts.go b/discounts.go index 25fd5e2..7a6dbf5 100644 --- a/discounts.go +++ b/discounts.go @@ -106,6 +106,7 @@ type CreateDiscountRequest struct { EnabledForCheckout *bool `json:"enabled_for_checkout,omitempty"` /* Code: Unique code that customers can use to redeem this discount at checkout. Use letters and numbers only, up to 16 characters. Not case-sensitive. + If omitted and `enabled_for_checkout` is `true`, Paddle generates a random 10-character code. */ Code *string `json:"code,omitempty"` diff --git a/reports.go b/reports.go index d789378..2663b24 100644 --- a/reports.go +++ b/reports.go @@ -44,6 +44,13 @@ var ErrReportFailed = &paddleerr.Error{ Type: paddleerr.ErrorTypeRequestError, } +// ErrReportEmpty represents a `report_empty` error. +// See https://developer.paddle.com/errors/reports/report_empty for more information. +var ErrReportEmpty = &paddleerr.Error{ + Code: "report_empty", + Type: paddleerr.ErrorTypeRequestError, +} + /* ReportStatus: Status of this report. Set automatically by Paddle. diff --git a/shared.go b/shared.go index a9bf0bf..b9ac19f 100644 --- a/shared.go +++ b/shared.go @@ -38,13 +38,6 @@ var ErrAuthenticationMalformed = &paddleerr.Error{ Type: paddleerr.ErrorTypeRequestError, } -// ErrInvalidClientToken represents a `invalid_client_token` error. -// See https://developer.paddle.com/errors/shared/invalid_client_token for more information. -var ErrInvalidClientToken = &paddleerr.Error{ - Code: "invalid_client_token", - Type: paddleerr.ErrorTypeRequestError, -} - // ErrInvalidToken represents a `invalid_token` error. // See https://developer.paddle.com/errors/shared/invalid_token for more information. var ErrInvalidToken = &paddleerr.Error{ @@ -52,6 +45,13 @@ var ErrInvalidToken = &paddleerr.Error{ Type: paddleerr.ErrorTypeRequestError, } +// ErrInvalidClientToken represents a `invalid_client_token` error. +// See https://developer.paddle.com/errors/shared/invalid_client_token for more information. +var ErrInvalidClientToken = &paddleerr.Error{ + Code: "invalid_client_token", + Type: paddleerr.ErrorTypeRequestError, +} + // ErrPaddleBillingNotEnabled represents a `paddle_billing_not_enabled` error. // See https://developer.paddle.com/errors/shared/paddle_billing_not_enabled for more information. var ErrPaddleBillingNotEnabled = &paddleerr.Error{ @@ -115,6 +115,13 @@ var ErrTooManyRequests = &paddleerr.Error{ Type: paddleerr.ErrorTypeAPIError, } +// ErrTemporarilyUnavailable represents a `temporarily_unavailable` error. +// See https://developer.paddle.com/errors/shared/temporarily_unavailable for more information. +var ErrTemporarilyUnavailable = &paddleerr.Error{ + Code: "temporarily_unavailable", + Type: paddleerr.ErrorTypeAPIError, +} + // ErrEntityArchived represents a `entity_archived` error. // See https://developer.paddle.com/errors/shared/entity_archived for more information. var ErrEntityArchived = &paddleerr.Error{ @@ -185,6 +192,13 @@ var ErrRequestHeadersTooLarge = &paddleerr.Error{ Type: paddleerr.ErrorTypeRequestError, } +// ErrRequestBodyTooLarge represents a `request_body_too_large` error. +// See https://developer.paddle.com/errors/shared/request_body_too_large for more information. +var ErrRequestBodyTooLarge = &paddleerr.Error{ + Code: "request_body_too_large", + Type: paddleerr.ErrorTypeRequestError, +} + // CatalogType: Return items that match the specified type.. type CatalogType string diff --git a/transactions.go b/transactions.go index 55dff86..5c94f77 100644 --- a/transactions.go +++ b/transactions.go @@ -296,6 +296,20 @@ var ErrTransactionNothingToRevise = &paddleerr.Error{ Type: paddleerr.ErrorTypeRequestError, } +// ErrTransactionReviseMissingBusinessName represents a `transaction_revise_missing_business_name` error. +// See https://developer.paddle.com/errors/transactions/transaction_revise_missing_business_name for more information. +var ErrTransactionReviseMissingBusinessName = &paddleerr.Error{ + Code: "transaction_revise_missing_business_name", + Type: paddleerr.ErrorTypeRequestError, +} + +// ErrTransactionAddressRegionOrCityAlreadySet represents a `transaction_address_region_or_city_already_set` error. +// See https://developer.paddle.com/errors/transactions/transaction_address_region_or_city_already_set for more information. +var ErrTransactionAddressRegionOrCityAlreadySet = &paddleerr.Error{ + Code: "transaction_address_region_or_city_already_set", + Type: paddleerr.ErrorTypeRequestError, +} + // AdjustmentTotalsBreakdown: Breakdown of the total adjustments by adjustment action. type AdjustmentTotalsBreakdown struct { // Credit: Total amount of credit adjustments.