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

Scott Kitterman kitterman at moszumanska.debian.org
Wed Jan 10 04:56:55 UTC 2018


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 8b3976c80d47ed657f48043c933a1964b132d19a
Author: Scott Kitterman <scott at kitterman.com>
Date:   Tue Jan 9 23:54:10 2018 -0500

    Imported Upstream version 2.4.3
---
 CHANGELOG.md                           | 35 +++++++++++++++++++++++++++++++
 LICENSE                                |  2 +-
 chargebee/models/__init__.py           |  2 ++
 chargebee/models/coupon_code.py        |  2 +-
 chargebee/models/coupon_set.py         | 38 ++++++++++++++++++++++++++++++++++
 chargebee/models/customer.py           |  6 +++++-
 chargebee/models/hosted_page.py        |  8 +++++++
 chargebee/models/promotional_credit.py | 30 +++++++++++++++++++++++++++
 chargebee/models/subscription.py       |  2 +-
 chargebee/result.py                    | 12 ++++++++++-
 chargebee/version.py                   |  2 +-
 setup.py                               |  2 +-
 12 files changed, 134 insertions(+), 7 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index e08fbf6..0728618 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,38 @@
+### v2.4.3 (2017-11-27)
+* * * 
+
+** API changes **:  
+* The new resource [Promotional Credits](http://apidocs.chargebee.com/docs/api/promotional_credits) has been added
+
+* The new sub resource [balances](https://apidocs.chargebee.com/docs/api/customers#customer_balances) has been added
+
+* The API end point add_promotional_credits, deduct_promotional_credits and set_promotional_credits has been deprecated in customer resource
+
+** Events added**:
+* New Event Type promotional_credits_added and promotional_credits_deducted has been added
+
+### v2.4.2 (2017-11-13)
+* * * 
+
+** API changes**: 
+* The new resource [Coupon Set](https://apidocs.chargebee.com/docs/api/coupon_sets) has been added
+
+* The API end point create a coupon code for a coupon has been deprecated in coupon code resource
+
+* The attribute [coupon_set_id](https://apidocs.chargebee.com/docs/api/coupon_codes#coupon_code_coupon_set_id) has been added to Coupon Code resource
+
+* The deprecation has been removed for [Collect payment for customer](https://apidocs.chargebee.com/docs/api/customers#collect_payment_for_customer) in customer resource
+
+* New end point Manage payment source and Collect now has been added as deprecated API to hosted page. Please mail us at support at chargebee.com to enable
+
+** Attributes added**:
+* New attribute [remaining_billing_cycles](https://apidocs.chargebee.com/docs/api/subscriptions#subscription_addons_remaining_billing_cycles) has been added in addons under subscription resource.
+
+
+** Events added**:
+* New event type coupon_set_created, coupon_set_updated, coupon_set_deleted, coupon_codes_added, coupon_codes_updated, coupon_codes_deleted
+
+
 ### v2.4.1 (2017-09-22)
 * * * 
 
diff --git a/LICENSE b/LICENSE
index 98259c9..f8871ed 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
 The MIT License
 
-Copyright (c) 2011-2016 ChargeBee, Inc.
+Copyright (c) 2011-2017 ChargeBee, Inc.
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
diff --git a/chargebee/models/__init__.py b/chargebee/models/__init__.py
index 2391e04..9ffe9df 100644
--- a/chargebee/models/__init__.py
+++ b/chargebee/models/__init__.py
@@ -3,6 +3,7 @@ from chargebee.models.address import Address
 from chargebee.models.card import Card
 from chargebee.models.coupon import Coupon
 from chargebee.models.coupon_code import CouponCode
+from chargebee.models.coupon_set import CouponSet
 from chargebee.models.customer import Customer
 from chargebee.models.event import Event
 from chargebee.models.hosted_page import HostedPage
@@ -25,4 +26,5 @@ 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.promotional_credit import PromotionalCredit
 from chargebee.models.content import Content
diff --git a/chargebee/models/coupon_code.py b/chargebee/models/coupon_code.py
index 798cee9..494c260 100644
--- a/chargebee/models/coupon_code.py
+++ b/chargebee/models/coupon_code.py
@@ -5,7 +5,7 @@ from chargebee import APIError
 
 class CouponCode(Model):
 
-    fields = ["code", "status", "coupon_id", "coupon_set_name"]
+    fields = ["code", "status", "coupon_id", "coupon_set_id", "coupon_set_name"]
 
 
     @staticmethod
diff --git a/chargebee/models/coupon_set.py b/chargebee/models/coupon_set.py
new file mode 100644
index 0000000..b346905
--- /dev/null
+++ b/chargebee/models/coupon_set.py
@@ -0,0 +1,38 @@
+import json
+from chargebee.model import Model
+from chargebee import request
+from chargebee import APIError
+
+class CouponSet(Model):
+
+    fields = ["id", "coupon_id", "name", "total_count", "redeemed_count", "archived_count", \
+    "meta_data"]
+
+
+    @staticmethod
+    def create(params, env=None, headers=None):
+        return request.send('post', request.uri_path("coupon_sets"), params, env, headers)
+
+    @staticmethod
+    def add_coupon_codes(id, params=None, env=None, headers=None):
+        return request.send('post', request.uri_path("coupon_sets",id,"add_coupon_codes"), params, env, headers)
+
+    @staticmethod
+    def list(params=None, env=None, headers=None):
+        return request.send_list_request('get', request.uri_path("coupon_sets"), params, env, headers)
+
+    @staticmethod
+    def retrieve(id, env=None, headers=None):
+        return request.send('get', request.uri_path("coupon_sets",id), None, env, headers)
+
+    @staticmethod
+    def update(id, params=None, env=None, headers=None):
+        return request.send('post', request.uri_path("coupon_sets",id,"update"), params, env, headers)
+
+    @staticmethod
+    def delete(id, env=None, headers=None):
+        return request.send('post', request.uri_path("coupon_sets",id,"delete"), None, env, headers)
+
+    @staticmethod
+    def delete_unused_coupon_codes(id, env=None, headers=None):
+        return request.send('post', request.uri_path("coupon_sets",id,"delete_unused_coupon_codes"), None, env, headers)
diff --git a/chargebee/models/customer.py b/chargebee/models/customer.py
index 2914abc..f4c0c6b 100644
--- a/chargebee/models/customer.py
+++ b/chargebee/models/customer.py
@@ -16,6 +16,9 @@ class Customer(Model):
     class PaymentMethod(Model):
       fields = ["type", "gateway", "gateway_account_id", "status", "reference_id"]
       pass
+    class Balance(Model):
+      fields = ["promotional_credits", "excess_payments", "refundable_credits", "unbilled_charges", "balance_currency_code"]
+      pass
 
     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", \
@@ -23,7 +26,8 @@ class Customer(Model):
     "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", \
-    "unbilled_charges", "refundable_credits", "excess_payments", "meta_data", "deleted", "registered_for_gst"]
+    "unbilled_charges", "refundable_credits", "excess_payments", "balances", "meta_data", "deleted", \
+    "registered_for_gst"]
 
 
     @staticmethod
diff --git a/chargebee/models/hosted_page.py b/chargebee/models/hosted_page.py
index d635895..841deab 100644
--- a/chargebee/models/hosted_page.py
+++ b/chargebee/models/hosted_page.py
@@ -32,6 +32,14 @@ class HostedPage(Model):
         return request.send('post', request.uri_path("hosted_pages","update_payment_method"), params, env, headers)
 
     @staticmethod
+    def manage_payment_sources(params, env=None, headers=None):
+        return request.send('post', request.uri_path("hosted_pages","manage_payment_sources"), params, env, headers)
+
+    @staticmethod
+    def collect_now(params, env=None, headers=None):
+        return request.send('post', request.uri_path("hosted_pages","collect_now"), params, env, headers)
+
+    @staticmethod
     def acknowledge(id, env=None, headers=None):
         return request.send('post', request.uri_path("hosted_pages",id,"acknowledge"), None, env, headers)
 
diff --git a/chargebee/models/promotional_credit.py b/chargebee/models/promotional_credit.py
new file mode 100644
index 0000000..f684456
--- /dev/null
+++ b/chargebee/models/promotional_credit.py
@@ -0,0 +1,30 @@
+import json
+from chargebee.model import Model
+from chargebee import request
+from chargebee import APIError
+
+class PromotionalCredit(Model):
+
+    fields = ["id", "customer_id", "type", "amount", "currency_code", "description", "credit_type", \
+    "reference", "closing_balance", "created_at"]
+
+
+    @staticmethod
+    def add(params, env=None, headers=None):
+        return request.send('post', request.uri_path("promotional_credits","add"), params, env, headers)
+
+    @staticmethod
+    def deduct(params, env=None, headers=None):
+        return request.send('post', request.uri_path("promotional_credits","deduct"), params, env, headers)
+
+    @staticmethod
+    def set(params, env=None, headers=None):
+        return request.send('post', request.uri_path("promotional_credits","set"), params, env, headers)
+
+    @staticmethod
+    def list(params=None, env=None, headers=None):
+        return request.send_list_request('get', request.uri_path("promotional_credits"), params, env, headers)
+
+    @staticmethod
+    def retrieve(id, env=None, headers=None):
+        return request.send('get', request.uri_path("promotional_credits",id), None, env, headers)
diff --git a/chargebee/models/subscription.py b/chargebee/models/subscription.py
index d513988..9c69647 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", "trial_end"]
+      fields = ["id", "quantity", "unit_price", "trial_end", "remaining_billing_cycles"]
       pass
     class Coupon(Model):
       fields = ["coupon_id", "apply_till", "applied_count", "coupon_code"]
diff --git a/chargebee/result.py b/chargebee/result.py
index 2be2655..a3d6315 100644
--- a/chargebee/result.py
+++ b/chargebee/result.py
@@ -17,7 +17,7 @@ class Result(object):
     @property
     def customer(self):
         customer = self._get('customer', Customer,
-        {'billing_address' : Customer.BillingAddress, 'referral_urls' : Customer.ReferralUrl, 'contacts' : Customer.Contact, 'payment_method' : Customer.PaymentMethod});
+        {'billing_address' : Customer.BillingAddress, 'referral_urls' : Customer.ReferralUrl, 'contacts' : Customer.Contact, 'payment_method' : Customer.PaymentMethod, 'balances' : Customer.Balance});
         return customer;
 
     @property
@@ -37,6 +37,11 @@ class Result(object):
         return card;
 
     @property
+    def promotional_credit(self):
+        promotional_credit = self._get('promotional_credit', PromotionalCredit);
+        return promotional_credit;
+
+    @property
     def invoice(self):
         invoice = self._get('invoice', Invoice,
         {'line_items' : Invoice.LineItem, 'discounts' : Invoice.Discount, 'line_item_discounts' : Invoice.LineItemDiscount, 'taxes' : Invoice.Tax, 'line_item_taxes' : Invoice.LineItemTax, 'linked_payments' : Invoice.LinkedPayment, 'applied_credits' : Invoice.AppliedCredit, 'adjustment_credit_notes' : Invoice.AdjustmentCreditNote, 'issued_credit_notes' : Invoice.IssuedCreditNote, 'linked_orders' : Invoice.LinkedOrder, 'notes' : Invoice.Note, 'shipping_address' : Invoice.ShippingAddress, ' [...]
@@ -103,6 +108,11 @@ class Result(object):
         return coupon;
 
     @property
+    def coupon_set(self):
+        coupon_set = self._get('coupon_set', CouponSet);
+        return coupon_set;
+
+    @property
     def coupon_code(self):
         coupon_code = self._get('coupon_code', CouponCode);
         return coupon_code;
diff --git a/chargebee/version.py b/chargebee/version.py
index 7bdfe7d..a3f615b 100644
--- a/chargebee/version.py
+++ b/chargebee/version.py
@@ -1 +1 @@
-VERSION = '2.4.1'
+VERSION = '2.4.3'
diff --git a/setup.py b/setup.py
index dce0273..78ab348 100644
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,7 @@ setup(
     author_email='support at chargebee.com',
     url='https://apidocs.chargebee.com/docs/api?lang=python',
     description='Python wrapper for the ChargeBee Subscription Billing API',
-    packages=find_packages(),
+    packages=find_packages(exclude=["tests"]),
     package_data={'chargebee': ['ssl/*.crt']},
     install_requires=requires,
     test_suite='tests',

-- 
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