فهرست منبع

#542 Chargebee from 2.0.5 to 2.2.2

Alex Trofimov 9 سال پیش
والد
کامیت
7b1d056512
32فایلهای تغییر یافته به همراه189 افزوده شده و 32 حذف شده
  1. 3 0
      plugins/chargebee/ChargeBee.php
  2. 9 0
      plugins/chargebee/ChargeBee/Model.php
  3. 12 2
      plugins/chargebee/ChargeBee/Models/Addon.php
  4. 1 1
      plugins/chargebee/ChargeBee/Models/Address.php
  5. 2 2
      plugins/chargebee/ChargeBee/Models/Card.php
  6. 16 1
      plugins/chargebee/ChargeBee/Models/Coupon.php
  7. 5 0
      plugins/chargebee/ChargeBee/Models/CouponCode.php
  8. 11 1
      plugins/chargebee/ChargeBee/Models/CreditNote.php
  9. 2 2
      plugins/chargebee/ChargeBee/Models/CreditNoteEstimate.php
  10. 1 1
      plugins/chargebee/ChargeBee/Models/CreditNoteEstimateLineItem.php
  11. 1 1
      plugins/chargebee/ChargeBee/Models/CreditNoteLineItem.php
  12. 6 1
      plugins/chargebee/ChargeBee/Models/Customer.php
  13. 1 1
      plugins/chargebee/ChargeBee/Models/CustomerBillingAddress.php
  14. 1 1
      plugins/chargebee/ChargeBee/Models/CustomerPaymentMethod.php
  15. 5 0
      plugins/chargebee/ChargeBee/Models/Estimate.php
  16. 11 1
      plugins/chargebee/ChargeBee/Models/Invoice.php
  17. 1 1
      plugins/chargebee/ChargeBee/Models/InvoiceBillingAddress.php
  18. 2 2
      plugins/chargebee/ChargeBee/Models/InvoiceEstimate.php
  19. 1 1
      plugins/chargebee/ChargeBee/Models/InvoiceEstimateLineItem.php
  20. 1 1
      plugins/chargebee/ChargeBee/Models/InvoiceLineItem.php
  21. 1 1
      plugins/chargebee/ChargeBee/Models/InvoiceShippingAddress.php
  22. 12 2
      plugins/chargebee/ChargeBee/Models/Plan.php
  23. 22 2
      plugins/chargebee/ChargeBee/Models/Subscription.php
  24. 1 1
      plugins/chargebee/ChargeBee/Models/SubscriptionAddon.php
  25. 1 1
      plugins/chargebee/ChargeBee/Models/SubscriptionEstimate.php
  26. 9 0
      plugins/chargebee/ChargeBee/Models/SubscriptionEstimateShippingAddress.php
  27. 1 1
      plugins/chargebee/ChargeBee/Models/SubscriptionShippingAddress.php
  28. 16 0
      plugins/chargebee/ChargeBee/Models/ThirdPartyPaymentMethod.php
  29. 2 2
      plugins/chargebee/ChargeBee/Models/Transaction.php
  30. 7 1
      plugins/chargebee/ChargeBee/Result.php
  31. 1 1
      plugins/chargebee/ChargeBee/Version.php
  32. 24 0
      plugins/chargebee/LICENSE

+ 3 - 0
plugins/chargebee/ChargeBee.php

@@ -57,6 +57,7 @@ require(dirname(__FILE__) . '/ChargeBee/Models/CustomerContact.php');
 require(dirname(__FILE__) . '/ChargeBee/Models/CustomerBillingAddress.php');
 require(dirname(__FILE__) . '/ChargeBee/Models/CustomerPaymentMethod.php');
 require(dirname(__FILE__) . '/ChargeBee/Models/Card.php');
+require(dirname(__FILE__) . '/ChargeBee/Models/ThirdPartyPaymentMethod.php');
 require(dirname(__FILE__) . '/ChargeBee/Models/Address.php');
 require(dirname(__FILE__) . '/ChargeBee/Models/Invoice.php');
 require(dirname(__FILE__) . '/ChargeBee/Models/InvoiceLineItem.php');
@@ -108,3 +109,5 @@ require(dirname(__FILE__) . '/ChargeBee/Models/InvoiceLineItemTax.php');
 require(dirname(__FILE__) . '/ChargeBee/Models/InvoiceEstimateLineItemTax.php');
 require(dirname(__FILE__) . '/ChargeBee/Models/TransactionLinkedCreditNote.php');
 require(dirname(__FILE__) . '/ChargeBee/Models/SubscriptionEstimate.php');
+require(dirname(__FILE__) . '/ChargeBee/Models/SubscriptionEstimateShippingAddress.php');
+

+ 9 - 0
plugins/chargebee/ChargeBee/Model.php

@@ -31,6 +31,15 @@ class ChargeBee_Model
 	    throw new Exception("Unknown param $k in " . get_class($this));
 	  }
 	}
+
+	public function getValues()
+  	{
+    	return $this->_values;
+  	}
+
+  	public function toJson() { 
+  		return json_encode($this->_values); 
+  	}
 	
 	public function __set($k, $v)
 	{

+ 12 - 2
plugins/chargebee/ChargeBee/Models/Addon.php

@@ -3,8 +3,8 @@
 class ChargeBee_Addon extends ChargeBee_Model
 {
 
-  protected $allowed = array('id', 'name', 'invoiceName', 'description', 'type', 'chargeType', 'price', 'period',
-'periodUnit', 'unit', 'status', 'archivedAt', 'enabledInPortal', 'taxCode', 'invoiceNotes','taxable', 'metaData');
+  protected $allowed = array('id', 'name', 'invoiceName', 'description', 'type', 'chargeType', 'price', 'currencyCode',
+'period', 'periodUnit', 'unit', 'status', 'archivedAt', 'enabledInPortal', 'taxCode', 'sku','accountingCode', 'accountingCategory1', 'accountingCategory2', 'resourceVersion', 'updatedAt','invoiceNotes', 'taxable', 'taxProfileId', 'metaData');
 
 
 
@@ -36,6 +36,16 @@ class ChargeBee_Addon extends ChargeBee_Model
     return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("addons",$id,"delete"), array(), $env, $headers);
   }
 
+  public static function copy($params, $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("addons","copy"), $params, $env, $headers);
+  }
+
+  public static function unarchive($id, $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("addons",$id,"unarchive"), array(), $env, $headers);
+  }
+
  }
 
 ?>

+ 1 - 1
plugins/chargebee/ChargeBee/Models/Address.php

@@ -4,7 +4,7 @@ class ChargeBee_Address extends ChargeBee_Model
 {
 
   protected $allowed = array('label', 'firstName', 'lastName', 'email', 'company', 'phone', 'addr', 'extendedAddr',
-'extendedAddr2', 'city', 'stateCode', 'state', 'country', 'zip', 'subscriptionId');
+'extendedAddr2', 'city', 'stateCode', 'state', 'country', 'zip', 'validationStatus', 'subscriptionId');
 
 
 

+ 2 - 2
plugins/chargebee/ChargeBee/Models/Card.php

@@ -3,8 +3,8 @@
 class ChargeBee_Card extends ChargeBee_Model
 {
 
-  protected $allowed = array('customerId', 'status', 'gateway', 'firstName', 'lastName', 'iin', 'last4', 'cardType',
-'expiryMonth', 'expiryYear', 'billingAddr1', 'billingAddr2', 'billingCity', 'billingStateCode','billingState', 'billingCountry', 'billingZip', 'ipAddress', 'maskedNumber');
+  protected $allowed = array('customerId', 'status', 'gateway', 'gatewayAccountId', 'firstName', 'lastName',
+'iin', 'last4', 'cardType', 'fundingType', 'expiryMonth', 'expiryYear', 'billingAddr1', 'billingAddr2','billingCity', 'billingStateCode', 'billingState', 'billingCountry', 'billingZip', 'ipAddress','maskedNumber');
 
 
 

+ 16 - 1
plugins/chargebee/ChargeBee/Models/Coupon.php

@@ -4,7 +4,7 @@ class ChargeBee_Coupon extends ChargeBee_Model
 {
 
   protected $allowed = array('id', 'name', 'invoiceName', 'discountType', 'discountPercentage', 'discountAmount',
-'discountQuantity', 'durationType', 'durationMonth', 'validTill', 'maxRedemptions', 'status','applyDiscountOn', 'applyOn', 'planConstraint', 'addonConstraint', 'createdAt', 'archivedAt','planIds', 'addonIds', 'redemptions', 'invoiceNotes', 'metaData');
+'discountQuantity', 'currencyCode', 'durationType', 'durationMonth', 'validTill', 'maxRedemptions','status', 'applyDiscountOn', 'applyOn', 'planConstraint', 'addonConstraint', 'createdAt', 'archivedAt','resourceVersion', 'updatedAt', 'planIds', 'addonIds', 'redemptions', 'invoiceNotes', 'metaData');
 
 
 
@@ -26,6 +26,21 @@ class ChargeBee_Coupon extends ChargeBee_Model
     return ChargeBee_Request::send(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("coupons",$id), array(), $env, $headers);
   }
 
