Skip to content

Commit

Permalink
[DE-932] Release v0.4.0 (#31)
Browse files Browse the repository at this point in the history
* DE-921 DE-922 Fix problem with interval units - interval units now can be nullable in various contexts, ExtendedIntervalUnit was renamed to ExpirationIntervalUnit, now ExpirationIntervalUnit is used in SubscriptionCustomPrice, CreatePrepaidComponentPricePoint, CreateProductPricePoint, CreateOrUpdateProduct, PrepaidComponent, ProductPricePoint and Product for expirationIntervalUnit property. This enum has additional value of never (this has not changed)

* DE-921 DE-924 Reworked vaults - CurrentVault enum was renamed to AllVaults and filled with previously missing values. BankAccountVault was filled with missing values. ApplePayVault was added with the vault supporting this payment method. CreditCardVault was added with vaults supporting this payment method. PayPalVault was added with vaults supporting this payment method. Models for respective payment profiles types now use respective enums.

* DE-910 Distinguish response payment profiles based on the paymentType. PaymentProfileResponsePaymentProfile was renamed to PaymentProfile.ApplePayPaymentProfile, and PayPalPaymentProfile were added as possible PaymentProfile in PaymentProfileResponse. Fixed a bug, when response payment profile couldn't be deserialized due to missing fields.

* Added publicUrlExpires_on to the Invoice

* Added achLateReject to the InvoiceRefund

* Added tax-related properties to InvoiceTaxComponentBreakout and InvoiceTax

* SUB-4037 Add taxIncluded to ComponentCustomPrice. Added request model for Activate Event-Based Component endpoint, SubscriptionComponentActivateEventBasedComponent
productFamilyId in endpoint paths parameters is now string, to enable searching by both handle and id

* [ON-128] Add salesforceId to Customer models
  • Loading branch information
maciej-nedza authored Aug 21, 2024
1 parent ef62074 commit c177eb5
Show file tree
Hide file tree
Showing 650 changed files with 7,225 additions and 3,269 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Maxio Advanced Billing (formerly Chargify) provides an HTTP-based API that confo
One of the many reasons to use Advanced Billing is the immense feature set and surrounding community [client libraries](page:development-tools/client-libraries).
The Maxio API returns JSON responses as the primary and recommended format, but XML is also provided as a backwards compatible option for Merchants who require it.

### Steps to make your first Maxio Advanced Billing API call
### Steps to make your first Maxio Chargify API call

1. [Sign-up](https://app.chargify.com/signup/maxio-billing-sandbox) or [log-in](https://app.chargify.com/login.html) to your [test site](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405553861773-Testing-Intro) account.
2. [Setup and configure authentication](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405281550477-API-Keys#api) credentials.
1. [Sign-up](https://app.chargify.com/signup/maxio-billing-sandbox) or [log-in](https://app.chargify.com/login.html) to your [test site](https://maxio.zendesk.com/hc/en-us/articles/24250712113165-Testing-Overview) account.
2. [Setup and configure authentication](https://maxio.zendesk.com/hc/en-us/articles/24294819360525-API-Keys) credentials.
3. Submit your API request and try it out.
4. Verify results through response.
5. Test our integrations.
Expand Down Expand Up @@ -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.3.0
$ go get github.com/maxio-com/ab-golang-sdk@v0.4.0
```

You can also view the package at: https://pkg.go.dev/github.com/maxio-com/ab-golang-sdk@v0.3.0
You can also view the package at: https://pkg.go.dev/github.com/maxio-com/ab-golang-sdk@v0.4.0

## Initialize the API Client

Expand All @@ -51,8 +51,8 @@ The following parameters are configurable for the API Client:

| Parameter | Type | Description |
| --- | --- | --- |
| `subdomain` | `string` | The subdomain for your Chargify site.<br>*Default*: `"subdomain"` |
| `domain` | `string` | The Chargify server domain.<br>*Default*: `"chargify.com"` |
| `subdomain` | `string` | The subdomain for your Advanced Billing site.<br>*Default*: `"subdomain"` |
| `domain` | `string` | The Advanced Billing server domain.<br>*Default*: `"chargify.com"` |
| `environment` | `Environment` | The API environment. <br> **Default: `Environment.PRODUCTION`** |
| `httpConfiguration` | [`HttpConfiguration`](doc/http-configuration.md) | Configurable http client options like timeout and retries. |
| `basicAuthCredentials` | [`BasicAuthCredentials`](doc/auth/basic-authentication.md) | The Credentials Setter for Basic Authentication |
Expand All @@ -64,7 +64,7 @@ client := advancedbilling.NewClient(
advancedbilling.CreateConfiguration(
advancedbilling.WithHttpConfiguration(
advancedbilling.CreateHttpConfiguration(
advancedbilling.WithTimeout(30),
advancedbilling.WithTimeout(120),
),
),
advancedbilling.WithEnvironment(advancedbilling.PRODUCTION),
Expand Down
7 changes: 6 additions & 1 deletion advance_invoice_controller.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
Package advancedbilling
This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
package advancedbilling

import (
Expand All @@ -24,7 +29,7 @@ func NewAdvanceInvoiceController(baseController baseController) *AdvanceInvoiceC
// IssueAdvanceInvoice takes context, subscriptionId, body as parameters and
// returns an models.ApiResponse with models.Invoice data and
// an error if there was an issue with the request or response.
// Generate an invoice in advance for a subscription's next renewal date. [Please see our docs](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404811062541-Issue-Invoice-In-Advance) for more information on advance invoices, including eligibility on generating one; for the most part, they function like any other invoice, except they are issued early and have special behavior upon being voided.
// Generate an invoice in advance for a subscription's next renewal date. [Please see our docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance) for more information on advance invoices, including eligibility on generating one; for the most part, they function like any other invoice, except they are issued early and have special behavior upon being voided.
// A subscription may only have one advance invoice per billing period. Attempting to issue an advance invoice when one already exists will return an error.
// That said, regeneration of the invoice may be forced with the params `force: true`, which will void an advance invoice if one exists and generate a new one. If no advance invoice exists, a new one will be generated.
// We recommend using either the create or preview endpoints for proforma invoices to preview this advance invoice before using this endpoint to generate it.
Expand Down
9 changes: 7 additions & 2 deletions api_exports_controller.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
Package advancedbilling
This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
package advancedbilling

import (
Expand All @@ -17,8 +22,8 @@ type APIExportsController struct {
// NewAPIExportsController creates a new instance of APIExportsController.
// It takes a baseController as a parameter and returns a pointer to the APIExportsController.
func NewAPIExportsController(baseController baseController) *APIExportsController {
APIExportsController := APIExportsController{baseController: baseController}
return &APIExportsController
aPIExportsController := APIExportsController{baseController: baseController}
return &aPIExportsController
}

// ListExportedProformaInvoicesInput represents the input of the ListExportedProformaInvoices endpoint.
Expand Down
5 changes: 5 additions & 0 deletions auth_provider.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
Package advancedbilling
This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
package advancedbilling

import (
Expand Down
5 changes: 5 additions & 0 deletions authentication.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
Package advancedbilling
This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
package advancedbilling

import (
Expand Down
19 changes: 12 additions & 7 deletions base_controller.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
Package advancedbilling
This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
package advancedbilling

import (
Expand All @@ -7,20 +12,20 @@ import (
// callBuilderFactory is an interface that defines a method to get a CallBuilderFactory.
// It allows objects to get a reference to a CallBuilderFactory for creating API call.
type callBuilderFactory interface {
GetCallBuilder() https.CallBuilderFactory
GetCallBuilder() https.CallBuilderFactory
}

// baseController represents a controller used as a base for other controllers.
// It encapsulates common functionality required by controllers for making API call.
type baseController struct {
callBuilder callBuilderFactory
prepareRequest https.CallBuilderFactory
callBuilder callBuilderFactory
prepareRequest https.CallBuilderFactory
}

// NewBaseController creates a new instance of baseController.
// It takes a callBuilderFactory as a parameter and returns a pointer to the baseController.
func NewBaseController(cb callBuilderFactory) *baseController {
baseController := baseController{callBuilder: cb}
baseController.prepareRequest = baseController.callBuilder.GetCallBuilder()
return &baseController
}
baseController := baseController{callBuilder: cb}
baseController.prepareRequest = baseController.callBuilder.GetCallBuilder()
return &baseController
}
11 changes: 8 additions & 3 deletions billing_portal_controller.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
Package advancedbilling
This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
package advancedbilling

import (
Expand Down Expand Up @@ -25,13 +30,13 @@ func NewBillingPortalController(baseController baseController) *BillingPortalCon
// returns an models.ApiResponse with models.CustomerResponse data and
// an error if there was an issue with the request or response.
// ## Billing Portal Documentation
// Full documentation on how the Billing Portal operates within the Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407648972443).
// Full documentation on how the Billing Portal operates within the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-Portal-Overview).
// This documentation is focused on how the to configure the Billing Portal Settings, as well as Subscriber Interaction and Merchant Management of the Billing Portal.
// You can use this endpoint to enable Billing Portal access for a Customer, with the option of sending the Customer an Invitation email at the same time.
// ## Billing Portal Security
// If your customer has been invited to the Billing Portal, then they will receive a link to manage their subscription (the “Management URL”) automatically at the bottom of their statements, invoices, and receipts. **This link changes periodically for security and is only valid for 65 days.**
// If you need to provide your customer their Management URL through other means, you can retrieve it via the API. Because the URL is cryptographically signed with a timestamp, it is not possible for merchants to generate the URL without requesting it from Chargify.
// In order to prevent abuse & overuse, we ask that you request a new URL only when absolutely necessary. Management URLs are good for 65 days, so you should re-use a previously generated one as much as possible. If you use the URL frequently (such as to display on your website), please **do not** make an API request to Chargify every time.
// If you need to provide your customer their Management URL through other means, you can retrieve it via the API. Because the URL is cryptographically signed with a timestamp, it is not possible for merchants to generate the URL without requesting it from Advanced Billing.
// In order to prevent abuse & overuse, we ask that you request a new URL only when absolutely necessary. Management URLs are good for 65 days, so you should re-use a previously generated one as much as possible. If you use the URL frequently (such as to display on your website), please **do not** make an API request to Advanced Billing every time.
func (b *BillingPortalController) EnableBillingPortalForCustomer(
ctx context.Context,
customerId int,
Expand Down
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func NewClient(configuration Configuration) ClientInterface {
configuration: configuration,
}

client.userAgent = utilities.UpdateUserAgent("AB SDK Go:0.3.0 on OS {os-info}")
client.userAgent = utilities.UpdateUserAgent("AB SDK Go:0.4.0 on OS {os-info}")
client.callBuilderFactory = callBuilderHandler(
func(server string) string {
if server == "" {
Expand Down
9 changes: 7 additions & 2 deletions component_price_points_controller.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
Package advancedbilling
This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
package advancedbilling

import (
Expand Down Expand Up @@ -25,7 +30,7 @@ func NewComponentPricePointsController(baseController baseController) *Component
// returns an models.ApiResponse with models.ComponentResponse data and
// an error if there was an issue with the request or response.
// Sets a new default price point for the component. This new default will apply to all new subscriptions going forward - existing subscriptions will remain on their current price point.
// See [Price Points Documentation](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#price-points) for more information on price points and moving subscriptions between price points.
// See [Price Points Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261191737101-Price-Points-Components) for more information on price points and moving subscriptions between price points.
// Note: Custom price points are not able to be set as the default for a component.
func (c *ComponentPricePointsController) PromoteComponentPricePointToDefault(
ctx context.Context,
Expand Down Expand Up @@ -83,7 +88,7 @@ func (c *ComponentPricePointsController) CreateComponentPricePoint(

// ListComponentPricePointsInput represents the input of the ListComponentPricePoints endpoint.
type ListComponentPricePointsInput struct {
// The Chargify id of the component
// The Advanced Billing id of the component
ComponentId int
// Include an array of currency price data
CurrencyPrices *bool
Expand Down
27 changes: 16 additions & 11 deletions components_controller.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
Package advancedbilling
This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
package advancedbilling

import (
Expand Down Expand Up @@ -27,10 +32,10 @@ func NewComponentsController(baseController baseController) *ComponentsControlle
// This request will create a component definition of kind **metered_component** under the specified product family. Metered component can then be added and “allocated” for a subscription.
// Metered components are used to bill for any type of unit that resets to 0 at the end of the billing period (think daily Google Adwords clicks or monthly cell phone minutes). This is most commonly associated with usage-based billing and many other pricing schemes.
// Note that this is different from recurring quantity-based components, which DO NOT reset to zero at the start of every billing period. If you want to bill for a quantity of something that does not change unless you change it, then you want quantity components, instead.
// For more information on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677).
// For more information on components, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview).
func (c *ComponentsController) CreateMeteredComponent(
ctx context.Context,
productFamilyId int,
productFamilyId string,
body *models.CreateMeteredComponent) (
models.ApiResponse[models.ComponentResponse],
error) {
Expand Down Expand Up @@ -69,10 +74,10 @@ func (c *ComponentsController) CreateMeteredComponent(
// #### One-time
// One-time quantity-based components are used to create ad hoc usage charges that do not recur. For example, at the time of signup, you might want to charge your customer a one-time fee for onboarding or other services.
// The allocated quantity for one-time quantity-based components immediately gets reset back to zero after the allocation is made.
// For more information on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677).
// For more information on components, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview).
func (c *ComponentsController) CreateQuantityBasedComponent(
ctx context.Context,
productFamilyId int,
productFamilyId string,
body *models.CreateQuantityBasedComponent) (
models.ApiResponse[models.ComponentResponse],
error) {
Expand Down Expand Up @@ -106,10 +111,10 @@ func (c *ComponentsController) CreateQuantityBasedComponent(
// an error if there was an issue with the request or response.
// This request will create a component definition of kind **on_off_component** under the specified product family. On/Off component can then be added and “allocated” for a subscription.
// On/off components are used for any flat fee, recurring add on (think $99/month for tech support or a flat add on shipping fee).
// For more information on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677).
// For more information on components, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview).
func (c *ComponentsController) CreateOnOffComponent(
ctx context.Context,
productFamilyId int,
productFamilyId string,
body *models.CreateOnOffComponent) (
models.ApiResponse[models.ComponentResponse],
error) {
Expand Down Expand Up @@ -143,10 +148,10 @@ func (c *ComponentsController) CreateOnOffComponent(
// an error if there was an issue with the request or response.
// This request will create a component definition of kind **prepaid_usage_component** under the specified product family. Prepaid component can then be added and “allocated” for a subscription.
// Prepaid components allow customers to pre-purchase units that can be used up over time on their subscription. In a sense, they are the mirror image of metered components; while metered components charge at the end of the period for the amount of units used, prepaid components are charged for at the time of purchase, and we subsequently keep track of the usage against the amount purchased.
// For more information on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677).
// For more information on components, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview).
func (c *ComponentsController) CreatePrepaidUsageComponent(
ctx context.Context,
productFamilyId int,
productFamilyId string,
body *models.CreatePrepaidComponent) (
models.ApiResponse[models.ComponentResponse],
error) {
Expand Down Expand Up @@ -181,10 +186,10 @@ func (c *ComponentsController) CreatePrepaidUsageComponent(
// This request will create a component definition of kind **event_based_component** under the specified product family. Event-based component can then be added and “allocated” for a subscription.
// Event-based components are similar to other component types, in that you define the component parameters (such as name and taxability) and the pricing. A key difference for the event-based component is that it must be attached to a metric. This is because the metric provides the component with the actual quantity used in computing what and how much will be billed each period for each subscription.
// So, instead of reporting usage directly for each component (as you would with metered components), the usage is derived from analysis of your events.
// For more information on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677).
// For more information on components, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview).
func (c *ComponentsController) CreateEventBasedComponent(
ctx context.Context,
productFamilyId int,
productFamilyId string,
body *models.CreateEBBComponent) (
models.ApiResponse[models.ComponentResponse],
error) {
Expand Down Expand Up @@ -438,7 +443,7 @@ func (c *ComponentsController) UpdateComponent(

// ListComponentsForProductFamilyInput represents the input of the ListComponentsForProductFamily endpoint.
type ListComponentsForProductFamilyInput struct {
// The Chargify id of the product family
// The Advanced Billing id of the product family
ProductFamilyId int
// Include archived items.
IncludeArchived *bool
Expand Down
5 changes: 5 additions & 0 deletions configuration.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
Package advancedbilling
This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
package advancedbilling

import (
Expand Down
5 changes: 5 additions & 0 deletions core.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
Package advancedbilling
This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
package advancedbilling

import (
Expand Down
Loading

0 comments on commit c177eb5

Please sign in to comment.