diff --git a/README.md b/README.md
index f6e9ddb..469fb4f 100644
--- a/README.md
+++ b/README.md
@@ -38,10 +38,10 @@ The following section explains how to use the advancedbilling library in a new p
To use the package in your application, you can install the package from [pkg.go.dev](https://pkg.go.dev/) using the following command:
```bash
-$ go get github.com/maxio-com/ab-golang-sdk@v0.4.1
+$ go get github.com/maxio-com/ab-golang-sdk@v0.4.2
```
-You can also view the package at: https://pkg.go.dev/github.com/maxio-com/ab-golang-sdk@v0.4.1
+You can also view the package at: https://pkg.go.dev/github.com/maxio-com/ab-golang-sdk@v0.4.2
## Initialize the API Client
diff --git a/client.go b/client.go
index c42a73c..b19c20c 100644
--- a/client.go
+++ b/client.go
@@ -98,7 +98,7 @@ func NewClient(configuration Configuration) ClientInterface {
configuration: configuration,
}
- client.userAgent = utilities.UpdateUserAgent("AB SDK Go:0.4.1 on OS {os-info}")
+ client.userAgent = utilities.UpdateUserAgent("AB SDK Go:0.4.2 on OS {os-info}")
client.callBuilderFactory = callBuilderHandler(
func(server string) string {
if server == "" {
diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md
index f718c20..065d561 100644
--- a/doc/controllers/proforma-invoices.md
+++ b/doc/controllers/proforma-invoices.md
@@ -447,9 +447,9 @@ body := models.CreateSubscriptionRequest{
Subscription: models.CreateSubscription{
ProductHandle: models.ToPointer("gold-product"),
CustomerAttributes: models.ToPointer(models.CustomerAttributes{
- FirstName: models.ToPointer("Myra"),
- LastName: models.ToPointer("Maisel"),
- Email: models.ToPointer("mmaisel@example.com"),
+ FirstName: models.ToPointer("Myra"),
+ LastName: models.ToPointer("Maisel"),
+ Email: models.ToPointer("mmaisel@example.com"),
}),
},
}
@@ -513,9 +513,9 @@ body := models.CreateSubscriptionRequest{
Subscription: models.CreateSubscription{
ProductHandle: models.ToPointer("gold-plan"),
CustomerAttributes: models.ToPointer(models.CustomerAttributes{
- FirstName: models.ToPointer("first"),
- LastName: models.ToPointer("last"),
- Email: models.ToPointer("flast@example.com"),
+ FirstName: models.ToPointer("first"),
+ LastName: models.ToPointer("last"),
+ Email: models.ToPointer("flast@example.com"),
}),
},
}
diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md
index 000b818..c74743a 100644
--- a/doc/controllers/subscriptions.md
+++ b/doc/controllers/subscriptions.md
@@ -700,18 +700,18 @@ body := models.CreateSubscriptionRequest{
Subscription: models.CreateSubscription{
ProductHandle: models.ToPointer("basic"),
CustomerAttributes: models.ToPointer(models.CustomerAttributes{
- FirstName: models.ToPointer("Joe"),
- LastName: models.ToPointer("Blow"),
- Email: models.ToPointer("joe@example.com"),
- Organization: models.ToPointer("Acme"),
- Reference: models.ToPointer("XYZ"),
- Address: models.ToPointer("123 Mass Ave."),
- Address2: models.NewOptional(models.ToPointer("address_24")),
- City: models.ToPointer("Boston"),
- State: models.ToPointer("MA"),
- Zip: models.ToPointer("02120"),
- Country: models.ToPointer("US"),
- Phone: models.ToPointer("(617) 111 - 0000"),
+ FirstName: models.ToPointer("Joe"),
+ LastName: models.ToPointer("Blow"),
+ Email: models.ToPointer("joe@example.com"),
+ Organization: models.ToPointer("Acme"),
+ Reference: models.ToPointer("XYZ"),
+ Address: models.ToPointer("123 Mass Ave."),
+ Address2: models.NewOptional(models.ToPointer("address_24")),
+ City: models.ToPointer("Boston"),
+ State: models.ToPointer("MA"),
+ Zip: models.ToPointer("02120"),
+ Country: models.ToPointer("US"),
+ Phone: models.ToPointer("(617) 111 - 0000"),
}),
CreditCardAttributes: models.ToPointer(models.PaymentProfileAttributes{
FirstName: models.ToPointer("Joe"),
diff --git a/doc/models/create-invoice-payment.md b/doc/models/create-invoice-payment.md
index b5a5711..ffadcb4 100644
--- a/doc/models/create-invoice-payment.md
+++ b/doc/models/create-invoice-payment.md
@@ -10,10 +10,11 @@
| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `Amount` | [`*models.CreateInvoicePaymentAmount`](../../doc/models/containers/create-invoice-payment-amount.md) | Optional | This is a container for one-of cases. |
-| `Memo` | `*string` | Optional | A description to be attached to the payment. |
+| `Memo` | `*string` | Optional | A description to be attached to the payment. Applicable only to `external` payments. |
| `Method` | [`*models.InvoicePaymentMethodType`](../../doc/models/invoice-payment-method-type.md) | Optional | The type of payment method used. Defaults to other. |
-| `Details` | `*string` | Optional | Additional information related to the payment method (eg. Check #) |
+| `Details` | `*string` | Optional | Additional information related to the payment method (eg. Check #). Applicable only to `external` payments. |
| `PaymentProfileId` | `*int` | Optional | The ID of the payment profile to be used for the payment. |
+| `ReceivedOn` | `*time.Time` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. Applicable only to
`external` payments. |
## Example (as JSON)
diff --git a/doc/models/customer-attributes.md b/doc/models/customer-attributes.md
index 56dec5a..33c5d8b 100644
--- a/doc/models/customer-attributes.md
+++ b/doc/models/customer-attributes.md
@@ -28,6 +28,7 @@
| `Metafields` | `map[string]string` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. |
| `ParentId` | `models.Optional[int]` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. |
| `SalesforceId` | `models.Optional[string]` | Optional | (Optional) The Salesforce ID of the customer. |
+| `DefaultAutoRenewalProfileId` | `models.Optional[int]` | Optional | (Optional) The default auto-renewal profile ID for the customer |
## Example (as JSON)
diff --git a/doc/models/customer.md b/doc/models/customer.md
index 51aeefe..f04b7cf 100644
--- a/doc/models/customer.md
+++ b/doc/models/customer.md
@@ -27,7 +27,7 @@
| `Country` | `models.Optional[string]` | Optional | The customer shipping address country |
| `CountryName` | `models.Optional[string]` | Optional | The customer's full name of country |
| `Phone` | `models.Optional[string]` | Optional | The phone number of the customer |
-| `Verified` | `models.Optional[bool]` | Optional | Is the customer verified to use ACH as a payment method. Available only on Authorize.Net gateway |
+| `Verified` | `models.Optional[bool]` | Optional | Is the customer verified to use ACH as a payment method. |
| `PortalCustomerCreatedAt` | `models.Optional[time.Time]` | Optional | The timestamp of when the Billing Portal entry was created at for the customer |
| `PortalInviteLastSentAt` | `models.Optional[time.Time]` | Optional | The timestamp of when the Billing Portal invite was last sent at |
| `PortalInviteLastAcceptedAt` | `models.Optional[time.Time]` | Optional | The timestamp of when the Billing Portal invite was last accepted |
@@ -37,6 +37,8 @@
| `Locale` | `models.Optional[string]` | Optional | The locale for the customer to identify language-region |
| `DefaultSubscriptionGroupUid` | `models.Optional[string]` | Optional | - |
| `SalesforceId` | `models.Optional[string]` | Optional | The Salesforce ID for the customer |
+| `TaxExemptReason` | `models.Optional[string]` | Optional | The Tax Exemption Reason Code for the customer |
+| `DefaultAutoRenewalProfileId` | `models.Optional[int]` | Optional | The default auto-renewal profile ID for the customer |
## Example (as JSON)
diff --git a/doc/models/invoice-payment.md b/doc/models/invoice-payment.md
index 1b424dc..da1e5d0 100644
--- a/doc/models/invoice-payment.md
+++ b/doc/models/invoice-payment.md
@@ -19,6 +19,8 @@
| `GatewayHandle` | `models.Optional[string]` | Optional | - |
| `GatewayUsed` | `*string` | Optional | - |
| `GatewayTransactionId` | `models.Optional[string]` | Optional | The transaction ID for the payment as returned from the payment gateway |
+| `ReceivedOn` | `models.Optional[time.Time]` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. Applicable only to
`external` payments. |
+| `Uid` | `*string` | Optional | - |
## Example (as JSON)
diff --git a/doc/models/update-subscription.md b/doc/models/update-subscription.md
index 5475731..02a0d31 100644
--- a/doc/models/update-subscription.md
+++ b/doc/models/update-subscription.md
@@ -26,6 +26,8 @@
| `Components` | [`[]models.UpdateSubscriptionComponent`](../../doc/models/update-subscription-component.md) | Optional | (Optional) An array of component ids and custom prices to be added to the subscription. |
| `DunningCommunicationDelayEnabled` | `models.Optional[bool]` | Optional | Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute. |
| `DunningCommunicationDelayTimeZone` | `models.Optional[string]` | Optional | Time zone for the Dunning Communication Delay feature. |
+| `ProductPricePointId` | `*int` | Optional | Set to change the current product's price point. |
+| `ProductPricePointHandle` | `*string` | Optional | Set to change the current product's price point. |
## Example (as JSON)
diff --git a/models/create_invoice_payment.go b/models/create_invoice_payment.go
index 92bd223..bfcf2d0 100644
--- a/models/create_invoice_payment.go
+++ b/models/create_invoice_payment.go
@@ -7,20 +7,25 @@ package models
import (
"encoding/json"
+ "log"
+ "time"
)
// CreateInvoicePayment represents a CreateInvoicePayment struct.
type CreateInvoicePayment struct {
// A string of the dollar amount to be refunded (eg. "10.50" => $10.50)
Amount *CreateInvoicePaymentAmount `json:"amount,omitempty"`
- // A description to be attached to the payment.
+ // A description to be attached to the payment. Applicable only to `external` payments.
Memo *string `json:"memo,omitempty"`
// The type of payment method used. Defaults to other.
Method *InvoicePaymentMethodType `json:"method,omitempty"`
- // Additional information related to the payment method (eg. Check #)
+ // Additional information related to the payment method (eg. Check #). Applicable only to `external` payments.
Details *string `json:"details,omitempty"`
// The ID of the payment profile to be used for the payment.
PaymentProfileId *int `json:"payment_profile_id,omitempty"`
+ // Date reflecting when the payment was received from a customer. Must be in the past. Applicable only to
+ // `external` payments.
+ ReceivedOn *time.Time `json:"received_on,omitempty"`
AdditionalProperties map[string]any `json:"_"`
}
@@ -51,6 +56,9 @@ func (c CreateInvoicePayment) toMap() map[string]any {
if c.PaymentProfileId != nil {
structMap["payment_profile_id"] = c.PaymentProfileId
}
+ if c.ReceivedOn != nil {
+ structMap["received_on"] = c.ReceivedOn.Format(DEFAULT_DATE)
+ }
return structMap
}
@@ -62,7 +70,7 @@ func (c *CreateInvoicePayment) UnmarshalJSON(input []byte) error {
if err != nil {
return err
}
- additionalProperties, err := UnmarshalAdditionalProperties(input, "amount", "memo", "method", "details", "payment_profile_id")
+ additionalProperties, err := UnmarshalAdditionalProperties(input, "amount", "memo", "method", "details", "payment_profile_id", "received_on")
if err != nil {
return err
}
@@ -73,6 +81,13 @@ func (c *CreateInvoicePayment) UnmarshalJSON(input []byte) error {
c.Method = temp.Method
c.Details = temp.Details
c.PaymentProfileId = temp.PaymentProfileId
+ if temp.ReceivedOn != nil {
+ ReceivedOnVal, err := time.Parse(DEFAULT_DATE, *temp.ReceivedOn)
+ if err != nil {
+ log.Fatalf("Cannot Parse received_on as % s format.", DEFAULT_DATE)
+ }
+ c.ReceivedOn = &ReceivedOnVal
+ }
return nil
}
@@ -83,4 +98,5 @@ type tempCreateInvoicePayment struct {
Method *InvoicePaymentMethodType `json:"method,omitempty"`
Details *string `json:"details,omitempty"`
PaymentProfileId *int `json:"payment_profile_id,omitempty"`
+ ReceivedOn *string `json:"received_on,omitempty"`
}
diff --git a/models/customer.go b/models/customer.go
index 644a8fe..1ac9fe1 100644
--- a/models/customer.go
+++ b/models/customer.go
@@ -49,7 +49,7 @@ type Customer struct {
CountryName Optional[string] `json:"country_name"`
// The phone number of the customer
Phone Optional[string] `json:"phone"`
- // Is the customer verified to use ACH as a payment method. Available only on Authorize.Net gateway
+ // Is the customer verified to use ACH as a payment method.
Verified Optional[bool] `json:"verified"`
// The timestamp of when the Billing Portal entry was created at for the customer
PortalCustomerCreatedAt Optional[time.Time] `json:"portal_customer_created_at"`
@@ -68,6 +68,10 @@ type Customer struct {
DefaultSubscriptionGroupUid Optional[string] `json:"default_subscription_group_uid"`
// The Salesforce ID for the customer
SalesforceId Optional[string] `json:"salesforce_id"`
+ // The Tax Exemption Reason Code for the customer
+ TaxExemptReason Optional[string] `json:"tax_exempt_reason"`
+ // The default auto-renewal profile ID for the customer
+ DefaultAutoRenewalProfileId Optional[int] `json:"default_auto_renewal_profile_id"`
AdditionalProperties map[string]any `json:"_"`
}
@@ -266,6 +270,20 @@ func (c Customer) toMap() map[string]any {
structMap["salesforce_id"] = nil
}
}
+ if c.TaxExemptReason.IsValueSet() {
+ if c.TaxExemptReason.Value() != nil {
+ structMap["tax_exempt_reason"] = c.TaxExemptReason.Value()
+ } else {
+ structMap["tax_exempt_reason"] = nil
+ }
+ }
+ if c.DefaultAutoRenewalProfileId.IsValueSet() {
+ if c.DefaultAutoRenewalProfileId.Value() != nil {
+ structMap["default_auto_renewal_profile_id"] = c.DefaultAutoRenewalProfileId.Value()
+ } else {
+ structMap["default_auto_renewal_profile_id"] = nil
+ }
+ }
return structMap
}
@@ -277,7 +295,7 @@ func (c *Customer) UnmarshalJSON(input []byte) error {
if err != nil {
return err
}
- additionalProperties, err := UnmarshalAdditionalProperties(input, "first_name", "last_name", "email", "cc_emails", "organization", "reference", "id", "created_at", "updated_at", "address", "address_2", "city", "state", "state_name", "zip", "country", "country_name", "phone", "verified", "portal_customer_created_at", "portal_invite_last_sent_at", "portal_invite_last_accepted_at", "tax_exempt", "vat_number", "parent_id", "locale", "default_subscription_group_uid", "salesforce_id")
+ additionalProperties, err := UnmarshalAdditionalProperties(input, "first_name", "last_name", "email", "cc_emails", "organization", "reference", "id", "created_at", "updated_at", "address", "address_2", "city", "state", "state_name", "zip", "country", "country_name", "phone", "verified", "portal_customer_created_at", "portal_invite_last_sent_at", "portal_invite_last_accepted_at", "tax_exempt", "vat_number", "parent_id", "locale", "default_subscription_group_uid", "salesforce_id", "tax_exempt_reason", "default_auto_renewal_profile_id")
if err != nil {
return err
}
@@ -344,6 +362,8 @@ func (c *Customer) UnmarshalJSON(input []byte) error {
c.Locale = temp.Locale
c.DefaultSubscriptionGroupUid = temp.DefaultSubscriptionGroupUid
c.SalesforceId = temp.SalesforceId
+ c.TaxExemptReason = temp.TaxExemptReason
+ c.DefaultAutoRenewalProfileId = temp.DefaultAutoRenewalProfileId
return nil
}
@@ -377,4 +397,6 @@ type tempCustomer struct {
Locale Optional[string] `json:"locale"`
DefaultSubscriptionGroupUid Optional[string] `json:"default_subscription_group_uid"`
SalesforceId Optional[string] `json:"salesforce_id"`
+ TaxExemptReason Optional[string] `json:"tax_exempt_reason"`
+ DefaultAutoRenewalProfileId Optional[int] `json:"default_auto_renewal_profile_id"`
}
diff --git a/models/customer_attributes.go b/models/customer_attributes.go
index 40bcede..8402b8d 100644
--- a/models/customer_attributes.go
+++ b/models/customer_attributes.go
@@ -12,43 +12,45 @@ import (
// CustomerAttributes represents a CustomerAttributes struct.
type CustomerAttributes struct {
// The first name of the customer. Required when creating a customer via attributes.
- FirstName *string `json:"first_name,omitempty"`
+ FirstName *string `json:"first_name,omitempty"`
// The last name of the customer. Required when creating a customer via attributes.
- LastName *string `json:"last_name,omitempty"`
+ LastName *string `json:"last_name,omitempty"`
// The email address of the customer. Required when creating a customer via attributes.
- Email *string `json:"email,omitempty"`
+ Email *string `json:"email,omitempty"`
// A list of emails that should be cc’d on all customer communications. Optional.
- CcEmails *string `json:"cc_emails,omitempty"`
+ CcEmails *string `json:"cc_emails,omitempty"`
// The organization/company of the customer. Optional.
- Organization *string `json:"organization,omitempty"`
+ Organization *string `json:"organization,omitempty"`
// A customer “reference”, or unique identifier from your app, stored in Chargify. Can be used so that you may reference your customer’s within Chargify using the same unique value you use in your application. Optional.
- Reference *string `json:"reference,omitempty"`
+ Reference *string `json:"reference,omitempty"`
// (Optional) The customer’s shipping street address (i.e. “123 Main St.”).
- Address *string `json:"address,omitempty"`
+ Address *string `json:"address,omitempty"`
// (Optional) Second line of the customer’s shipping address i.e. “Apt. 100”
- Address2 Optional[string] `json:"address_2"`
+ Address2 Optional[string] `json:"address_2"`
// (Optional) The customer’s shipping address city (i.e. “Boston”).
- City *string `json:"city,omitempty"`
+ City *string `json:"city,omitempty"`
// (Optional) The customer’s shipping address state (i.e. “MA”). This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes.
- State *string `json:"state,omitempty"`
+ State *string `json:"state,omitempty"`
// (Optional) The customer’s shipping address zip code (i.e. “12345”).
- Zip *string `json:"zip,omitempty"`
+ Zip *string `json:"zip,omitempty"`
// (Optional) The customer shipping address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”).
- Country *string `json:"country,omitempty"`
+ Country *string `json:"country,omitempty"`
// (Optional) The phone number of the customer.
- Phone *string `json:"phone,omitempty"`
- Verified *bool `json:"verified,omitempty"`
+ Phone *string `json:"phone,omitempty"`
+ Verified *bool `json:"verified,omitempty"`
// (Optional) The tax_exempt status of the customer. Acceptable values are true or 1 for true and false or 0 for false.
- TaxExempt *bool `json:"tax_exempt,omitempty"`
+ TaxExempt *bool `json:"tax_exempt,omitempty"`
// (Optional) Supplying the VAT number allows EU customer’s to opt-out of the Value Added Tax assuming the merchant address and customer billing address are not within the same EU country. It’s important to omit the country code from the VAT number upon entry. Otherwise, taxes will be assessed upon the purchase.
- VatNumber *string `json:"vat_number,omitempty"`
+ VatNumber *string `json:"vat_number,omitempty"`
// (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet.
- Metafields map[string]string `json:"metafields,omitempty"`
+ Metafields map[string]string `json:"metafields,omitempty"`
// The parent ID in Chargify if applicable. Parent is another Customer object.
- ParentId Optional[int] `json:"parent_id"`
+ ParentId Optional[int] `json:"parent_id"`
// (Optional) The Salesforce ID of the customer.
- SalesforceId Optional[string] `json:"salesforce_id"`
- AdditionalProperties map[string]any `json:"_"`
+ SalesforceId Optional[string] `json:"salesforce_id"`
+ // (Optional) The default auto-renewal profile ID for the customer
+ DefaultAutoRenewalProfileId Optional[int] `json:"default_auto_renewal_profile_id"`
+ AdditionalProperties map[string]any `json:"_"`
}
// MarshalJSON implements the json.Marshaler interface for CustomerAttributes.
@@ -132,6 +134,13 @@ func (c CustomerAttributes) toMap() map[string]any {
structMap["salesforce_id"] = nil
}
}
+ if c.DefaultAutoRenewalProfileId.IsValueSet() {
+ if c.DefaultAutoRenewalProfileId.Value() != nil {
+ structMap["default_auto_renewal_profile_id"] = c.DefaultAutoRenewalProfileId.Value()
+ } else {
+ structMap["default_auto_renewal_profile_id"] = nil
+ }
+ }
return structMap
}
@@ -143,7 +152,7 @@ func (c *CustomerAttributes) UnmarshalJSON(input []byte) error {
if err != nil {
return err
}
- additionalProperties, err := UnmarshalAdditionalProperties(input, "first_name", "last_name", "email", "cc_emails", "organization", "reference", "address", "address_2", "city", "state", "zip", "country", "phone", "verified", "tax_exempt", "vat_number", "metafields", "parent_id", "salesforce_id")
+ additionalProperties, err := UnmarshalAdditionalProperties(input, "first_name", "last_name", "email", "cc_emails", "organization", "reference", "address", "address_2", "city", "state", "zip", "country", "phone", "verified", "tax_exempt", "vat_number", "metafields", "parent_id", "salesforce_id", "default_auto_renewal_profile_id")
if err != nil {
return err
}
@@ -168,28 +177,30 @@ func (c *CustomerAttributes) UnmarshalJSON(input []byte) error {
c.Metafields = temp.Metafields
c.ParentId = temp.ParentId
c.SalesforceId = temp.SalesforceId
+ c.DefaultAutoRenewalProfileId = temp.DefaultAutoRenewalProfileId
return nil
}
// tempCustomerAttributes is a temporary struct used for validating the fields of CustomerAttributes.
type tempCustomerAttributes struct {
- FirstName *string `json:"first_name,omitempty"`
- LastName *string `json:"last_name,omitempty"`
- Email *string `json:"email,omitempty"`
- CcEmails *string `json:"cc_emails,omitempty"`
- Organization *string `json:"organization,omitempty"`
- Reference *string `json:"reference,omitempty"`
- Address *string `json:"address,omitempty"`
- Address2 Optional[string] `json:"address_2"`
- City *string `json:"city,omitempty"`
- State *string `json:"state,omitempty"`
- Zip *string `json:"zip,omitempty"`
- Country *string `json:"country,omitempty"`
- Phone *string `json:"phone,omitempty"`
- Verified *bool `json:"verified,omitempty"`
- TaxExempt *bool `json:"tax_exempt,omitempty"`
- VatNumber *string `json:"vat_number,omitempty"`
- Metafields map[string]string `json:"metafields,omitempty"`
- ParentId Optional[int] `json:"parent_id"`
- SalesforceId Optional[string] `json:"salesforce_id"`
+ FirstName *string `json:"first_name,omitempty"`
+ LastName *string `json:"last_name,omitempty"`
+ Email *string `json:"email,omitempty"`
+ CcEmails *string `json:"cc_emails,omitempty"`
+ Organization *string `json:"organization,omitempty"`
+ Reference *string `json:"reference,omitempty"`
+ Address *string `json:"address,omitempty"`
+ Address2 Optional[string] `json:"address_2"`
+ City *string `json:"city,omitempty"`
+ State *string `json:"state,omitempty"`
+ Zip *string `json:"zip,omitempty"`
+ Country *string `json:"country,omitempty"`
+ Phone *string `json:"phone,omitempty"`
+ Verified *bool `json:"verified,omitempty"`
+ TaxExempt *bool `json:"tax_exempt,omitempty"`
+ VatNumber *string `json:"vat_number,omitempty"`
+ Metafields map[string]string `json:"metafields,omitempty"`
+ ParentId Optional[int] `json:"parent_id"`
+ SalesforceId Optional[string] `json:"salesforce_id"`
+ DefaultAutoRenewalProfileId Optional[int] `json:"default_auto_renewal_profile_id"`
}
diff --git a/models/invoice_payment.go b/models/invoice_payment.go
index 5f22f36..b706695 100644
--- a/models/invoice_payment.go
+++ b/models/invoice_payment.go
@@ -24,6 +24,10 @@ type InvoicePayment struct {
GatewayUsed *string `json:"gateway_used,omitempty"`
// The transaction ID for the payment as returned from the payment gateway
GatewayTransactionId Optional[string] `json:"gateway_transaction_id"`
+ // Date reflecting when the payment was received from a customer. Must be in the past. Applicable only to
+ // `external` payments.
+ ReceivedOn Optional[time.Time] `json:"received_on"`
+ Uid *string `json:"uid,omitempty"`
AdditionalProperties map[string]any `json:"_"`
}
@@ -77,6 +81,21 @@ func (i InvoicePayment) toMap() map[string]any {
structMap["gateway_transaction_id"] = nil
}
}
+ if i.ReceivedOn.IsValueSet() {
+ var ReceivedOnVal *string = nil
+ if i.ReceivedOn.Value() != nil {
+ val := i.ReceivedOn.Value().Format(DEFAULT_DATE)
+ ReceivedOnVal = &val
+ }
+ if i.ReceivedOn.Value() != nil {
+ structMap["received_on"] = ReceivedOnVal
+ } else {
+ structMap["received_on"] = nil
+ }
+ }
+ if i.Uid != nil {
+ structMap["uid"] = i.Uid
+ }
return structMap
}
@@ -88,7 +107,7 @@ func (i *InvoicePayment) UnmarshalJSON(input []byte) error {
if err != nil {
return err
}
- additionalProperties, err := UnmarshalAdditionalProperties(input, "transaction_time", "memo", "original_amount", "applied_amount", "payment_method", "transaction_id", "prepayment", "gateway_handle", "gateway_used", "gateway_transaction_id")
+ additionalProperties, err := UnmarshalAdditionalProperties(input, "transaction_time", "memo", "original_amount", "applied_amount", "payment_method", "transaction_id", "prepayment", "gateway_handle", "gateway_used", "gateway_transaction_id", "received_on", "uid")
if err != nil {
return err
}
@@ -110,6 +129,15 @@ func (i *InvoicePayment) UnmarshalJSON(input []byte) error {
i.GatewayHandle = temp.GatewayHandle
i.GatewayUsed = temp.GatewayUsed
i.GatewayTransactionId = temp.GatewayTransactionId
+ i.ReceivedOn.ShouldSetValue(temp.ReceivedOn.IsValueSet())
+ if temp.ReceivedOn.Value() != nil {
+ ReceivedOnVal, err := time.Parse(DEFAULT_DATE, (*temp.ReceivedOn.Value()))
+ if err != nil {
+ log.Fatalf("Cannot Parse received_on as % s format.", DEFAULT_DATE)
+ }
+ i.ReceivedOn.SetValue(&ReceivedOnVal)
+ }
+ i.Uid = temp.Uid
return nil
}
@@ -125,4 +153,6 @@ type tempInvoicePayment struct {
GatewayHandle Optional[string] `json:"gateway_handle"`
GatewayUsed *string `json:"gateway_used,omitempty"`
GatewayTransactionId Optional[string] `json:"gateway_transaction_id"`
+ ReceivedOn Optional[string] `json:"received_on"`
+ Uid *string `json:"uid,omitempty"`
}
diff --git a/models/update_subscription.go b/models/update_subscription.go
index c27ef06..afe5695 100644
--- a/models/update_subscription.go
+++ b/models/update_subscription.go
@@ -38,6 +38,10 @@ type UpdateSubscription struct {
DunningCommunicationDelayEnabled Optional[bool] `json:"dunning_communication_delay_enabled"`
// Time zone for the Dunning Communication Delay feature.
DunningCommunicationDelayTimeZone Optional[string] `json:"dunning_communication_delay_time_zone"`
+ // Set to change the current product's price point.
+ ProductPricePointId *int `json:"product_price_point_id,omitempty"`
+ // Set to change the current product's price point.
+ ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"`
AdditionalProperties map[string]any `json:"_"`
}
@@ -112,6 +116,12 @@ func (u UpdateSubscription) toMap() map[string]any {
structMap["dunning_communication_delay_time_zone"] = nil
}
}
+ if u.ProductPricePointId != nil {
+ structMap["product_price_point_id"] = u.ProductPricePointId
+ }
+ if u.ProductPricePointHandle != nil {
+ structMap["product_price_point_handle"] = u.ProductPricePointHandle
+ }
return structMap
}
@@ -123,7 +133,7 @@ func (u *UpdateSubscription) UnmarshalJSON(input []byte) error {
if err != nil {
return err
}
- additionalProperties, err := UnmarshalAdditionalProperties(input, "credit_card_attributes", "product_handle", "product_id", "product_change_delayed", "next_product_id", "next_product_price_point_id", "snap_day", "next_billing_at", "payment_collection_method", "receives_invoice_emails", "net_terms", "stored_credential_transaction_id", "reference", "custom_price", "components", "dunning_communication_delay_enabled", "dunning_communication_delay_time_zone")
+ additionalProperties, err := UnmarshalAdditionalProperties(input, "credit_card_attributes", "product_handle", "product_id", "product_change_delayed", "next_product_id", "next_product_price_point_id", "snap_day", "next_billing_at", "payment_collection_method", "receives_invoice_emails", "net_terms", "stored_credential_transaction_id", "reference", "custom_price", "components", "dunning_communication_delay_enabled", "dunning_communication_delay_time_zone", "product_price_point_id", "product_price_point_handle")
if err != nil {
return err
}
@@ -152,6 +162,8 @@ func (u *UpdateSubscription) UnmarshalJSON(input []byte) error {
u.Components = temp.Components
u.DunningCommunicationDelayEnabled = temp.DunningCommunicationDelayEnabled
u.DunningCommunicationDelayTimeZone = temp.DunningCommunicationDelayTimeZone
+ u.ProductPricePointId = temp.ProductPricePointId
+ u.ProductPricePointHandle = temp.ProductPricePointHandle
return nil
}
@@ -174,4 +186,6 @@ type tempUpdateSubscription struct {
Components []UpdateSubscriptionComponent `json:"components,omitempty"`
DunningCommunicationDelayEnabled Optional[bool] `json:"dunning_communication_delay_enabled"`
DunningCommunicationDelayTimeZone Optional[string] `json:"dunning_communication_delay_time_zone"`
+ ProductPricePointId *int `json:"product_price_point_id,omitempty"`
+ ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"`
}