Jump to content

GoCardless Module Directory Filename and Migration


aquiss

Recommended Posts

Just been thinking about the directory name for the gocardless module name that WHMCS will be using.

There is a 2-3 commercial modules that provide GoCardless support, in all cases they use the directoryname of "gocardless", which of course will cause a conflict with files. This is because most of them are based on the old GoCardless module from WHMCS v5 days and thus the naming structure as never changed.

Is the WHMCS core module going to be using the same directory name? If so, I would recommend the new core module to use say "whmcsgocardless" so that anyone using a commercial module can at least have the two running alongside each other and thus allow for a migration of payment gateways to take place.

Link to comment
Share on other sites

  • WHMCS Support Manager

Hi @aquiss,

Thanks for your taking the time to raise this interesting point.

Applying the 7.7 update to an installation using a legacy or after-market module called "gocardless" would result in the files being overwritten. An installation using the old legacy module (if it still even works!) would be upgraded and need to re-configure the payment gateway to use the new implementation. Modules developed by us are canonical.

It should be possible to restore your custom gocardless.php module file to continue using it after performing the update. However longer term you should look to rename your custom or 3rd party module so it does not share the same name as the official one we ship.

When we introduced an official Stripe js module, we included a migration path from after-market modules due to high usage. GoCardless is not in the same boat, so don't intend to do the same.

I'll raise this with the documentation team so we can look at potentially adding a note to the documentation about legacy or after-market modules.

 

Link to comment
Share on other sites

@WHMCS John

Thanks for the reply

Do you know what fields your module uses for your new module to work? I'm purely thinking if dropping your new module in will just be a plug/play type situation (because I would prefer to work our business towards using an included core module).

The current commercial one we have been using for years (and still working to this day) uses the following tables/fields to obtain it's data.

tblclients -> gatewayid (we populate that with the word gocardless).
mod_gocardless_preauth (which includes the userid (id from tblclients) and subscriptionid (GoCardless mandate reference).

 

As I say there is few of us (and I've chatted to a few here over private messages) who having been using gocardless and whmcs together for years. Many are using modules based on a patched version that was on GitHub that you guys used to distribute with WHMCS v5 and was made to work with newer versions on WHMCS. Whilst I understand this is no Stripe situation, I guess i'm speaking up in advance and getting it out there for possible conflicts with this new module.

Link to comment
Share on other sites

  • WHMCS Support Manager

Hi @aquiss,

In our implementation the Mandate ID is stored in the tblclients.gatewayid field. Then the payment method of the invoice of gocardless is all that's needed.

So it sounds like if you were to migrate the mod_gocardless_preauth.subscriptionid value into the tblclients.gatewayid field, it might do the trick.

The configuration of the webhook and oauth secrets is automated in our module, so it wouldn't be possible to use an existing webhook from a previous integration. So I'd suggest trying the following migration:

  1. Migrate the mod_gocardless_preauth.subscriptionid values into the tblclients.gatewayid field
  2. Activate an unused payment gateway temporarily (could be anything, preferably one you've never used before)
  3. Disable the GoCardless module
  4. Choose to migrate clients to the temporary gateway from step 2
  5. Activate the new GoCardless module and complete the auto-setup routine
  6. Disable the temporary gateway from step 2
  7. Choose to migrate clients to GoCardless.

In theory this should do the trick.

I would be valuable to have your feedback on how the migration went, so please do try the 7.7 before release and share your experience here.

If you need a development licence to test with, please let me know and I can issue one to your account.

 

 

Link to comment
Share on other sites

John

We have customised / redeveloped the old legacy gocardless module so it worked on whmcs 7 and also set it so only one DD mandate works for all invoice, our module now also checks every hour for transaction fees (which apply when money is received by gocardless) it turn updates whmcs invoice with the transaction fee. 

 

Does 7.7 native version set a spend limit in gocardless? 

If so can this be removed or configured by admin?

 

does it allow one gocardless agreement for all of the clients invoices to charge to GC? 

 

I think we should be able to change to the 7.7 navite module, if I give you my code could you add transaction fee support to whmcs native version? 

Edited by cyberhostpro
Link to comment
Share on other sites

  • WHMCS Support Manager

Hi @cyberhostpro,

Thanks for helping with 7.7 pre-release testing.

Our code doesn't make a reference to a spend limit variable, so we are not explicitly setting a variable.

I also checked the GoCardless developer reference, and couldn't locate mention of it there either, so not sure it can be set by remote systems. Is there a particular setting you're interested in?

 

One mandate for a client would be used to charge as many of their invoices as you like - based upon the payment method of the service and invoice.

 

 

Link to comment
Share on other sites

I produced the original patch that introduced the mod_gocardless_preauth table and also included some hooks to automate the payment collection ahead of the due date and supress invoice messages for payments underway.

Reading through the thread I am concerned that support in 7.7 utilises the ' gatewayid' value in tblClients. By doing this you only allow a single payment method for a user's account. Frequently we find clients will pay the first invoice with a credit/debit card then switch to Direct Debit. This happens when they purchase additional new services so they are activated immediately. Using our implementation with the mod_gocardless_preauth table we can dual run a Credit/Debit Card and Direct Debit per account.

I appreciate I am late to contribute to the thread but can you seriously reconsider using 'mod_gocardless_preauth' to store the preauth value from Gocardless? Even if you change the structure, at least persist it in a field other than 'gatewayid'.

Link to comment
Share on other sites

  • WHMCS Support Manager

Hi @yorkukhosting,

Thanks for joining in the pre-release discussion.

At present WHMCS supports a total of one stored set of payment details per client. However we are planning to introduce support for multiple credit cards (and potentially other tokens) later this year: https://requests.whmcs.com/topic/multiple-credit-card-support_1

 

Link to comment
Share on other sites

@yorkukhosting

We use your module. Do you think you can release a version of your module, with a different folder name, so that it does not conflict with the one WHMCS are going to release? As confirmed earlier in this thread, anyone upgrading to 7.7 will find your files will be overridden.

I can see fallout from all this if we are not careful.

Link to comment
Share on other sites

  • WHMCS John changed the title to GoCardless Module Directory Filename and Migration
  • WHMCS ChrisD locked this topic
  • WHMCS John unlocked this topic
  • 1 month later...

John


We have upgraded from 7.6 to 7.7 today and now direct debits fail

 

This is the process I took after upgrading:

1) went to gateways page and clicked log in to gocardless to sync settings

2) opened a invoice (due tomorrow) and clicked pay now and it fails with:

Invoice ID => 157097
User ID => REMOVED
Amount => 1636.46
No mandate setup

 

Another client then setup a fresh new direct debit, when I go to the users profile the gateway ID begins MD000  previously we stored to CU (customer number) which you can see on the code i sent you for my custom module that collects transaction fee's.

I need to create a migration from OLD gateway ID to new gateway ID.

 

todays new DD signup begins MD000 and I dont know where this is coming from? when I login to Gocardless and click the new customer, the URL contains CU000 (customer number) i dont see anywhere for MD000 even when clicking through options like pending payments?

Link to comment
Share on other sites

To add to my last response I have found that your module does the following

 

1) uses the mandate ID (gocardless > customer name > bank account > mandate)

