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
With the code as is, create() successfully runs the API call -- creating the subscription with correct add ons -- but the SDK throws an ErrorException because the 422 header is presumably "hiding" the XML. Here is the relevant tail of the stack trace:
#0 [internal function]: Illuminate\Exception\Handler->handleError(2, 'DOMDocument::lo...', '{{my project dir}}...', 200, Array) #1 {{my project dir}}/vendor/recurly/recurly-client/lib/recurly/base.php(200): DOMDocument->loadXML('HTTP/1.1 422 Un...', 256) #2 {{my project dir}}/vendor/recurly/recurly-client/lib/recurly/resource.php(65): Recurly_Base->__parseXmlToUpdateObject('HTTP/1.1 422 Un...') #3 {{my project dir}}/vendor/recurly/recurly-client/lib/recurly/subscription.php(28): Recurly_Resource->_save('POST', '/subscriptions') #4 {{my script}} (116): Recurly_Subscription->create()
When I comment out the subscription_add_ons assignment, the script processes correctly but without the add ons (obviously).
This seems like an API response issue since it actually handles my request appropriately. Any idea what's happening here?
The text was updated successfully, but these errors were encountered:
@theTrip73 can you open up a support ticket for this? please reference this issue and include your site's subdomain so we can look in the logs see what the requests and responses actually look like.
So the issue here seems to be that subscription already exists for the account. I'm leaving this open until I can look and see if we're emitting the error message correctly on the PHP side.
The response from a $subscription->create() call is returning an HTTP 422 header and preventing the PHP SDK from reading the XML response.
Here is the code that triggers it:
With the code as is, create() successfully runs the API call -- creating the subscription with correct add ons -- but the SDK throws an ErrorException because the 422 header is presumably "hiding" the XML. Here is the relevant tail of the stack trace:
#0 [internal function]: Illuminate\Exception\Handler->handleError(2, 'DOMDocument::lo...', '{{my project dir}}...', 200, Array)
#1 {{my project dir}}/vendor/recurly/recurly-client/lib/recurly/base.php(200): DOMDocument->loadXML('HTTP/1.1 422 Un...', 256)
#2 {{my project dir}}/vendor/recurly/recurly-client/lib/recurly/resource.php(65): Recurly_Base->__parseXmlToUpdateObject('HTTP/1.1 422 Un...')
#3 {{my project dir}}/vendor/recurly/recurly-client/lib/recurly/subscription.php(28): Recurly_Resource->_save('POST', '/subscriptions')
#4 {{my script}} (116): Recurly_Subscription->create()
When I comment out the subscription_add_ons assignment, the script processes correctly but without the add ons (obviously).
This seems like an API response issue since it actually handles my request appropriately. Any idea what's happening here?
The text was updated successfully, but these errors were encountered: