Skip to content
Closed
Show file tree
Hide file tree
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
91 changes: 48 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ The package is compatible with Python versions `3.7+`.
Install the package from PyPi using the following pip command:

```bash
pip install maxio-advanced-billing-sdk==7.0.0
pip install maxio-advanced-billing-sdk==7.0.1
```

You can also view the package at:
https://pypi.python.org/pypi/maxio-advanced-billing-sdk/7.0.0
https://pypi.python.org/pypi/maxio-advanced-billing-sdk/7.0.1

## Initialize the API Client

**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/client.md)
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/client.md)

The following parameters are configurable for the API Client:

Expand All @@ -54,7 +54,8 @@ The following parameters are configurable for the API Client:
| backoff_factor | `float` | A backoff factor to apply between attempts after the second try. <br> **Default: 2** |
| retry_statuses | `Array of int` | The http statuses on which retry is to be done. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
| retry_methods | `Array of string` | The http methods on which retry is to be done. <br> **Default: ['GET', 'PUT']** |
| basic_auth_credentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication |
| proxy_settings | [`ProxySettings`](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
| basic_auth_credentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/auth/basic-authentication.md) | The credential object for Basic Authentication |

The API client can be initialized as follows:

Expand Down Expand Up @@ -88,54 +89,58 @@ The SDK can be configured to use a different environment for making API calls. A

This API uses the following authentication schemes.

* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/auth/basic-authentication.md)
* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/auth/basic-authentication.md)

## List of APIs

* [API Exports](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/api-exports.md)
* [Advance Invoice](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/advance-invoice.md)
* [Billing Portal](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/billing-portal.md)
* [Component Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/component-price-points.md)
* [Custom Fields](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/custom-fields.md)
* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/events-based-billing-segments.md)
* [Payment Profiles](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/payment-profiles.md)
* [Product Families](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/product-families.md)
* [Product Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/product-price-points.md)
* [Proforma Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/proforma-invoices.md)
* [Reason Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/reason-codes.md)
* [Referral Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/referral-codes.md)
* [Sales Commissions](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/sales-commissions.md)
* [Subscription Components](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscription-components.md)
* [Subscription Groups](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscription-groups.md)
* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscription-group-invoice-account.md)
* [Subscription Group Status](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscription-group-status.md)
* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscription-invoice-account.md)
* [Subscription Notes](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscription-notes.md)
* [Subscription Products](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscription-products.md)
* [Subscription Status](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscription-status.md)
* [Coupons](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/coupons.md)
* [Components](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/components.md)
* [Customers](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/customers.md)
* [Events](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/events.md)
* [Insights](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/insights.md)
* [Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/invoices.md)
* [Offers](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/offers.md)
* [Products](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/products.md)
* [Sites](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/sites.md)
* [Subscriptions](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscriptions.md)
* [Webhooks](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/webhooks.md)
* [API Exports](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/api-exports.md)
* [Advance Invoice](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/advance-invoice.md)
* [Billing Portal](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/billing-portal.md)
* [Component Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/component-price-points.md)
* [Custom Fields](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/custom-fields.md)
* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/events-based-billing-segments.md)
* [Payment Profiles](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/payment-profiles.md)
* [Product Families](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/product-families.md)
* [Product Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/product-price-points.md)
* [Proforma Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/proforma-invoices.md)
* [Reason Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/reason-codes.md)
* [Referral Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/referral-codes.md)
* [Sales Commissions](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/sales-commissions.md)
* [Subscription Components](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscription-components.md)
* [Subscription Groups](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscription-groups.md)
* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscription-group-invoice-account.md)
* [Subscription Group Status](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscription-group-status.md)
* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscription-invoice-account.md)
* [Subscription Notes](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscription-notes.md)
* [Subscription Products](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscription-products.md)
* [Subscription Status](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscription-status.md)
* [Coupons](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/coupons.md)
* [Components](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/components.md)
* [Customers](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/customers.md)
* [Events](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/events.md)
* [Insights](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/insights.md)
* [Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/invoices.md)
* [Offers](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/offers.md)
* [Products](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/products.md)
* [Sites](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/sites.md)
* [Subscriptions](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscriptions.md)
* [Webhooks](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/webhooks.md)

## SDK Infrastructure

### Configuration

* [ProxySettings](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/proxy-settings.md)

### HTTP

* [HttpResponse](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/http-response.md)
* [HttpRequest](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/http-request.md)
* [HttpResponse](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/http-response.md)
* [HttpRequest](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/http-request.md)

### Utilities

* [ApiHelper](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/api-helper.md)
* [HttpDateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/http-date-time.md)
* [RFC3339DateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/rfc3339-date-time.md)
* [UnixDateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/unix-date-time.md)
* [ApiHelper](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/api-helper.md)
* [HttpDateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/http-date-time.md)
* [RFC3339DateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/rfc3339-date-time.md)
* [UnixDateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/unix-date-time.md)

4 changes: 2 additions & 2 deletions advancedbilling/advanced_billing_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def webhooks(self):
def __init__(self, http_client_instance=None,
override_http_client_configuration=False, http_call_back=None,
timeout=120, max_retries=0, backoff_factor=2,
retry_statuses=None, retry_methods=None,
retry_statuses=None, retry_methods=None, proxy_settings=None,
environment=Environment.US, site='subdomain',
basic_auth_credentials=None, config=None):
self.config = config or Configuration(
Expand All @@ -212,7 +212,7 @@ def __init__(self, http_client_instance=None,
http_call_back=http_call_back, timeout=timeout,
max_retries=max_retries, backoff_factor=backoff_factor,
retry_statuses=retry_statuses, retry_methods=retry_methods,
environment=environment, site=site,
proxy_settings=proxy_settings, environment=environment, site=site,
basic_auth_credentials=basic_auth_credentials)

self.global_configuration = GlobalConfiguration(self.config)\
Expand Down
24 changes: 15 additions & 9 deletions advancedbilling/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def basic_auth_credentials(self):
def __init__(self, http_client_instance=None,
override_http_client_configuration=False, http_call_back=None,
timeout=120, max_retries=0, backoff_factor=2,
retry_statuses=None, retry_methods=None,
retry_statuses=None, retry_methods=None, proxy_settings=None,
environment=Environment.US, site='subdomain',
basic_auth_credentials=None):
if retry_methods is None:
Expand All @@ -55,10 +55,14 @@ def __init__(self, http_client_instance=None,
if retry_statuses is None:
retry_statuses = [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]

super().__init__(http_client_instance,
override_http_client_configuration, http_call_back,
timeout, max_retries, backoff_factor, retry_statuses,
retry_methods)
super().__init__(
http_client_instance=http_client_instance,
override_http_client_configuration=override_http_client_configuration,
http_call_back=http_call_back, timeout=timeout,
max_retries=max_retries, backoff_factor=backoff_factor,
retry_statuses=retry_statuses, retry_methods=retry_methods,
proxy_settings=proxy_settings
)

# Current API environment
self._environment = environment
Expand All @@ -74,8 +78,8 @@ def __init__(self, http_client_instance=None,
def clone_with(self, http_client_instance=None,
override_http_client_configuration=None, http_call_back=None,
timeout=None, max_retries=None, backoff_factor=None,
retry_statuses=None, retry_methods=None, environment=None,
site=None, basic_auth_credentials=None):
retry_statuses=None, retry_methods=None, proxy_settings=None,
environment=None, site=None, basic_auth_credentials=None):
http_client_instance = http_client_instance or self.http_client_instance
override_http_client_configuration = override_http_client_configuration or self.override_http_client_configuration
http_call_back = http_call_back or self.http_callback
Expand All @@ -84,6 +88,7 @@ def clone_with(self, http_client_instance=None,
backoff_factor = backoff_factor or self.backoff_factor
retry_statuses = retry_statuses or self.retry_statuses
retry_methods = retry_methods or self.retry_methods
proxy_settings = proxy_settings or self.proxy_settings
environment = environment or self.environment
site = site or self.site
basic_auth_credentials = basic_auth_credentials or self.basic_auth_credentials
Expand All @@ -93,7 +98,7 @@ def clone_with(self, http_client_instance=None,
http_call_back=http_call_back, timeout=timeout,
max_retries=max_retries, backoff_factor=backoff_factor,
retry_statuses=retry_statuses, retry_methods=retry_methods,
environment=environment, site=site,
proxy_settings=proxy_settings, environment=environment, site=site,
basic_auth_credentials=basic_auth_credentials
)

Expand All @@ -104,7 +109,8 @@ def create_http_client(self):
retry_methods=self.retry_methods,
http_client_instance=self.http_client_instance,
override_http_client_configuration=self.override_http_client_configuration,
response_factory=self.http_response_factory
response_factory=self.http_response_factory,
proxies=self.proxy_settings.to_proxies() if self.proxy_settings else None
)

# All the environments the SDK can run in
Expand Down
2 changes: 1 addition & 1 deletion advancedbilling/controllers/base_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class BaseController(object):

@staticmethod
def user_agent():
return 'AB SDK Python:7.0.0 on OS {os-info}'
return 'AB SDK Python:7.0.1 on OS {os-info}'

@staticmethod
def user_agent_parameters():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ def create_component_price_point(self,
body=None):
"""Does a POST request to /components/{component_id}/price_points.json.

This endpoint can be used to create a new price point for an existing
component.
Creates a price point for an existing component.

Args:
component_id (int): The Advanced Billing id of the component
Expand Down
6 changes: 3 additions & 3 deletions advancedbilling/controllers/components_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ def read_component(self,
component_id):
"""Does a GET request to /product_families/{product_family_id}/components/{component_id}.json.

This request will return information regarding a component from a
specific product family.
You may read the component by either the component's id or handle.
Returns information regarding a component from a specific product
family.
You can read the component by either the component's id or handle.
When using the handle, it must be prefixed with `handle:`.

Args:
Expand Down
4 changes: 2 additions & 2 deletions advancedbilling/controllers/customers_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ def read_customer(self,
id):
"""Does a GET request to /customers/{id}.json.

This method allows to retrieve the Customer properties by Advanced
Billing-generated Customer ID.
Retrieves the Customer properties by Advanced Billing-generated
Customer ID.

Args:
id (int): The Advanced Billing id of the customer
Expand Down
21 changes: 10 additions & 11 deletions advancedbilling/controllers/payment_profiles_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ def create_payment_profile(self,
GoCardless](https://maxio.zendesk.com/hc/en-us/articles/24176159136909-
GoCardless)
+ [Using Chargify.js with GoCardless - minimal
example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0Nj
AzNDIy-examples#minimal-example-with-direct-debit-gocardless-gateway)
example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl
es#h_01K0PJ15QQZKCER8CFK40MR6XJ)
+ [Using Chargify.js with GoCardless - full
example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0Nj
AzNDIy-examples#full-example-with-direct-debit-gocardless-gateway)
example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl
es#h_01K0PJ15QR09JVHWW0MCA7HVJV)
### GoCardless with Local Bank Details
Following examples create customer, bank account and mandate in
GoCardless:
Expand Down Expand Up @@ -196,12 +196,11 @@ def create_payment_profile(self,
Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Strip
e-SEPA-and-BECS-Direct-Debit)
+ [Using Chargify.js with Stripe Direct Debit - minimal
example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0Nj
AzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-g
ateway)
example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl
es#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5)
+ [Using Chargify.js with Stripe Direct Debit - full
example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0Nj
AzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway)
example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl
es#h_01K0PJ15QRECQQ4ECS3ZA55GY7)
### Stripe SEPA Direct Debit Payment Profiles
The following example creates a customer, bank account and mandate in
Stripe:
Expand Down Expand Up @@ -917,8 +916,8 @@ def read_one_time_token(self,
profile instead of passing all bank account or credit card data
directly to a given API endpoint.
To obtain a One Time Token you have to use
[Chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jO
jE0NjAzNDI0-overview).
[Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-C
hargify-js-Overview#chargify-js-overview-0-0).

Args:
chargify_token (str): Advanced Billing Token
Expand Down
Loading