Recurly has changed their authentication scheme to use a single API key instead of an API username & password. In addition, they've removed the environment setting, meaning that the subdomain needs to end with -test to use the sandbox environment. (as I understand it)

The patch attached includes the patch from #1280916: Add Private Key to Recurly Account Settings, because I don't have time to roll a patch against HEAD atm.

You will also need to update the recurly php library to the latest from https://github.com/recurly/recurly-client-php

Works for Me (TM)...

thanks,

Adrian

Comments

blasthaus’s picture

Had some issues applying the patch with git, i think it was just in the indent space-characters but i got it to finally work. Also just to note that the '-test' is being brought into the path of the edit link for each subscription which creates a broken link to recurly. I just did a string replace on the recurly_url function to correct that.

/**
 * Returns the base Recurly URL for the current account with an optional path
 * appended to it.
 */
function recurly_url($path = '') {
  // Generate the subdomain to use for the current account.
  $subdomain = RecurlyClient::$subdomain;
  $basedomain = str_replace('-test', '', $subdomain); 

  return url('https://' . $basedomain . '.recurly.com/' . $path);
}
sanguis’s picture

StatusFileSize
new4.58 KB

the patch failed when I ran it from inside the recurly dir, via git and via patch.
I modifyed the patch file to run from inside the modules directory and it worked fine. It should be noted that I ran the patch after I ran the patch at, http://drupal.org/node/1190686

ccoppen’s picture

This is further broken as RecurlyClient is now Recurly_Client and setAuth has become $apiKey and $privateKey.

Here's the instructions to authenticate as they stand now:
http://docs.recurly.com/client-libraries/php

require_once('lib/recurly.php');

// Required for the API
Recurly_Client::$apiKey = 'abcdef01234567890abcdef01234567890';

// Optional for Recurly.js:
Recurly_js::$privateKey = 'abcdef01234567890abcdef01234567890';
quicksketch’s picture

StatusFileSize
new9.97 KB

Thanks guys, there are quite a few other API changes that also break the current module. Here's a patch that corrects (hopefully) all of these problems.

quicksketch’s picture

Status: Needs review » Fixed

Committed to 6.x and 7.x branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.