Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error, "The provided XML was invalid." when setting $subscription->starts_at #373

Closed
catcdb opened this issue Oct 10, 2018 · 5 comments
Assignees
Labels
V2 V2 Client

Comments

@catcdb
Copy link

catcdb commented Oct 10, 2018

I am getting error, "The provided XML was invalid." when setting $subscription->starts_at

The error doesn't occur when this is commented out and seems to happen regardless of how the time is formatted.

This snippit is part of a loop that creates the subscriptions array used in the Purchase object:

$subscription = new Recurly_Subscription();
$subscription->plan_code = $c['plan_code'];
$subscription->starts_at = date('c', strtotime('2018-10-31Z'));
$subscriptions[] = $subscription;

Thanks!

@aaron-junot
Copy link

@catcdb Which version of the client library are you using?

@aaron-junot aaron-junot self-assigned this Oct 10, 2018
@catcdb
Copy link
Author

catcdb commented Oct 10, 2018

Just upgraded today

  • Updating recurly/recurly-client (2.10.4 => 2.10.5): Downloading (100%)
  • Updating symfony/event-dispatcher (v2.8.45 => v2.8.46): Loading from cache

Slightly related question, I had been having trouble with first_renewal_date and next_bill_date before updating (no errors, but weren't being set on recurly). These seem to have started working since running composer update, were these issues in the SDK?

Thanks,

  • Cat

@aaron-junot
Copy link

For the initial question, the solution will require you to contact Recurly support. They need to change a configuration option for your site on the back end if you would like to create a future subscription using the Purchase object.

You can also create a subscription using the Subscription object itself by calling $subscription->create();, which does currently support future subscriptions with the starts_at parameter.

I believe that the future subscription feature will be available in v2.16 set to release at the end of the month (be sure to check the release notes when the next version is released to see what's included, sometimes things like this get pushed back).

Regarding your second question, I'm not aware of any issues with the SDK regarding first_renewal_date or next_bill_date. If you see that issue again, please open another issue and I'll investigate.

@catcdb
Copy link
Author

catcdb commented Oct 10, 2018

Thanks much, I will contact recurly and get that enabled.

I think I can get by with first_renewal_date and trial_ends_at for the time being.

@aaron-junot
Copy link

Awesome, thanks for reaching out

@bhelx bhelx added the V2 V2 Client label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V2 V2 Client
Projects
None yet
Development

No branches or pull requests

3 participants