+  public static function delete($id, $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("coupons",$id,"delete"), array(), $env, $headers);
+  }
+
+  public static function copy($params, $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("coupons","copy"), $params, $env, $headers);
+  }
+
+  public static function unarchive($id, $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("coupons",$id,"unarchive"), array(), $env, $headers);
+  }
+
  }
 
 ?>

+ 5 - 0
plugins/chargebee/ChargeBee/Models/CouponCode.php

@@ -21,6 +21,11 @@ class ChargeBee_CouponCode extends ChargeBee_Model
     return ChargeBee_Request::send(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("coupon_codes",$id), array(), $env, $headers);
   }
 
+  public static function all($params = array(), $env = null, $headers = array())
+  {
+    return ChargeBee_Request::sendListRequest(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("coupon_codes"), $params, $env, $headers);
+  }
+
   public static function archive($id, $env = null, $headers = array())
   {
     return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("coupon_codes",$id,"archive"), array(), $env, $headers);

+ 11 - 1
plugins/chargebee/ChargeBee/Models/CreditNote.php

@@ -4,18 +4,28 @@ class ChargeBee_CreditNote extends ChargeBee_Model
 {
 
   protected $allowed = array('id', 'customerId', 'subscriptionId', 'referenceInvoiceId', 'type', 'reasonCode',
-'status', 'vatNumber', 'date', 'priceType', 'total', 'amountAllocated', 'amountRefunded', 'amountAvailable','refundedAt', 'subTotal', 'currencyCode', 'lineItems', 'discounts', 'taxes', 'lineItemTaxes','linkedRefunds', 'allocations');
+'status', 'vatNumber', 'date', 'priceType', 'currencyCode', 'total', 'amountAllocated', 'amountRefunded','amountAvailable', 'refundedAt', 'voidedAt', 'resourceVersion', 'updatedAt', 'subTotal', 'lineItems','discounts', 'taxes', 'lineItemTaxes', 'linkedRefunds', 'allocations', 'deleted');
 
 
 
   # OPERATIONS
   #-----------
 
+  public static function create($params, $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("credit_notes"), $params, $env, $headers);
+  }
+
   public static function retrieve($id, $env = null, $headers = array())
   {
     return ChargeBee_Request::send(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("credit_notes",$id), array(), $env, $headers);
   }
 
