GoCardless not working

Discussion in 'Payments processing' started by bennyuk1, Nov 23, 2017.

  1. bennyuk1

    bennyuk1 aMember Pro Customer

    Joined:
    Jan 12, 2012
    Messages:
    175
    I'm trying to get gocardless payment plugin to work .After contacting gocardless they have responded with:-

    > It looks like the amember plugin is using the legacy version of our API which was deprecated on 31st October 2017.

    > I'd recommend getting in touch with amember to clarify if they have a plugin which uses our new API.

    Can you let me know if amember uses new API or when you intend to updgrade it?

    Thanks
    Ben
  2. robw

    robw CGI-Central Partner

    Joined:
    Dec 18, 2007
    Messages:
    269
    Hi Ben,

    aMember always supported both versions of the API in two separate plugins ("gocardless" and "gocardlesspro").

    GoCardless decided to consolidate everything onto their pro-API and deprecate their standard one, and as you've noticed, they switched off the standard ('legacy') API at the end of October 2017.

    You should therefore use the gocardlesspro plugin. The latest version is v1.0.7, which you can find here:
    http://bt.amember.com/issues/1753

    NB: SEE UPDATE POST BELOW

    Now, if you are switching from the standard API, you need to know that the two plugins grew up side by side as SEPARATE PAYMENT SYSTEMS - they store data differently and are not directly compatible.

    You can't therefore just activate the "gocardlesspro" plugin and expect it to work with invoices created using the "gocardless" plugin.

    Now, it should be possible to migrate existing invoices to use the new API by changing some data in your database. I did it for one of my sites about 6 months ago, but from memory, you should only need to do the following:

    1) Change all instances of the key 'gocardless_id' with 'subscription_id' in the am_data table.

    NB: BACKUP your database before running any query that makes wholesale changes

    e.g.
    Code:
    UPDATE `am_data` SET `key` = 'subscription_id' WHERE `table` =  'invoice' AND `key` = 'gocardless_id'
    2) Change all instances of the gocardless paysys_id to gocardlesspro

    NB: BACKUP your database before running any query that makes wholesale changes

    e.g.
    Code:
    UPDATE `am_invoice` SET `paysys_id` = 'gocardlesspro' WHERE `paysys_id` = 'gocardless';
    UPDATE `am_invoice_log` SET `paysys_id` = 'gocardlesspro' WHERE `paysys_id` = 'gocardless';
    UPDATE `am_invoice_payment` SET `paysys_id` = 'gocardlesspro' WHERE `paysys_id` = 'gocardless';
    UPDATE `am_invoice_refund` SET `paysys_id` = 'gocardlesspro' WHERE `paysys_id` = 'gocardless';
    Did I mention you should BACKUP your database before running any query that makes wholesale changes? :)

    I'm pretty sure that was all I had to do...

    Cheers
    Rob

    Ps - If you find some inconsistencies in any of the converted invoices - e.g. renewals that don't match up to aMember dates - then the solution is to CANCEL the old subscription in GoCardless and have customer set it up afresh using the new plugin.

    In the site of 600 GoCardless users that I converted from legacy to pro API, I think there were only a handful of subscriptions that had to be cancelled and reset...
    Last edited: Nov 23, 2017
  3. robw

    robw CGI-Central Partner

    Joined:
    Dec 18, 2007
    Messages:
    269
    UPDATE: I've just checked the version in aMember core download, and it looks like they rolled my v1.0.7 bugfixes into the existing v1.0.6, as well as adding some enhancements.

    The upshot is, use the v1.0.6 version supplied in latest version of aMember.

    With this version, you shouldn't need to change all the instances of the key 'gocardless_id' with 'subscription_id' in the am_data table... (though it won't hurt if you did).

    BUT you may still need to update all the invoice paysys_ids as above so that aMember doesn't complain about the invoices being created by another plugin.

    Cheers
    Rob

Share This Page