Skip to content

Commit

Permalink
Releasing v3.34.0. Please check the changelog for the updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-alish committed Sep 19, 2024
1 parent 9423e1b commit 18a5545
Show file tree
Hide file tree
Showing 13 changed files with 136 additions and 84 deletions.
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
* * *

Expand Down
40 changes: 0 additions & 40 deletions lib/ChargeBee/Models/Installment.php

This file was deleted.

9 changes: 7 additions & 2 deletions lib/ChargeBee/Models/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 2 additions & 0 deletions lib/ChargeBee/Models/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class Item extends Model
'archivedAt',
'channel',
'applicableItems',
'bundleItems',
'bundleConfiguration',
'metadata',
];

Expand Down
15 changes: 15 additions & 0 deletions lib/ChargeBee/Models/ItemBundleConfiguration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace ChargeBee\ChargeBee\Models;

use ChargeBee\ChargeBee\Model;

class ItemBundleConfiguration extends Model
{
protected $allowed = [
'type',
];

}

?>
18 changes: 18 additions & 0 deletions lib/ChargeBee/Models/ItemBundleItem.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace ChargeBee\ChargeBee\Models;

use ChargeBee\ChargeBee\Model;

class ItemBundleItem extends Model
{
protected $allowed = [
'itemId',
'itemType',
'quantity',
'priceAllocation',
];

}

?>
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];


Expand All @@ -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);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use ChargeBee\ChargeBee\Model;

class InstallmentConfigInstallment extends Model
class PaymentScheduleSchemePreferredSchedule extends Model
{
protected $allowed = [
'period',
Expand Down
45 changes: 25 additions & 20 deletions lib/ChargeBee/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/ChargeBee/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

final class Version
{
const VERSION = '3.33.0';
const VERSION = '3.34.0';
}

?>
11 changes: 6 additions & 5 deletions lib/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand All @@ -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');
Expand Down

0 comments on commit 18a5545

Please sign in to comment.