+  public static function pdf($id, $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("credit_notes",$id,"pdf"), array(), $env, $headers);
+  }
+
   public static function all($params = array(), $env = null, $headers = array())
   {
     return ChargeBee_Request::sendListRequest(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("credit_notes"), $params, $env, $headers);

+ 2 - 2
plugins/chargebee/ChargeBee/Models/CreditNoteEstimate.php

@@ -3,8 +3,8 @@
 class ChargeBee_CreditNoteEstimate extends ChargeBee_Model
 {
 
-  protected $allowed = array('referenceInvoiceId', 'type', 'priceType', 'subTotal', 'total', 'amountAllocated',
-'amountAvailable', 'lineItems', 'discounts', 'taxes', 'lineItemTaxes');
+  protected $allowed = array('referenceInvoiceId', 'type', 'priceType', 'currencyCode', 'subTotal', 'total',
+'amountAllocated', 'amountAvailable', 'lineItems', 'discounts', 'taxes', 'lineItemTaxes');
 
 
 

+ 1 - 1
plugins/chargebee/ChargeBee/Models/CreditNoteEstimateLineItem.php

@@ -2,7 +2,7 @@
 
 class ChargeBee_CreditNoteEstimateLineItem extends ChargeBee_Model
 {
-  protected $allowed = array('id', 'date_from', 'date_to', 'unit_amount', 'quantity', 'is_taxed', 'tax_amount', 'tax_rate', 'amount', 'discount_amount', 'item_level_discount_amount', 'description', 'entity_type', 'entity_id');
+  protected $allowed = array('id', 'date_from', 'date_to', 'unit_amount', 'quantity', 'is_taxed', 'tax_amount', 'tax_rate', 'amount', 'discount_amount', 'item_level_discount_amount', 'description', 'entity_type', 'tax_exempt_reason', 'entity_id');
 
 }
 

+ 1 - 1
plugins/chargebee/ChargeBee/Models/CreditNoteLineItem.php

@@ -2,7 +2,7 @@
 
 class ChargeBee_CreditNoteLineItem extends ChargeBee_Model
 {
-  protected $allowed = array('id', 'date_from', 'date_to', 'unit_amount', 'quantity', 'is_taxed', 'tax_amount', 'tax_rate', 'amount', 'discount_amount', 'item_level_discount_amount', 'description', 'entity_type', 'entity_id');
+  protected $allowed = array('id', 'date_from', 'date_to', 'unit_amount', 'quantity', 'is_taxed', 'tax_amount', 'tax_rate', 'amount', 'discount_amount', 'item_level_discount_amount', 'description', 'entity_type', 'tax_exempt_reason', 'entity_id');
 
 }
 

+ 6 - 1
plugins/chargebee/ChargeBee/Models/Customer.php

@@ -4,7 +4,7 @@ class ChargeBee_Customer extends ChargeBee_Model
 {
 
   protected $allowed = array('id', 'firstName', 'lastName', 'email', 'phone', 'company', 'vatNumber', 'autoCollection',
-'allowDirectDebit', 'createdAt', 'createdFromIp', 'taxability', 'entityCode', 'exemptNumber','cardStatus', 'billingAddress', 'contacts', 'paymentMethod', 'invoiceNotes', 'promotionalCredits','refundableCredits', 'excessPayments', 'metaData');
+'netTermDays', 'allowDirectDebit', 'createdAt', 'createdFromIp', 'taxability', 'entityCode','exemptNumber', 'resourceVersion', 'updatedAt', 'locale', 'cardStatus', 'fraudFlag', 'billingAddress','contacts', 'paymentMethod', 'invoiceNotes', 'preferredCurrencyCode', 'promotionalCredits','refundableCredits', 'excessPayments', 'metaData', 'deleted');
 
 
 
@@ -71,6 +71,11 @@ class ChargeBee_Customer extends ChargeBee_Model
     return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"set_promotional_credits"), $params, $env, $headers);
   }
 
+  public static function recordExcessPayment($id, $params, $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"record_excess_payment"), $params, $env, $headers);
+  }
+
   public static function delete($id, $params = array(), $env = null, $headers = array())
   {
     return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"delete"), $params, $env, $headers);

+ 1 - 1
plugins/chargebee/ChargeBee/Models/CustomerBillingAddress.php

@@ -2,7 +2,7 @@
 
 class ChargeBee_CustomerBillingAddress extends ChargeBee_Model
 {
-  protected $allowed = array('first_name', 'last_name', 'email', 'company', 'phone', 'line1', 'line2', 'line3', 'city', 'state_code', 'state', 'country', 'zip');
+  protected $allowed = array('first_name', 'last_name', 'email', 'company', 'phone', 'line1', 'line2', 'line3', 'city', 'state_code', 'state', 'country', 'zip', 'validation_status');
 
 }
 

+ 1 - 1
plugins/chargebee/ChargeBee/Models/CustomerPaymentMethod.php

@@ -2,7 +2,7 @@
 
 class ChargeBee_CustomerPaymentMethod extends ChargeBee_Model
 {
-  protected $allowed = array('type', 'gateway', 'status', 'reference_id');
+  protected $allowed = array('type', 'gateway', 'gateway_account_id', 'status', 'reference_id');
 
 }
 

+ 5 - 0
plugins/chargebee/ChargeBee/Models/Estimate.php

@@ -16,6 +16,11 @@ class ChargeBee_Estimate extends ChargeBee_Model
     return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("estimates","create_subscription"), $params, $env, $headers);
   }
 
