- Uses public key instead of transparent post.
- Call recurly.configure($publickey) instead of passing a whole mess of options.
- Good! But leaves me figuring out what to do with those options.
- Some can be discarded.
- Unneeded options, settings
- everything was json-encoded and sent to recurly, not needed
- can discard a lot of code used to clean up field names and change them
- ~150 lines of code less in the module file now
- super simple, need the
data-recurly
attribute.
<form>
<input type="text" data-recurly="routing_number">
<input type="text" data-recurly="account_number">
<input type="text" data-recurly="account_number_confirmation">
<input type="text" data-recurly="account_type">
<input type="text" data-recurly="name_on_account">
<input type="hidden" name="recurly-token" data-recurly="token">
<button>submit</button>
</form>
- how v3 authenticates
- the form submit is interrupted to get a token.
- get the token, continue with the submit.
recurly.token(this, function (err, token) {
// send any errors to the error function below
if (err) error(err);
// Otherwise we continue with the form submission
else form.submit();
});
- the existing module is pretty complex. Recurlyjs v3 is pretty simple.
- Working between drupal forms & recurlyjs forms, wrestling the form API
- figuring out what isn't needed anymore
- figuring out why the old code was needed without the old API (most of the links are broken). This is one of the biggest ones for me.
-
I had to think of the whole project in layers/steps -
- make array of fields/values
- display user facing form in tpls
- put user values into the array
- format the needed values for the drupal subscription & account objects, save
- format the values for recurly, create a billingInfo object, submit.
-
Figure out which of these steps and which fields are needed for:
- new subscribers
- updating billing information for existing subscribers
-
Use form callbacks to process fields.
-
Some functions in the recurlyjs module are using the php functions - decide which of these are necessary, or should all calls use recurlyjs in this module? what's faster/more efficient?
- Re-do billing info update form
- styling
- test ALL the things!