Skip to content

Commit dc1e9be

Browse files
committed
fix: do not serialize recurly_stub objects in body payload
Including the string representation of the fetched stub object is not proper to send to the API as it is an improper value for that tag.
1 parent a969a1f commit dc1e9be

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Tests/Recurly/Subscription_Test.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ public function testUpdateShippingAddressXml() {
279279
<quantity>1</quantity>
280280
</subscription_add_on>
281281
<subscription_add_on>
282-
<item>&lt;Recurly_Stub[item] href=https://api.recurlyqa.com/v2/items/mockitem&gt;</item>
283282
<external_sku>tester-sku</external_sku>
284283
<add_on_code>mockitem</add_on_code>
285284
<unit_amount_in_cents>199</unit_amount_in_cents>
@@ -476,7 +475,6 @@ public function testUpdateSubscriptionWithAddOns() {
476475
<quantity>1</quantity>
477476
</subscription_add_on>
478477
<subscription_add_on>
479-
<item>&lt;Recurly_Stub[item] href=https://api.recurlyqa.com/v2/items/mockitem&gt;</item>
480478
<external_sku>tester-sku</external_sku>
481479
<add_on_code>mockitem</add_on_code>
482480
<unit_amount_in_cents>199</unit_amount_in_cents>

lib/recurly/traits/xml_doc.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ public function populateXmlDoc(&$doc, &$node, &$obj, $nested = false)
178178
// doesn't extend Recurly_Resource we should add an interface for this.
179179
if ($val instanceof Recurly_CurrencyList || $val instanceof Recurly_CustomFieldList) {
180180
$val->populateXmlDoc($doc, $node);
181+
} else if ($val instanceof Recurly_Stub) {
182+
continue;
181183
} else if ($val instanceof Recurly_Resource) {
182184
$attribute_node = $node->appendChild($doc->createElement($key));
183185
$this->populateXmlDoc($doc, $attribute_node, $val, true);

0 commit comments

Comments
 (0)