+  public static function createSubForCustomerEstimate($id, $params, $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("customers",$id,"create_subscription_estimate"), $params, $env, $headers);
+  }
+
   public static function updateSubscription($params, $env = null, $headers = array())
   {
     return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("estimates","update_subscription"), $params, $env, $headers);

+ 11 - 1
plugins/chargebee/ChargeBee/Models/Invoice.php

@@ -4,7 +4,7 @@ class ChargeBee_Invoice extends ChargeBee_Model
 {
 
   protected $allowed = array('id', 'poNumber', 'customerId', 'subscriptionId', 'recurring', 'status', 'vatNumber',
-'priceType', 'date', 'total', 'amountPaid', 'amountAdjusted', 'writeOffAmount', 'creditsApplied','amountDue', 'paidAt', 'dunningStatus', 'nextRetryAt', 'subTotal', 'tax', 'firstInvoice', 'currencyCode','lineItems', 'discounts', 'taxes', 'lineItemTaxes', 'linkedPayments', 'appliedCredits', 'adjustmentCreditNotes','issuedCreditNotes', 'linkedOrders', 'notes', 'shippingAddress', 'billingAddress');
+'priceType', 'date', 'dueDate', 'netTermDays', 'currencyCode', 'total', 'amountPaid', 'amountAdjusted','writeOffAmount', 'creditsApplied', 'amountDue', 'paidAt', 'dunningStatus', 'nextRetryAt', 'voidedAt','resourceVersion', 'updatedAt', 'subTotal', 'tax', 'firstInvoice', 'lineItems', 'discounts','taxes', 'lineItemTaxes', 'linkedPayments', 'appliedCredits', 'adjustmentCreditNotes', 'issuedCreditNotes','linkedOrders', 'notes', 'shippingAddress', 'billingAddress', 'deleted');
 
 
 
@@ -31,6 +31,11 @@ class ChargeBee_Invoice extends ChargeBee_Model
     return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("invoices",$id,"stop_dunning"), array(), $env, $headers);
   }
 
+  public static function importInvoice($params, $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("invoices","import_invoice"), $params, $env, $headers);
+  }
+
   public static function all($params = array(), $env = null, $headers = array())
   {
     return ChargeBee_Request::sendListRequest(ChargeBee_Request::GET, ChargeBee_Util::encodeURIPath("invoices"), $params, $env, $headers);
@@ -96,6 +101,11 @@ class ChargeBee_Invoice extends ChargeBee_Model
     return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("invoices",$id,"void"), $params, $env, $headers);
   }
 
+  public static function writeOff($id, $params = array(), $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("invoices",$id,"write_off"), $params, $env, $headers);
+  }
+
   public static function delete($id, $params = array(), $env = null, $headers = array())
   {
     return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("invoices",$id,"delete"), $params, $env, $headers);

+ 1 - 1
plugins/chargebee/ChargeBee/Models/InvoiceBillingAddress.php

@@ -2,7 +2,7 @@
 
 class ChargeBee_InvoiceBillingAddress extends ChargeBee_Model
 {
-  protected $allowed = array('first_name', 'last_name', 'email', 'company', 'phone', 'line1', 'line2', 'line3', 'city', 'state_code', 'state', 'country', 'zip');
+  protected $allowed = array('first_name', 'last_name', 'email', 'company', 'phone', 'line1', 'line2', 'line3', 'city', 'state_code', 'state', 'country', 'zip', 'validation_status');
 
 }
 

+ 2 - 2
plugins/chargebee/ChargeBee/Models/InvoiceEstimate.php