2) it adds meta data client_id to the mandate

 

what I then did  to the failing DD was:

1) edit gatewayID to their mandate ID from Gocardless website

2) add the meta data

 

however its still failing with the same error.  I did notice the mandate ID was just numbers and did not begin MD

 

Can you help us to get this working so we can migrate gateway IDs to the new preferred method?

Link to comment
Share on other sites

The MDxxxx id is stored in mod_gocardless_preauth if you are using the widely circulated version. You should be able to put an update statement together to carry over the subscriptionid to the gatewayid in the clients table. This value can be found in the gocardless.com URL via the mandate link or a customer.

I have not tested this, backup your database,  test the backup works, use entirely at your own risk. In theory this should update the gatewayid for each client that has a Direct Debit mandate using the old method. Note, if the client has a Credit/Debit card and Direct Debit this will overwrite the gatewayid of the credit card provider.

UPDATE tblclients left join mod_gocardless_preauth
ON mod_gocardless_preauth.userid = tblclients.id
SET gatewayid = mod_gocardless_preauth.subscriptionid

 

Link to comment
Share on other sites

On 1/3/2019 at 5:40 PM, WHMCS John said:

Hi @aquiss,

In our implementation the Mandate ID is stored in the tblclients.gatewayid field. Then the payment method of the invoice of gocardless is all that's needed.

So it sounds like if you were to migrate the mod_gocardless_preauth.subscriptionid value into the tblclients.gatewayid field, it might do the trick.

The configuration of the webhook and oauth secrets is automated in our module, so it wouldn't be possible to use an existing webhook from a previous integration. So I'd suggest trying the following migration:

  1. Migrate the mod_gocardless_preauth.subscriptionid values into the tblclients.gatewayid field
  2. Activate an unused payment gateway temporarily (could be anything, preferably one you've never used before)
  3. Disable the GoCardless module
  4. Choose to migrate clients to the temporary gateway from step 2
  5. Activate the new GoCardless module and complete the auto-setup routine
  6. Disable the temporary gateway from step 2
  7. Choose to migrate clients to GoCardless.

In theory this should do the trick.

I would be valuable to have your feedback on how the migration went, so please do try the 7.7 before release and share your experience here.

Hi this isn't working for me. I've completely removed the 3rd party module and deleted all its files and removed it in WHMCS payments section. I've downloaded a fresh version of whmcs and uploaded to my server the Gocardless module and files. Then before installing and activating your official module I've then also moved all the subscriptionid values from my old module table to your tblclients.gatewayid field in phpmyadmin. This took ages as I didn't want to do it in an automated way with a command and wipe out any credit card or other payment types - so I went through doing them all individually.

I then activated the new GoCardless module and completed the auto-setup routine.

Then I deactivated the temporary gateway that I used to switch all my direct debits to and clicked the option for them to now use GoCardless.

But now when I try to capture a payment or run the cron I get errors like this:

Quote

Invoice ID => 9072
User ID => 76
Amount => 12.00
No mandate setup

 

Can you please help as I now have barely no invoice payments coming in at all other than the few on other payment types. I now only use your official module so have also requested support from your WHMCS support team however I'm worried they just keep with the "We don't support 3rd parties" stance - though now I only use WHMCS and their official module hopefully they *should* help as I don't use any 3rd parties...

Link to comment
Share on other sites

As the thread starter, I thought I would update.

We personally decided to use this as a chance to move to use the commercial module from Nifty https://marketplace.whmcs.com/product/3531 which has no conflicts with other 3rd party modules or the official one now included by WHMCS. It even imports all the live mandates from GoCardless directly so you don't have to worry about finding references and manually moving them into tables.

It's given us way more features (for both clients and admin) and support have been amazing and quick with help and added a feature we requested in 3 days.

Personally, I would save yourselves the hassle and consider the Nifty module. Wished we had done it sooner.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated