[Python-modules-commits] [chargebee2-python] 01/04: Imported Upstream version 2.3.5

Scott Kitterman kitterman at moszumanska.debian.org
Sun Aug 20 20:31:49 UTC 2017


This is an automated email from the git hooks/post-receive script.

kitterman pushed a commit to branch debian/master
in repository chargebee2-python.

commit 6bb6212ad2ed5a4a341a85d4223da1f667edcd46
Author: Scott Kitterman <scott at kitterman.com>
Date:   Sun Aug 20 16:23:44 2017 -0400

    Imported Upstream version 2.3.5
---
 CHANGELOG.md                       | 54 ++++++++++++++++++++++++++++++++++++++
 chargebee/models/__init__.py       |  1 +
 chargebee/models/customer.py       | 11 +++++---
 chargebee/models/estimate.py       |  8 ++++++
 chargebee/models/payment_source.py |  4 +++
 chargebee/models/subscription.py   |  2 +-
 chargebee/models/time_machine.py   | 47 +++++++++++++++++++++++++++++++++
 chargebee/result.py                |  5 ++++
 chargebee/version.py               |  2 +-
 9 files changed, 129 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index f03cf4c..8afb6b5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,57 @@
+### v2.3.5 (2017-08-16)
+* * * 
+
+** APIs added**: 
+
+A new endpoint 'Update a card payment source' would be added to the Payment source resource.
+See : https://apidocs.chargebee.com/docs/api/payment_sources#update_a_card_payment_source
+
+### v2.3.4 (2017-08-03)
+* * * 
+
+** APIs updated**: 
+
+The attribute trial_end has been added to Subscriptions Addon subresource.
+See : https://apidocs.chargebee.com/docs/api/subscriptions#subscription_addons_trial_end
+
+The parameter trial_end would be added to Addon subresource in Create a subscription,Create subcription for customer, Update a subcription, Create subscription estimate, Create subscription for customer estimate and Update subscription estimate APIs.
+See : https://apidocs.chargebee.com/docs/api/subscriptions#create_a_subscription_addons_trial_end
+
+### v2.3.3 (2017-07-26)
+* * * 
+
+** APIs added**: 
+
+The new resource 'Time Machine' has been added.
+
+### v2.3.2 (2017-07-21)
+* * * 
+
+** APIs added**: 
+
+The new endpoint 'Change Billing Date' has been added to Customer resource.
+See : https://apidocs.chargebee.com/docs/api/customers#change_billing_date
+
+The new endpoints 'Upcoming invoices estimate' and  'Subscription change term end estimate' have been added to Estimate API.
+See : https://apidocs.chargebee.com/docs/api/estimates#upcoming_invoices_estimate
+
+** APIs updated**: 
+
+The attributes 'billing_date', 'billing_date_mode', 'billing_day_of_week', 'billing_day_of_week_mode', 'unbilled_charges' have been added to the Customer resource.
+See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes
+
+The event types 'unbilled_charges_created', 'unbilled_charges_voided', 'unbilled_charges_deleted' and 'unbilled_charges_invoiced' have been added.
+See : https://apidocs.chargebee.com/docs/api/events#event_types
+
+The parameter 'billing_alignment_mode' has been added to Create a subscription, Create a subscription for customer, Update a customer, Reactivate a subscription, Create subscription estimate, Create subscription for customer estimate, Update a subscription estimate, Checkout new subscription and Checkout existing subscription API.
+See : https://apidocs.chargebee.com/docs/api/subscriptions#create_a_subscription
+
+The parameters 'line_item_date_from' and 'line_item_date_to' have been added to Add Charge API.
+See : https://apidocs.chargebee.com/docs/api/invoices#add_charge_item_to_pending_invoice
+
+The parameters 'prorate' and 'invoice_immediately' have been added Change term end API.
+See : https://apidocs.chargebee.com/docs/api/subscriptions#change_term_end
+
 ### v2.3.1 (2017-07-06)
 * * * 
 
diff --git a/chargebee/models/__init__.py b/chargebee/models/__init__.py
index 1fc10f7..2391e04 100644
--- a/chargebee/models/__init__.py
+++ b/chargebee/models/__init__.py
@@ -24,4 +24,5 @@ from chargebee.models.site_migration_detail import SiteMigrationDetail
 from chargebee.models.resource_migration import ResourceMigration
 from chargebee.models.payment_source import PaymentSource
 from chargebee.models.unbilled_charge import UnbilledCharge
+from chargebee.models.time_machine import TimeMachine
 from chargebee.models.content import Content
diff --git a/chargebee/models/customer.py b/chargebee/models/customer.py
index 7eed459..ed30d71 100644
--- a/chargebee/models/customer.py
+++ b/chargebee/models/customer.py
@@ -19,10 +19,11 @@ class Customer(Model):
 
     fields = ["id", "first_name", "last_name", "email", "phone", "company", "vat_number", "auto_collection", \
     "net_term_days", "allow_direct_debit", "created_at", "created_from_ip", "taxability", "entity_code", \
-    "exempt_number", "resource_version", "updated_at", "locale", "consolidated_invoicing", "card_status", \
-    "fraud_flag", "primary_payment_source_id", "backup_payment_source_id", "billing_address", "referral_urls", \
+    "exempt_number", "resource_version", "updated_at", "locale", "consolidated_invoicing", "billing_date", \
+    "billing_date_mode", "billing_day_of_week", "billing_day_of_week_mode", "card_status", "fraud_flag", \
+    "primary_payment_source_id", "backup_payment_source_id", "billing_address", "referral_urls", \
     "contacts", "payment_method", "invoice_notes", "preferred_currency_code", "promotional_credits", \
-    "refundable_credits", "excess_payments", "meta_data", "deleted"]
+    "unbilled_charges", "refundable_credits", "excess_payments", "meta_data", "deleted"]
 
 
     @staticmethod
@@ -88,3 +89,7 @@ class Customer(Model):
     @staticmethod
     def move(params, env=None, headers=None):
         return request.send('post', request.uri_path("customers","move"), params, env, headers)
+
+    @staticmethod
+    def change_billing_date(id, params=None, env=None, headers=None):
+        return request.send('post', request.uri_path("customers",id,"change_billing_date"), params, env, headers)
diff --git a/chargebee/models/estimate.py b/chargebee/models/estimate.py
index d1f174a..fc66e8a 100644
--- a/chargebee/models/estimate.py
+++ b/chargebee/models/estimate.py
@@ -24,3 +24,11 @@ class Estimate(Model):
     @staticmethod
     def renewal_estimate(id, params=None, env=None, headers=None):
         return request.send('get', request.uri_path("subscriptions",id,"renewal_estimate"), params, env, headers)
+
+    @staticmethod
+    def upcoming_invoices_estimate(id, env=None, headers=None):
+        return request.send('get', request.uri_path("customers",id,"upcoming_invoices_estimate"), None, env, headers)
+
+    @staticmethod
+    def change_term_end(id, params=None, env=None, headers=None):
+        return request.send('post', request.uri_path("subscriptions",id,"change_term_end_estimate"), params, env, headers)
diff --git a/chargebee/models/payment_source.py b/chargebee/models/payment_source.py
index 0006aa7..d4436f2 100644
--- a/chargebee/models/payment_source.py
+++ b/chargebee/models/payment_source.py
@@ -34,6 +34,10 @@ class PaymentSource(Model):
         return request.send('post', request.uri_path("payment_sources","create_card"), params, env, headers)
 
     @staticmethod
+    def update_card(id, params=None, env=None, headers=None):
+        return request.send('post', request.uri_path("payment_sources",id,"update_card"), params, env, headers)
+
+    @staticmethod
     def retrieve(id, env=None, headers=None):
         return request.send('get', request.uri_path("payment_sources",id), None, env, headers)
 
diff --git a/chargebee/models/subscription.py b/chargebee/models/subscription.py
index 7d06893..d513988 100644
--- a/chargebee/models/subscription.py
+++ b/chargebee/models/subscription.py
@@ -5,7 +5,7 @@ from chargebee import APIError
 
 class Subscription(Model):
     class Addon(Model):
-      fields = ["id", "quantity", "unit_price"]
+      fields = ["id", "quantity", "unit_price", "trial_end"]
       pass
     class Coupon(Model):
       fields = ["coupon_id", "apply_till", "applied_count", "coupon_code"]
diff --git a/chargebee/models/time_machine.py b/chargebee/models/time_machine.py
new file mode 100644
index 0000000..9d52e10
--- /dev/null
+++ b/chargebee/models/time_machine.py
@@ -0,0 +1,47 @@
+import json
+from chargebee.model import Model
+from chargebee import request
+from chargebee import APIError
+from chargebee import OperationFailedError
+
+class TimeMachine(Model):
+
+    fields = ["name", "time_travel_status", "genesis_time", "destination_time", "failure_code", \
+    "failure_reason", "error_json"]
+    def wait_for_time_travel_completion(self):
+        return wait_for_time_travel_completion()
+
+    def wait_for_time_travel_completion(self, env = None):
+        import time
+        count = 0
+        sleep_time_millis = (3000 if env == None else env.time_travel_sleep_millis)/1000.0
+        
+        while self.time_travel_status == 'in_progress':
+            if count > 30:
+                raise RuntimeError('Time travel is taking too much time')
+            count+=1
+            time.sleep(sleep_time_millis);
+            self.values = TimeMachine.retrieve(self.name, env).time_machine.values
+            self.load(self.values)
+        
+        if self.time_travel_status == 'failed':
+            err = json.loads(self.error_json)
+            raise OperationFailedError(err['http_code'], err)
+        
+        if self.time_travel_status in ('not_enabled', '_unknown'):
+            raise RuntimeError('Time travel is in wrong state \'' + self.time_travel_status + '\'')
+        
+        return self
+
+
+    @staticmethod
+    def retrieve(id, env=None, headers=None):
+        return request.send('get', request.uri_path("time_machines",id), None, env, headers)
+
+    @staticmethod
+    def start_afresh(id, params=None, env=None, headers=None):
+        return request.send('post', request.uri_path("time_machines",id,"start_afresh"), params, env, headers)
+
+    @staticmethod
+    def travel_forward(id, params=None, env=None, headers=None):
+        return request.send('post', request.uri_path("time_machines",id,"travel_forward"), params, env, headers)
diff --git a/chargebee/result.py b/chargebee/result.py
index cec588d..2be2655 100644
--- a/chargebee/result.py
+++ b/chargebee/result.py
@@ -144,6 +144,11 @@ class Result(object):
         resource_migration = self._get('resource_migration', ResourceMigration);
         return resource_migration;
 
+    @property
+    def time_machine(self):
+        time_machine = self._get('time_machine', TimeMachine);
+        return time_machine;
+
 
     @property
     def unbilled_charges(self):
diff --git a/chargebee/version.py b/chargebee/version.py
index 7e69697..b4ab188 100644
--- a/chargebee/version.py
+++ b/chargebee/version.py
@@ -1 +1 @@
-VERSION = '2.3.1'
+VERSION = '2.3.5'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/chargebee2-python.git



More information about the Python-modules-commits mailing list