@@ -3,8 +3,8 @@
 class ChargeBee_InvoiceEstimate extends ChargeBee_Model
 {
 
-  protected $allowed = array('recurring', 'priceType', 'subTotal', 'total', 'creditsApplied', 'amountPaid',
-'amountDue', 'lineItems', 'discounts', 'taxes', 'lineItemTaxes');
+  protected $allowed = array('recurring', 'priceType', 'currencyCode', 'subTotal', 'total', 'creditsApplied',
+'amountPaid', 'amountDue', 'lineItems', 'discounts', 'taxes', 'lineItemTaxes');
 
 
 

+ 1 - 1
plugins/chargebee/ChargeBee/Models/InvoiceEstimateLineItem.php

@@ -2,7 +2,7 @@
 
 class ChargeBee_InvoiceEstimateLineItem extends ChargeBee_Model
 {
-  protected $allowed = array('id', 'date_from', 'date_to', 'unit_amount', 'quantity', 'is_taxed', 'tax_amount', 'tax_rate', 'amount', 'discount_amount', 'item_level_discount_amount', 'description', 'entity_type', 'entity_id');
+  protected $allowed = array('id', 'date_from', 'date_to', 'unit_amount', 'quantity', 'is_taxed', 'tax_amount', 'tax_rate', 'amount', 'discount_amount', 'item_level_discount_amount', 'description', 'entity_type', 'tax_exempt_reason', 'entity_id');
 
 }
 

+ 1 - 1
plugins/chargebee/ChargeBee/Models/InvoiceLineItem.php

@@ -2,7 +2,7 @@
 
 class ChargeBee_InvoiceLineItem extends ChargeBee_Model
 {
-  protected $allowed = array('id', 'date_from', 'date_to', 'unit_amount', 'quantity', 'is_taxed', 'tax_amount', 'tax_rate', 'amount', 'discount_amount', 'item_level_discount_amount', 'description', 'entity_type', 'entity_id');
+  protected $allowed = array('id', 'date_from', 'date_to', 'unit_amount', 'quantity', 'is_taxed', 'tax_amount', 'tax_rate', 'amount', 'discount_amount', 'item_level_discount_amount', 'description', 'entity_type', 'tax_exempt_reason', 'entity_id');
 
 }
 

+ 1 - 1
plugins/chargebee/ChargeBee/Models/InvoiceShippingAddress.php

@@ -2,7 +2,7 @@
 
 class ChargeBee_InvoiceShippingAddress extends ChargeBee_Model
 {
-  protected $allowed = array('first_name', 'last_name', 'email', 'company', 'phone', 'line1', 'line2', 'line3', 'city', 'state_code', 'state', 'country', 'zip');
+  protected $allowed = array('first_name', 'last_name', 'email', 'company', 'phone', 'line1', 'line2', 'line3', 'city', 'state_code', 'state', 'country', 'zip', 'validation_status');
 
 }
 

+ 12 - 2
plugins/chargebee/ChargeBee/Models/Plan.php

@@ -3,8 +3,8 @@
 class ChargeBee_Plan extends ChargeBee_Model
 {
 
-  protected $allowed = array('id', 'name', 'invoiceName', 'description', 'price', 'period', 'periodUnit', 'trialPeriod',
-'trialPeriodUnit', 'chargeModel', 'freeQuantity', 'setupCost', 'downgradePenalty', 'status','archivedAt', 'billingCycles', 'redirectUrl', 'enabledInHostedPages', 'enabledInPortal', 'taxCode','invoiceNotes', 'taxable', 'metaData');
+  protected $allowed = array('id', 'name', 'invoiceName', 'description', 'price', 'currencyCode', 'period',
+'periodUnit', 'trialPeriod', 'trialPeriodUnit', 'chargeModel', 'freeQuantity', 'setupCost','downgradePenalty', 'status', 'archivedAt', 'billingCycles', 'redirectUrl', 'enabledInHostedPages','enabledInPortal', 'taxCode', 'sku', 'accountingCode', 'accountingCategory1', 'accountingCategory2','resourceVersion', 'updatedAt', 'invoiceNotes', 'taxable', 'taxProfileId', 'metaData');
 
 
 
@@ -36,6 +36,16 @@ class ChargeBee_Plan extends ChargeBee_Model
     return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("plans",$id,"delete"), array(), $env, $headers);
   }
 
+  public static function copy($params, $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("plans","copy"), $params, $env, $headers);
+  }
+
+  public static function unarchive($id, $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("plans",$id,"unarchive"), array(), $env, $headers);
+  }
+
  }
 
 ?>

+ 22 - 2
plugins/chargebee/ChargeBee/Models/Subscription.php

