From 18a5545f6c6b7b5b6801dfa3fb10e64ccce1070d Mon Sep 17 00:00:00 2001 From: alishsapkota Date: Thu, 19 Sep 2024 07:55:25 +0000 Subject: [PATCH] Releasing v3.34.0. Please check the changelog for the updates. --- CHANGELOG.md | 45 +++++++++++++++++++ lib/ChargeBee/Models/Installment.php | 40 ----------------- lib/ChargeBee/Models/Invoice.php | 9 +++- lib/ChargeBee/Models/Item.php | 2 + .../Models/ItemBundleConfiguration.php | 15 +++++++ lib/ChargeBee/Models/ItemBundleItem.php | 18 ++++++++ ...tallmentDetail.php => PaymentSchedule.php} | 12 +++-- ...t.php => PaymentScheduleScheduleEntry.php} | 6 +-- ...ntConfig.php => PaymentScheduleScheme.php} | 13 +++--- ...aymentScheduleSchemePreferredSchedule.php} | 2 +- lib/ChargeBee/Result.php | 45 ++++++++++--------- lib/ChargeBee/Version.php | 2 +- lib/init.php | 11 ++--- 13 files changed, 136 insertions(+), 84 deletions(-) delete mode 100644 lib/ChargeBee/Models/Installment.php create mode 100644 lib/ChargeBee/Models/ItemBundleConfiguration.php create mode 100644 lib/ChargeBee/Models/ItemBundleItem.php rename lib/ChargeBee/Models/{InstallmentDetail.php => PaymentSchedule.php} (56%) rename lib/ChargeBee/Models/{InstallmentDetailInstallment.php => PaymentScheduleScheduleEntry.php} (57%) rename lib/ChargeBee/Models/{InstallmentConfig.php => PaymentScheduleScheme.php} (55%) rename lib/ChargeBee/Models/{InstallmentConfigInstallment.php => PaymentScheduleSchemePreferredSchedule.php} (72%) diff --git a/CHANGELOG.md b/CHANGELOG.md index e574e5f5..60268047 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,48 @@ +### v3.34.0 (2024-09-19) +* * * + +#### New Resource: +* PaymentScheduleScheme has been added. +* PaymentSchedule has been added. + +### New Endpoints: +* Invoice#ApplyPaymentScheduleScheme has been added. +* Invoice#PaymentSchedules has been added. + +### New Attributes +* bundle_items[] has been added to Items. +* bundle_configuration has been added to Items. + +#### New Input parameters: +* bundle_configuration has been added to Items#CreateParams, Items#UpdateParams & Items#ListParams. +* bundle_items_to_add[] has been added to Items#CreateParams & Items#UpdateParams. +* bundle_items_to_update[] has been added to Items#UpdateParams. +* bundle_items_to_remove[] has been added to Items#UpdateParams. +* payment_schedule has been added to Purchase#CreateParams. + +### New Enum Values: +* payment_schedules_created has been added to EventTypeEnum. +* payment_schedules_updated has been added to EventTypeEnum. +* payment_schedule_scheme_created has been added to EventTypeEnum. +* payment_schedule_scheme_deleted has been added to EventTypeEnum. + +### Removed Resource: +* Installment has been removed. +* InstallmentConfig has been removed. +* InstallmentDetail has been removed. + +### Removed Endpoints: +* Invoice#Installments has been removed. + +### Removed Input parameters: +* installment_info has been removed from Purchase#CreateParams. + +### Removed Enum Values: +* invoice_installments_created has been removed from EventTypeEnum. +* invoice_installment_updated has been removed from EventTypeEnum. +* installment_config_created has been removed from EventTypeEnum. +* installment_config_deleted has been removed from EventTypeEnum. + ### v3.33.0 (2024-08-29) * * * diff --git a/lib/ChargeBee/Models/Installment.php b/lib/ChargeBee/Models/Installment.php deleted file mode 100644 index 3dfedee1..00000000 --- a/lib/ChargeBee/Models/Installment.php +++ /dev/null @@ -1,40 +0,0 @@ - \ No newline at end of file diff --git a/lib/ChargeBee/Models/Invoice.php b/lib/ChargeBee/Models/Invoice.php index f3bf0708..f1774635 100644 --- a/lib/ChargeBee/Models/Invoice.php +++ b/lib/ChargeBee/Models/Invoice.php @@ -253,9 +253,14 @@ public static function updateDetails($id, $params = array(), $env = null, $heade return Request::send(Request::POST, Util::encodeURIPath("invoices",$id,"update_details"), $params, $env, $headers); } - public static function installments($id, $params, $env = null, $headers = array()) + public static function applyPaymentScheduleScheme($id, $params, $env = null, $headers = array()) { - return Request::send(Request::POST, Util::encodeURIPath("invoices",$id,"installments"), $params, $env, $headers); + return Request::send(Request::POST, Util::encodeURIPath("invoices",$id,"apply_payment_schedule_scheme"), $params, $env, $headers); + } + + public static function paymentSchedules($id, $env = null, $headers = array()) + { + return Request::send(Request::GET, Util::encodeURIPath("invoices",$id,"payment_schedules"), array(), $env, $headers); } public static function resendEinvoice($id, $env = null, $headers = array()) diff --git a/lib/ChargeBee/Models/Item.php b/lib/ChargeBee/Models/Item.php index c73bf562..6d71a5bb 100644 --- a/lib/ChargeBee/Models/Item.php +++ b/lib/ChargeBee/Models/Item.php @@ -33,6 +33,8 @@ class Item extends Model 'archivedAt', 'channel', 'applicableItems', + 'bundleItems', + 'bundleConfiguration', 'metadata', ]; diff --git a/lib/ChargeBee/Models/ItemBundleConfiguration.php b/lib/ChargeBee/Models/ItemBundleConfiguration.php new file mode 100644 index 00000000..1e886fea --- /dev/null +++ b/lib/ChargeBee/Models/ItemBundleConfiguration.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/lib/ChargeBee/Models/ItemBundleItem.php b/lib/ChargeBee/Models/ItemBundleItem.php new file mode 100644 index 00000000..3d98ba26 --- /dev/null +++ b/lib/ChargeBee/Models/ItemBundleItem.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/lib/ChargeBee/Models/InstallmentDetail.php b/lib/ChargeBee/Models/PaymentSchedule.php similarity index 56% rename from lib/ChargeBee/Models/InstallmentDetail.php rename to lib/ChargeBee/Models/PaymentSchedule.php index d5f79e75..642ae050 100644 --- a/lib/ChargeBee/Models/InstallmentDetail.php +++ b/lib/ChargeBee/Models/PaymentSchedule.php @@ -6,14 +6,20 @@ use ChargeBee\ChargeBee\Request; use ChargeBee\ChargeBee\Util; -class InstallmentDetail extends Model +class PaymentSchedule extends Model { protected $allowed = [ 'id', - 'invoiceId', + 'schemeId', + 'entityType', + 'entityId', 'amount', - 'installments', + 'createdAt', + 'resourceVersion', + 'updatedAt', + 'currencyCode', + 'scheduleEntries', ]; diff --git a/lib/ChargeBee/Models/InstallmentDetailInstallment.php b/lib/ChargeBee/Models/PaymentScheduleScheduleEntry.php similarity index 57% rename from lib/ChargeBee/Models/InstallmentDetailInstallment.php rename to lib/ChargeBee/Models/PaymentScheduleScheduleEntry.php index 85ef16f9..ca3d2e29 100644 --- a/lib/ChargeBee/Models/InstallmentDetailInstallment.php +++ b/lib/ChargeBee/Models/PaymentScheduleScheduleEntry.php @@ -4,17 +4,13 @@ use ChargeBee\ChargeBee\Model; -class InstallmentDetailInstallment extends Model +class PaymentScheduleScheduleEntry extends Model { protected $allowed = [ 'id', - 'invoiceId', 'date', 'amount', 'status', - 'createdAt', - 'resourceVersion', - 'updatedAt', ]; } diff --git a/lib/ChargeBee/Models/InstallmentConfig.php b/lib/ChargeBee/Models/PaymentScheduleScheme.php similarity index 55% rename from lib/ChargeBee/Models/InstallmentConfig.php rename to lib/ChargeBee/Models/PaymentScheduleScheme.php index 13d41499..f80bba49 100644 --- a/lib/ChargeBee/Models/InstallmentConfig.php +++ b/lib/ChargeBee/Models/PaymentScheduleScheme.php @@ -6,20 +6,19 @@ use ChargeBee\ChargeBee\Request; use ChargeBee\ChargeBee\Util; -class InstallmentConfig extends Model +class PaymentScheduleScheme extends Model { protected $allowed = [ 'id', 'description', - 'numberOfInstallments', + 'numberOfSchedules', 'periodUnit', 'period', - 'preferredDay', 'createdAt', 'resourceVersion', 'updatedAt', - 'installments', + 'preferredSchedules', ]; @@ -29,17 +28,17 @@ class InstallmentConfig extends Model public static function create($params, $env = null, $headers = array()) { - return Request::send(Request::POST, Util::encodeURIPath("installment_configs"), $params, $env, $headers); + return Request::send(Request::POST, Util::encodeURIPath("payment_schedule_schemes"), $params, $env, $headers); } public static function retrieve($id, $env = null, $headers = array()) { - return Request::send(Request::GET, Util::encodeURIPath("installment_configs",$id), array(), $env, $headers); + return Request::send(Request::GET, Util::encodeURIPath("payment_schedule_schemes",$id), array(), $env, $headers); } public static function delete($id, $env = null, $headers = array()) { - return Request::send(Request::POST, Util::encodeURIPath("installment_configs",$id,"delete"), array(), $env, $headers); + return Request::send(Request::POST, Util::encodeURIPath("payment_schedule_schemes",$id,"delete"), array(), $env, $headers); } } diff --git a/lib/ChargeBee/Models/InstallmentConfigInstallment.php b/lib/ChargeBee/Models/PaymentScheduleSchemePreferredSchedule.php similarity index 72% rename from lib/ChargeBee/Models/InstallmentConfigInstallment.php rename to lib/ChargeBee/Models/PaymentScheduleSchemePreferredSchedule.php index af54eee2..ddb6be45 100644 --- a/lib/ChargeBee/Models/InstallmentConfigInstallment.php +++ b/lib/ChargeBee/Models/PaymentScheduleSchemePreferredSchedule.php @@ -4,7 +4,7 @@ use ChargeBee\ChargeBee\Model; -class InstallmentConfigInstallment extends Model +class PaymentScheduleSchemePreferredSchedule extends Model { protected $allowed = [ 'period', diff --git a/lib/ChargeBee/Result.php b/lib/ChargeBee/Result.php index 818369e1..2081ace8 100644 --- a/lib/ChargeBee/Result.php +++ b/lib/ChargeBee/Result.php @@ -192,6 +192,15 @@ public function paymentReferenceNumber() return $payment_reference_number; } + public function paymentSchedule() + { + $payment_schedule = $this->_get('payment_schedule', Models\PaymentSchedule::class, + array( + 'schedule_entries' => Models\PaymentScheduleScheduleEntry::class + )); + return $payment_schedule; + } + public function taxWithheld() { $tax_withheld = $this->_get('tax_withheld', Models\TaxWithheld::class); @@ -534,7 +543,9 @@ public function item() { $item = $this->_get('item', Models\Item::class, array( - 'applicable_items' => Models\ItemApplicableItem::class + 'applicable_items' => Models\ItemApplicableItem::class, + 'bundle_items' => Models\ItemBundleItem::class, + 'bundle_configuration' => Models\ItemBundleConfiguration::class )); return $item; } @@ -710,28 +721,13 @@ public function ramp() return $ramp; } - public function installmentConfig() - { - $installment_config = $this->_get('installment_config', Models\InstallmentConfig::class, - array( - 'installments' => Models\InstallmentConfigInstallment::class - )); - return $installment_config; - } - - public function installment() + public function paymentScheduleScheme() { - $installment = $this->_get('installment', Models\Installment::class); - return $installment; - } - - public function installmentDetail() - { - $installment_detail = $this->_get('installment_detail', Models\InstallmentDetail::class, + $payment_schedule_scheme = $this->_get('payment_schedule_scheme', Models\PaymentScheduleScheme::class, array( - 'installments' => Models\InstallmentDetailInstallment::class + 'preferred_schedules' => Models\PaymentScheduleSchemePreferredSchedule::class )); - return $installment_detail; + return $payment_schedule_scheme; } public function pricingPageSession() @@ -795,6 +791,15 @@ public function differentialPrices() return $differential_prices; } + public function paymentSchedules() + { + $payment_schedules = $this->_getList('payment_schedules', Models\PaymentSchedule::class, + array( + 'schedule_entries' => Models\PaymentScheduleScheduleEntry::class + )); + return $payment_schedules; + } + public function creditNotes() { $credit_notes = $this->_getList('credit_notes', Models\CreditNote::class, diff --git a/lib/ChargeBee/Version.php b/lib/ChargeBee/Version.php index da54e442..ca9ecaa7 100644 --- a/lib/ChargeBee/Version.php +++ b/lib/ChargeBee/Version.php @@ -4,7 +4,7 @@ final class Version { - const VERSION = '3.33.0'; + const VERSION = '3.34.0'; } ?> diff --git a/lib/init.php b/lib/init.php index 846c80e7..f60fd6fa 100644 --- a/lib/init.php +++ b/lib/init.php @@ -104,11 +104,6 @@ require(dirname(__FILE__) . '/ChargeBee/Models/ImpactedSubscription.php'); require(dirname(__FILE__) . '/ChargeBee/Models/ImpactedSubscriptionDownload.php'); require(dirname(__FILE__) . '/ChargeBee/Models/InAppSubscription.php'); -require(dirname(__FILE__) . '/ChargeBee/Models/Installment.php'); -require(dirname(__FILE__) . '/ChargeBee/Models/InstallmentConfig.php'); -require(dirname(__FILE__) . '/ChargeBee/Models/InstallmentConfigInstallment.php'); -require(dirname(__FILE__) . '/ChargeBee/Models/InstallmentDetail.php'); -require(dirname(__FILE__) . '/ChargeBee/Models/InstallmentDetailInstallment.php'); require(dirname(__FILE__) . '/ChargeBee/Models/Invoice.php'); require(dirname(__FILE__) . '/ChargeBee/Models/InvoiceAdjustmentCreditNote.php'); require(dirname(__FILE__) . '/ChargeBee/Models/InvoiceAppliedCredit.php'); @@ -138,6 +133,8 @@ require(dirname(__FILE__) . '/ChargeBee/Models/InvoiceTaxOrigin.php'); require(dirname(__FILE__) . '/ChargeBee/Models/Item.php'); require(dirname(__FILE__) . '/ChargeBee/Models/ItemApplicableItem.php'); +require(dirname(__FILE__) . '/ChargeBee/Models/ItemBundleConfiguration.php'); +require(dirname(__FILE__) . '/ChargeBee/Models/ItemBundleItem.php'); require(dirname(__FILE__) . '/ChargeBee/Models/ItemEntitlement.php'); require(dirname(__FILE__) . '/ChargeBee/Models/ItemFamily.php'); require(dirname(__FILE__) . '/ChargeBee/Models/ItemPrice.php'); @@ -158,6 +155,10 @@ require(dirname(__FILE__) . '/ChargeBee/Models/PaymentIntent.php'); require(dirname(__FILE__) . '/ChargeBee/Models/PaymentIntentPaymentAttempt.php'); require(dirname(__FILE__) . '/ChargeBee/Models/PaymentReferenceNumber.php'); +require(dirname(__FILE__) . '/ChargeBee/Models/PaymentSchedule.php'); +require(dirname(__FILE__) . '/ChargeBee/Models/PaymentScheduleScheduleEntry.php'); +require(dirname(__FILE__) . '/ChargeBee/Models/PaymentScheduleScheme.php'); +require(dirname(__FILE__) . '/ChargeBee/Models/PaymentScheduleSchemePreferredSchedule.php'); require(dirname(__FILE__) . '/ChargeBee/Models/PaymentSource.php'); require(dirname(__FILE__) . '/ChargeBee/Models/PaymentSourceAmazonPayment.php'); require(dirname(__FILE__) . '/ChargeBee/Models/PaymentSourceBankAccount.php');