diff options
| author | Scott Kitterman <scott@kitterman.com> | 2020-04-04 10:54:55 -0400 |
|---|---|---|
| committer | git-ubuntu importer <ubuntu-devel-discuss@lists.ubuntu.com> | 2020-04-04 22:28:31 +0000 |
| commit | f621f89b62a5a3eaad3f75fb62b67f4690eb1e3f (patch) | |
| tree | 91efa0f00df27aa55c362ad8e3df661d27d3554d | |
| parent | 05223f988afb84079eaea2e492164097042c4eee (diff) | |
2.7.3-1 (patches unapplied)import/2.7.3-1ubuntu/impish-develubuntu/impishubuntu/hirsute-develubuntu/hirsuteubuntu/groovy-proposedubuntu/groovy-develubuntu/groovydebian/bullseye
Imported using git-ubuntu import.
Notes
Notes:
* New upstream release
| -rw-r--r-- | CHANGELOG.md | 20 | ||||
| -rw-r--r-- | chargebee/models/contract_term.py | 10 | ||||
| -rw-r--r-- | chargebee/models/credit_note.py | 4 | ||||
| -rw-r--r-- | chargebee/models/customer.py | 2 | ||||
| -rw-r--r-- | chargebee/models/quote.py | 4 | ||||
| -rw-r--r-- | chargebee/models/quote_line_group.py | 25 | ||||
| -rw-r--r-- | chargebee/models/subscription.py | 18 | ||||
| -rw-r--r-- | chargebee/models/subscription_estimate.py | 5 | ||||
| -rw-r--r-- | chargebee/result.py | 15 | ||||
| -rw-r--r-- | chargebee/version.py | 2 | ||||
| -rw-r--r-- | debian/changelog | 6 |
11 files changed, 101 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index f820965..f8d6897 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ +### v2.7.3 (2020-04-03) +* * * + +* A subresource contract_term has been added in Subscription resource +* New endpoint refund_a_credit_note has been added in Credit notes resource +* New endpoint list_quote_line_groups has been added in Quotes resource +* New endpoint list_contract_terms_for_a_subscription has been added in Subscriptions resource +* New input parameter contract_term_billing_cycle_on_renewal, contract_term[action_at_term_end], contract_term[cancellation_cutoff_period] has been added in create_a_subscription, create_subscription_for_customer, update_a_subscription and reactivate_a_subscription apis +* New input parameter contract_term_cancel_option has been added in cancel_a_subscription api +* New input parameter contract_term[action_at_term_end], contract_term[cancellation_cutoff_period], subscription[contract_term_billing_cycle_on_renewal] has been added in create_subscription_estimate, create_subscription_for_a_customer_estimate, checkout_new_subscription, checkout_existing_subscription apis +* New input parameter business_customer_without_vat_number has been added in create_a_customer and update_billing_info_for_a_customer apis +* New input parameter addons[service_period] replaces the parameter addons[date_from] and addons[date_to] in create_a_quote_for_one-time_charges api +* New input parameter charges[service_period] replaces the parameter charges[date_from] and charges[date_to] in create_a_quote_for_one-time_charges api +* New input parameter consolidated_view has been added in retrieve_quote_as_pdf api +* New input parameter customer[business_customer_without_vat_number] has been added in create_a_subscription, update_a_subscription apis +* New value CHECKOUT_COM has been added in gateway enum +* New value CONTRACT_TERMINATION has been added to eventBasedAddons onEvent enum +* New values IDEAL, GOOGLE_PAY has been added to payment types enum +* New event types CONTRACT_TERM_CREATED, CONTRACT_TERM_RENEWED, CONTRACT_TERM_TERMINATED, CONTRACT_TERM_COMPLETED, CONTRACT_TERM_CANCELLED have been added + ### v2.7.2(2020-02-06) * * * diff --git a/chargebee/models/contract_term.py b/chargebee/models/contract_term.py new file mode 100644 index 0000000..29b21d8 --- /dev/null +++ b/chargebee/models/contract_term.py @@ -0,0 +1,10 @@ +import json +from chargebee.model import Model +from chargebee import request +from chargebee import APIError + +class ContractTerm(Model): + + fields = ["id", "status", "contract_start", "contract_end", "billing_cycle", "action_at_term_end", \ + "total_contract_value", "cancellation_cutoff_period", "created_at", "subscription_id", "remaining_billing_cycles"] + diff --git a/chargebee/models/credit_note.py b/chargebee/models/credit_note.py index 3681a08..68e0e4c 100644 --- a/chargebee/models/credit_note.py +++ b/chargebee/models/credit_note.py @@ -50,6 +50,10 @@ class CreditNote(Model): return request.send('post', request.uri_path("credit_notes",id,"pdf"), params, env, headers) @staticmethod + def refund(id, params=None, env=None, headers=None): + return request.send('post', request.uri_path("credit_notes",id,"refund"), params, env, headers) + + @staticmethod def record_refund(id, params, env=None, headers=None): return request.send('post', request.uri_path("credit_notes",id,"record_refund"), params, env, headers) diff --git a/chargebee/models/customer.py b/chargebee/models/customer.py index 835e369..2c53d67 100644 --- a/chargebee/models/customer.py +++ b/chargebee/models/customer.py @@ -31,7 +31,7 @@ class Customer(Model): "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", "balances", "meta_data", "deleted", \ - "registered_for_gst", "business_customer_without_vat_number", "customer_type", "client_profile_id", \ + "registered_for_gst", "customer_type", "business_customer_without_vat_number", "client_profile_id", \ "relationship"] diff --git a/chargebee/models/quote.py b/chargebee/models/quote.py index 5f1de9b..eb36bc6 100644 --- a/chargebee/models/quote.py +++ b/chargebee/models/quote.py @@ -54,6 +54,10 @@ class Quote(Model): return request.send_list_request('get', request.uri_path("quotes"), params, env, headers) @staticmethod + def quote_line_groups_for_quote(id, params=None, env=None, headers=None): + return request.send('get', request.uri_path("quotes",id,"quote_line_groups"), params, env, headers) + + @staticmethod def convert(id, params=None, env=None, headers=None): return request.send('post', request.uri_path("quotes",id,"convert"), params, env, headers) diff --git a/chargebee/models/quote_line_group.py b/chargebee/models/quote_line_group.py new file mode 100644 index 0000000..54a5c75 --- /dev/null +++ b/chargebee/models/quote_line_group.py @@ -0,0 +1,25 @@ +import json +from chargebee.model import Model +from chargebee import request +from chargebee import APIError + +class QuoteLineGroup(Model): + class LineItem(Model): + fields = ["id", "subscription_id", "date_from", "date_to", "unit_amount", "quantity", "amount", "pricing_model", "is_taxed", "tax_amount", "tax_rate", "discount_amount", "item_level_discount_amount", "description", "entity_type", "tax_exempt_reason", "entity_id", "customer_id"] + pass + class Discount(Model): + fields = ["amount", "description", "entity_type", "entity_id"] + pass + class LineItemDiscount(Model): + fields = ["line_item_id", "discount_type", "coupon_id", "discount_amount"] + pass + class Tax(Model): + fields = ["name", "amount", "description"] + pass + class LineItemTax(Model): + fields = ["line_item_id", "tax_name", "tax_rate", "is_partial_tax_applied", "is_non_compliance_tax", "taxable_amount", "tax_amount", "tax_juris_type", "tax_juris_name", "tax_juris_code", "tax_amount_in_local_currency", "local_currency_code"] + pass + + fields = ["id", "sub_total", "total", "credits_applied", "amount_paid", "amount_due", "charge_event", \ + "billing_cycle_number", "line_items", "discounts", "line_item_discounts", "taxes", "line_item_taxes"] + diff --git a/chargebee/models/subscription.py b/chargebee/models/subscription.py index 87625d4..efc4c42 100644 --- a/chargebee/models/subscription.py +++ b/chargebee/models/subscription.py @@ -22,16 +22,20 @@ class Subscription(Model): class ReferralInfo(Model): fields = ["referral_code", "coupon_code", "referrer_id", "external_reference_id", "reward_status", "referral_system", "account_id", "campaign_id", "external_campaign_id", "friend_offer_type", "referrer_reward_type", "notify_referral_system", "destination_url", "post_purchase_widget_enabled"] pass + class ContractTerm(Model): + fields = ["id", "status", "contract_start", "contract_end", "billing_cycle", "action_at_term_end", "total_contract_value", "cancellation_cutoff_period", "created_at", "subscription_id", "remaining_billing_cycles"] + pass fields = ["id", "customer_id", "currency_code", "plan_id", "plan_quantity", "plan_unit_price", \ "setup_fee", "plan_amount", "billing_period", "billing_period_unit", "plan_free_quantity", "status", \ "start_date", "trial_start", "trial_end", "current_term_start", "current_term_end", "next_billing_at", \ "remaining_billing_cycles", "po_number", "created_at", "started_at", "activated_at", "gift_id", \ - "override_relationship", "pause_date", "resume_date", "cancelled_at", "cancel_reason", "affiliate_token", \ - "created_from_ip", "resource_version", "updated_at", "has_scheduled_changes", "payment_source_id", \ - "auto_collection", "due_invoices_count", "due_since", "total_dues", "mrr", "exchange_rate", \ - "base_currency_code", "addons", "event_based_addons", "charged_event_based_addons", "coupon", \ - "coupons", "shipping_address", "referral_info", "invoice_notes", "meta_data", "deleted"] + "contract_term_billing_cycle_on_renewal", "override_relationship", "pause_date", "resume_date", \ + "cancelled_at", "cancel_reason", "affiliate_token", "created_from_ip", "resource_version", "updated_at", \ + "has_scheduled_changes", "payment_source_id", "auto_collection", "due_invoices_count", "due_since", \ + "total_dues", "mrr", "exchange_rate", "base_currency_code", "addons", "event_based_addons", \ + "charged_event_based_addons", "coupon", "coupons", "shipping_address", "referral_info", "invoice_notes", \ + "meta_data", "deleted", "contract_term"] @staticmethod @@ -51,6 +55,10 @@ class Subscription(Model): return request.send('get', request.uri_path("customers",id,"subscriptions"), params, env, headers) @staticmethod + def contract_terms_for_subscription(id, params=None, env=None, headers=None): + return request.send('get', request.uri_path("subscriptions",id,"contract_terms"), params, env, headers) + + @staticmethod def retrieve(id, env=None, headers=None): return request.send('get', request.uri_path("subscriptions",id), None, env, headers) diff --git a/chargebee/models/subscription_estimate.py b/chargebee/models/subscription_estimate.py index 10afcaa..46aa8a0 100644 --- a/chargebee/models/subscription_estimate.py +++ b/chargebee/models/subscription_estimate.py @@ -7,7 +7,10 @@ class SubscriptionEstimate(Model): class ShippingAddress(Model): fields = ["first_name", "last_name", "email", "company", "phone", "line1", "line2", "line3", "city", "state_code", "state", "country", "zip", "validation_status"] pass + class ContractTerm(Model): + fields = ["id", "status", "contract_start", "contract_end", "billing_cycle", "action_at_term_end", "total_contract_value", "cancellation_cutoff_period", "created_at", "subscription_id", "remaining_billing_cycles"] + pass fields = ["id", "currency_code", "status", "next_billing_at", "pause_date", "resume_date", \ - "shipping_address"] + "shipping_address", "contract_term"] diff --git a/chargebee/result.py b/chargebee/result.py index 2f6b1ad..5deeede 100644 --- a/chargebee/result.py +++ b/chargebee/result.py @@ -11,10 +11,15 @@ class Result(object): @property def subscription(self): subscription = self._get('subscription', Subscription, - {'addons' : Subscription.Addon, 'event_based_addons' : Subscription.EventBasedAddon, 'charged_event_based_addons' : Subscription.ChargedEventBasedAddon, 'coupons' : Subscription.Coupon, 'shipping_address' : Subscription.ShippingAddress, 'referral_info' : Subscription.ReferralInfo}); + {'addons' : Subscription.Addon, 'event_based_addons' : Subscription.EventBasedAddon, 'charged_event_based_addons' : Subscription.ChargedEventBasedAddon, 'coupons' : Subscription.Coupon, 'shipping_address' : Subscription.ShippingAddress, 'referral_info' : Subscription.ReferralInfo, 'contract_term' : Subscription.ContractTerm}); return subscription; @property + def contract_term(self): + contract_term = self._get('contract_term', ContractTerm); + return contract_term; + + @property def customer(self): customer = self._get('customer', Customer, {'billing_address' : Customer.BillingAddress, 'referral_urls' : Customer.ReferralUrl, 'contacts' : Customer.Contact, 'payment_method' : Customer.PaymentMethod, 'balances' : Customer.Balance, 'relationship' : Customer.Relationship}); @@ -107,7 +112,7 @@ class Result(object): estimate = self._get('estimate', Estimate, {}, {'subscription_estimate' : SubscriptionEstimate, 'invoice_estimate' : InvoiceEstimate, 'invoice_estimates' : InvoiceEstimate, 'next_invoice_estimate' : InvoiceEstimate, 'credit_note_estimates' : CreditNoteEstimate, 'unbilled_charge_estimates' : UnbilledCharge}); estimate.init_dependant(self._response['estimate'], 'subscription_estimate', - {'shipping_address' : SubscriptionEstimate.ShippingAddress}); + {'shipping_address' : SubscriptionEstimate.ShippingAddress, 'contract_term' : SubscriptionEstimate.ContractTerm}); estimate.init_dependant(self._response['estimate'], 'invoice_estimate', {'line_items' : InvoiceEstimate.LineItem, 'discounts' : InvoiceEstimate.Discount, 'taxes' : InvoiceEstimate.Tax, 'line_item_taxes' : InvoiceEstimate.LineItemTax, 'line_item_tiers' : InvoiceEstimate.LineItemTier, 'line_item_discounts' : InvoiceEstimate.LineItemDiscount}); estimate.init_dependant(self._response['estimate'], 'next_invoice_estimate', @@ -127,6 +132,12 @@ class Result(object): return quote; @property + def quote_line_group(self): + quote_line_group = self._get('quote_line_group', QuoteLineGroup, + {'line_items' : QuoteLineGroup.LineItem, 'discounts' : QuoteLineGroup.Discount, 'line_item_discounts' : QuoteLineGroup.LineItemDiscount, 'taxes' : QuoteLineGroup.Tax, 'line_item_taxes' : QuoteLineGroup.LineItemTax}); + return quote_line_group; + + @property def plan(self): plan = self._get('plan', Plan, {'tiers' : Plan.Tier, 'applicable_addons' : Plan.ApplicableAddon, 'attached_addons' : Plan.AttachedAddon, 'event_based_addons' : Plan.EventBasedAddon}); diff --git a/chargebee/version.py b/chargebee/version.py index 00ed4ea..b5389a1 100644 --- a/chargebee/version.py +++ b/chargebee/version.py @@ -1 +1 @@ -VERSION = '2.7.2' +VERSION = '2.7.3' diff --git a/debian/changelog b/debian/changelog index 11c54d6..3485411 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +chargebee2-python (2.7.3-1) unstable; urgency=medium + + * New upstream release + + -- Scott Kitterman <scott@kitterman.com> Sat, 04 Apr 2020 10:54:55 -0400 + chargebee2-python (2.7.2-1) unstable; urgency=medium [ Debian Janitor ] |