@@ -3,8 +3,8 @@
 class ChargeBee_Subscription extends ChargeBee_Model
 {
 
-  protected $allowed = array('id', 'customerId', 'planId', 'planQuantity', 'status', 'startDate', 'trialStart',
-'trialEnd', 'currentTermStart', 'currentTermEnd', 'remainingBillingCycles', 'poNumber', 'createdAt','startedAt', 'activatedAt', 'cancelledAt', 'cancelReason', 'affiliateToken', 'createdFromIp','hasScheduledChanges', 'dueInvoicesCount', 'dueSince', 'totalDues', 'addons', 'coupon', 'coupons','shippingAddress', 'invoiceNotes', 'metaData');
+  protected $allowed = array('id', 'customerId', 'currencyCode', 'planId', 'planQuantity', 'planUnitPrice',
+'setupFee', 'billingPeriod', 'billingPeriodUnit', 'planFreeQuantity', 'status', 'startDate','trialStart', 'trialEnd', 'currentTermStart', 'currentTermEnd', 'nextBillingAt', 'remainingBillingCycles','poNumber', 'createdAt', 'startedAt', 'activatedAt', 'cancelledAt', 'cancelReason', 'affiliateToken','createdFromIp', 'resourceVersion', 'updatedAt', 'hasScheduledChanges', 'dueInvoicesCount','dueSince', 'totalDues', 'mrr', 'exchangeRate', 'baseCurrencyCode', 'addons', 'coupon', 'coupons','shippingAddress', 'invoiceNotes', 'metaData', 'deleted');
 
 
 
@@ -51,6 +51,11 @@ class ChargeBee_Subscription extends ChargeBee_Model
     return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("subscriptions",$id,"remove_scheduled_cancellation"), $params, $env, $headers);
   }
 
+  public static function removeCoupons($id, $params = array(), $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("subscriptions",$id,"remove_coupons"), $params, $env, $headers);
+  }
+
   public static function update($id, $params = array(), $env = null, $headers = array())
   {
     return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("subscriptions",$id), $params, $env, $headers);
@@ -81,6 +86,21 @@ class ChargeBee_Subscription extends ChargeBee_Model
     return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("subscriptions",$id,"charge_addon_at_term_end"), $params, $env, $headers);
   }
 
