You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recurly::Purchase.preview! fails with "The provided XML was invalid. 1:0: ERROR: Element 'currency': This element is not expected. (Recurly::API::BadRequest)" when I believe that I am passing in valid XML. It appears that Recurly::Purchase.preview! modifies the passed-in Recurly Subscription.
To Reproduce
Obtain a Recurly Account and a Recurly Subscription, use those objects to initialize a Recurly Purchase
Attempt to preview the purchase and receive the error
irb(main):005:0> rec_pre = Recurly::Purchase.preview!(rec_pur)
Traceback (most recent call last):
/app/vendor/bundle/ruby/2.6.0/gems/recurly-2.15.4/lib/recurly/api/net_http_adapter.rb:101:in `request': The provided XML was invalid. 1:0: ERROR: Element 'currency': This element is not expected. (Recurly::API::BadRequest)
The Recurly Subscription now indicates currency has been changed
I expected that the Recurly Subscription would be used as-is when converted to XML and passed into the Recurly API.
Extra notes
I believe the issue could be related to Recurly Purchase's overridden .to_xml which does seem to modify Subscription currency. Looks like this code was introduced with #339
Is there a higher version of the gem that addresses this issue for me?
Your Environment
Which version of this library are you using? 2.15.4
Which version of ruby are you using? 2.6.9
The text was updated successfully, but these errors were encountered:
Describe the bug
Recurly::Purchase.preview! fails with "The provided XML was invalid. 1:0: ERROR: Element 'currency': This element is not expected. (Recurly::API::BadRequest)" when I believe that I am passing in valid XML. It appears that Recurly::Purchase.preview! modifies the passed-in Recurly Subscription.
To Reproduce
Obtain a Recurly Account and a Recurly Subscription, use those objects to initialize a Recurly Purchase
Confirm that the Recurly Subscription does not indicate
currency
has changed (USD is my default currency)Attempt to preview the purchase and receive the error
The Recurly Subscription now indicates currency has been changed
Expected behavior
I expected that the Recurly Subscription would be used as-is when converted to XML and passed into the Recurly API.
Extra notes
I believe the issue could be related to Recurly Purchase's overridden .to_xml which does seem to modify Subscription currency. Looks like this code was introduced with #339
Is there a higher version of the gem that addresses this issue for me?
Your Environment
The text was updated successfully, but these errors were encountered: