Skip to content

Commit

Permalink
Releasing v3.37.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 Nov 27, 2024
1 parent d4defae commit 11b3d94
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 5 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
### v3.37.0 (2024-11-27)
* * *

#### New Resource:
* OmnichannelSubscriptionItem has been added.

#### New Attribute:
* resource_version has been added to OmnichannelSubscription.
* resource_version has been added to OmnichannelTransaction.
* resource_version has been added to RecordedPurchase.

#### New Input Parameters:
* limit has been added to OmnichannelSubscription#ListRequest.
* offset has been added to OmnichannelSubscription#ListRequest.
* customer_id has been added to OmnichannelSubscription#ListRequest.
* replace_coupon_list has been added to HostedPage#CheckoutExistingRequest.
* replace_coupon_list has been added to HostedPage#CheckoutExistingForItemsRequest.
* subscription[po_number] has been added to HostedPage#CheckoutNewForItemsRequest.

#### Removed Subresource:
* OmnichannelSubscriptionItem subresource has been removed from OmnichannelSubscription and is now a standalone resource.

#### Deprecated Attribute:
* metadata has been deprecated from subscription.

### v3.36.0 (2024-11-14)
* * *

Expand Down
6 changes: 6 additions & 0 deletions lib/ChargeBee/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ public function __unset($k)

public function __get($k)
{
$childClassName = get_class($this);
if ($childClassName === "ChargeBee\ChargeBee\Models\Subscription" && $k === "metadata") {
// Trigger a deprecation notice when accessing 'metadata' for subscription.
trigger_error("The 'metadata' field is deprecated. Please use metaData", E_USER_WARNING);
return null;
}
if (isset($this->_data[$k])) {
return $this->_data[$k];
} elseif (in_array($k, $this->allowed)) {
Expand Down
1 change: 1 addition & 0 deletions lib/ChargeBee/Models/OmnichannelSubscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class OmnichannelSubscription extends Model
'source',
'customerId',
'createdAt',
'resourceVersion',
'omnichannelSubscriptionItems',
];

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

namespace ChargeBee\ChargeBee\Models;

use ChargeBee\ChargeBee\Model;
use ChargeBee\ChargeBee\Request;
use ChargeBee\ChargeBee\Util;

class OmnichannelSubscriptionItem extends Model
{

protected $allowed = [
'id',
'itemIdAtSource',
'status',
'currentTermStart',
'currentTermEnd',
'expiredAt',
'expirationReason',
'cancelledAt',
'cancellationReason',
'resourceVersion',
];



# OPERATIONS
#-----------

}

?>
1 change: 1 addition & 0 deletions lib/ChargeBee/Models/OmnichannelTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class OmnichannelTransaction extends Model
'type',
'transactedAt',
'createdAt',
'resourceVersion',
];


Expand Down
1 change: 1 addition & 0 deletions lib/ChargeBee/Models/RecordedPurchase.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class RecordedPurchase extends Model
'status',
'omnichannelTransactionId',
'createdAt',
'resourceVersion',
'linkedOmnichannelSubscriptions',
'errorDetail',
];
Expand Down
1 change: 0 additions & 1 deletion lib/ChargeBee/Models/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class Subscription extends Model
'referralInfo',
'invoiceNotes',
'metaData',
'metadata',
'deleted',
'changesScheduledAt',
'contractTerm',
Expand Down
13 changes: 11 additions & 2 deletions lib/ChargeBee/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -743,9 +743,12 @@ public function pricingPageSession()

public function omnichannelSubscription()
{
$omnichannel_subscription = $this->_get('omnichannel_subscription', Models\OmnichannelSubscription::class,
$omnichannel_subscription = $this->_get('omnichannel_subscription', Models\OmnichannelSubscription::class, array(),
array(
'omnichannel_subscription_items' => Models\OmnichannelSubscriptionItem::class
));
$omnichannel_subscription->_initDependantList($this->_response['omnichannel_subscription'], 'omnichannel_subscription_items',
array(
'omnichannel_subscription_items' => Models\OmnichannelSubscriptionOmnichannelSubscriptionItem::class
));
return $omnichannel_subscription;
}
Expand All @@ -756,6 +759,12 @@ public function omnichannelTransaction()
return $omnichannel_transaction;
}

public function omnichannelSubscriptionItem()
{
$omnichannel_subscription_item = $this->_get('omnichannel_subscription_item', Models\OmnichannelSubscriptionItem::class);
return $omnichannel_subscription_item;
}

public function recordedPurchase()
{
$recorded_purchase = $this->_get('recorded_purchase', Models\RecordedPurchase::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.36.0';
const VERSION = '3.37.0';
}

?>
2 changes: 1 addition & 1 deletion lib/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
require(dirname(__FILE__) . '/ChargeBee/Models/Metadata.php');
require(dirname(__FILE__) . '/ChargeBee/Models/NonSubscription.php');
require(dirname(__FILE__) . '/ChargeBee/Models/OmnichannelSubscription.php');
require(dirname(__FILE__) . '/ChargeBee/Models/OmnichannelSubscriptionOmnichannelSubscriptionItem.php');
require(dirname(__FILE__) . '/ChargeBee/Models/OmnichannelSubscriptionItem.php');
require(dirname(__FILE__) . '/ChargeBee/Models/OmnichannelTransaction.php');
require(dirname(__FILE__) . '/ChargeBee/Models/Order.php');
require(dirname(__FILE__) . '/ChargeBee/Models/OrderBillingAddress.php');
Expand Down

0 comments on commit 11b3d94

Please sign in to comment.