+  public static function chargeFutureRenewals($id, $params = array(), $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("subscriptions",$id,"charge_future_renewals"), $params, $env, $headers);
+  }
+
+  public static function importSubscription($params, $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("subscriptions","import_subscription"), $params, $env, $headers);
+  }
+
+  public static function importForCustomer($id, $params, $env = null, $headers = array())
+  {
+    return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("customers",$id,"import_subscription"), $params, $env, $headers);
+  }
+
   public static function delete($id, $env = null, $headers = array())
   {
     return ChargeBee_Request::send(ChargeBee_Request::POST, ChargeBee_Util::encodeURIPath("subscriptions",$id,"delete"), array(), $env, $headers);

+ 1 - 1
plugins/chargebee/ChargeBee/Models/SubscriptionAddon.php

@@ -2,7 +2,7 @@
 
 class ChargeBee_SubscriptionAddon extends ChargeBee_Model
 {
-  protected $allowed = array('id', 'quantity');
+  protected $allowed = array('id', 'quantity', 'unit_price');
 
 }
 

+ 1 - 1
plugins/chargebee/ChargeBee/Models/SubscriptionEstimate.php

@@ -3,7 +3,7 @@
 class ChargeBee_SubscriptionEstimate extends ChargeBee_Model
 {
 
-  protected $allowed = array('id', 'status', 'nextBillingAt'
+  protected $allowed = array('id', 'currencyCode', 'status', 'nextBillingAt', 'shippingAddress'
 );
 
 

+ 9 - 0
plugins/chargebee/ChargeBee/Models/SubscriptionEstimateShippingAddress.php

@@ -0,0 +1,9 @@
+<?php
+
+class ChargeBee_SubscriptionEstimateShippingAddress extends ChargeBee_Model
+{
+  protected $allowed = array('first_name', 'last_name', 'email', 'company', 'phone', 'line1', 'line2', 'line3', 'city', 'state_code', 'state', 'country', 'zip', 'validation_status');
+
+}
+
+?>

+ 1 - 1
plugins/chargebee/ChargeBee/Models/SubscriptionShippingAddress.php

@@ -2,7 +2,7 @@
 
 class ChargeBee_SubscriptionShippingAddress extends ChargeBee_Model
 {
-  protected $allowed = array('first_name', 'last_name', 'email', 'company', 'phone', 'line1', 'line2', 'line3', 'city', 'state_code', 'state', 'country', 'zip');
+  protected $allowed = array('first_name', 'last_name', 'email', 'company', 'phone', 'line1', 'line2', 'line3', 'city', 'state_code', 'state', 'country', 'zip', 'validation_status');
 
 }
 

+ 16 - 0
plugins/chargebee/ChargeBee/Models/ThirdPartyPaymentMethod.php

@@ -0,0 +1,16 @@
+<?php
+
+class ChargeBee_ThirdPartyPaymentMethod extends ChargeBee_Model
+{
+
+  protected $allowed = array('type', 'gateway', 'gatewayAccountId', 'referenceId'
+);
+
+
+
+  # OPERATIONS
+  #-----------
+
+ }
+
+?>

+ 2 - 2
plugins/chargebee/ChargeBee/Models/Transaction.php

@@ -3,8 +3,8 @@
 class ChargeBee_Transaction extends ChargeBee_Model
 {
 
-  protected $allowed = array('id', 'customerId', 'subscriptionId', 'paymentMethod', 'referenceNumber', 'gateway',
-'type', 'date', 'amount', 'idAtGateway', 'status', 'errorCode', 'errorText', 'voidedAt', 'amountUnused','maskedCardNumber', 'referenceTransactionId', 'refundedTxnId', 'reversalTransactionId', 'linkedInvoices','linkedCreditNotes', 'linkedRefunds', 'currencyCode');
+  protected $allowed = array('id', 'customerId', 'subscriptionId', 'gatewayAccountId', 'paymentMethod', 'referenceNumber',
+'gateway', 'type', 'date', 'currencyCode', 'amount', 'idAtGateway', 'status', 'errorCode', 'errorText','voidedAt', 'resourceVersion', 'updatedAt', 'amountUnused', 'maskedCardNumber', 'referenceTransactionId','refundedTxnId', 'reversalTransactionId', 'linkedInvoices', 'linkedCreditNotes', 'linkedRefunds','deleted');
 
 
 

+ 7 - 1
plugins/chargebee/ChargeBee/Result.php

@@ -32,6 +32,12 @@ class ChargeBee_Result
         return $card;
     }
 
+    function thirdPartyPaymentMethod() 
+    {
+        $third_party_payment_method = $this->_get('third_party_payment_method', 'ChargeBee_ThirdPartyPaymentMethod');
+        return $third_party_payment_method;
+    }
+
     function invoice() 
     {
         $invoice = $this->_get('invoice', 'ChargeBee_Invoice', 
@@ -70,7 +76,7 @@ class ChargeBee_Result
         $estimate = $this->_get('estimate', 'ChargeBee_Estimate', array(),
         array('subscription_estimate' => 'ChargeBee_SubscriptionEstimate', 'invoice_estimate' => 'ChargeBee_InvoiceEstimate', 'next_invoice_estimate' => 'ChargeBee_InvoiceEstimate', 'credit_note_estimates' => 'ChargeBee_CreditNoteEstimate'));
         $estimate->_initDependant($this->_response['estimate'], 'subscription_estimate', 
-        array());
+        array('shipping_address' => 'ChargeBee_SubscriptionEstimateShippingAddress'));
         $estimate->_initDependant($this->_response['estimate'], 'invoice_estimate', 
         array('line_items' => 'ChargeBee_InvoiceEstimateLineItem', 'discounts' => 'ChargeBee_InvoiceEstimateDiscount', 'taxes' => 'ChargeBee_InvoiceEstimateTax', 'line_item_taxes' => 'ChargeBee_InvoiceEstimateLineItemTax'));
         $estimate->_initDependant($this->_response['estimate'], 'next_invoice_estimate', 

+ 1 - 1
plugins/chargebee/ChargeBee/Version.php

@@ -2,7 +2,7 @@
 
 final class ChargeBee_Version
 {
-	  const VERSION = '2.0.5';
+	  const VERSION = '2.2.2';
 }
 
 ?>

+ 24 - 0
plugins/chargebee/LICENSE

@@ -0,0 +1,24 @@
+The MIT License
+
+Copyright (c) 2011-2016 ChargeBee, Inc.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.