Jump to content
twikamltd

New Gocardless module

Recommended Posts

This module is designed for the new style Gocardless accounts/API only, where you create read/write tokens and configure multiple webhooks.

 

There's no test mode as DD's aren't instant so might as well test with live details.

 

It uses the new API, so if you've had your GC account upgraded, then you'll need to create new tokens and webhooks.

 

It can handle multiple events per callback as per the API spec.

 

Was initially based on a public module, but doesn't bear much resemblance to it anymore, and doesn't use any Gocardless provided PHP libraries. Comes with a dedicated page in the client area to create/view/cancel direct debits.

 

Download

 

Enjoy, any feedback/fixes appreciated.

Share this post


Link to post
Share on other sites

It should be ok, it's a copy of our live module, we've modified it a bit since posting but any problems just reply here and I'll sort it out.

Share this post


Link to post
Share on other sites

Hi,

We have tried to install this but getting the error below

 

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbnname.mod_gocardless_preauth' doesn't exist' in /home/x/public_html/vendor/illuminate/database/Connection.php:333 Stack trace: #0 /home/x/public_html/vendor/illuminate/database/Connection.php(333): PDO->prepare('select `subscri...') #1 /home/x/public_html/vendor/illuminate/database/Connection.php(706): Illuminate\Database\Connection->Illuminate\Database\{closure}(Object(Illuminate\Database\MySqlConnection), 'select `subscri...', Array) #2 /home/x/public_html/vendor/illuminate/database/Connection.php(669): Illuminate\Database\Connection->runQueryCallback('select `subscri...', Array, Object(Closure)) #3 /home/x/public_html/vendor/illuminate/database/Connection.php(342): Illuminate\Database\Connection->run('select `subscri...', Array, Object(Closure)) #4 /home/x/public_html/vendor/illuminate/database/Query/Builder.php(1583): Illuminate\Database\Connection->select('select `subscri in /home/x/public_html/vendor/whmcs/whmcs-foundation/lib/Terminus.php on line 0

Share this post


Link to post
Share on other sites
Hi,

We have tried to install this but getting the error below

 

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbnname.mod_gocardless_preauth' doesn't exist' in /home/x/public_html/vendor/illuminate/database/Connection.php:333 Stack trace: #0 /home/x/public_html/vendor/illuminate/database/Connection.php(333): PDO->prepare('select `subscri...') #1 /home/x/public_html/vendor/illuminate/database/Connection.php(706): Illuminate\Database\Connection->Illuminate\Database\{closure}(Object(Illuminate\Database\MySqlConnection), 'select `subscri...', Array) #2 /home/x/public_html/vendor/illuminate/database/Connection.php(669): Illuminate\Database\Connection->runQueryCallback('select `subscri...', Array, Object(Closure)) #3 /home/x/public_html/vendor/illuminate/database/Connection.php(342): Illuminate\Database\Connection->run('select `subscri...', Array, Object(Closure)) #4 /home/x/public_html/vendor/illuminate/database/Query/Builder.php(1583): Illuminate\Database\Connection->select('select `subscri in /home/x/public_html/vendor/whmcs/whmcs-foundation/lib/Terminus.php on line 0

 

It is ok - I solved it by creating the table mod_gocardless_preaut manually.

Share this post


Link to post
Share on other sites

Thanks for the module - it seems to work well - we have noticed though that when a client tries to cancel the direct debit mandate it does not actually cancel it? does it take a while for it to be cancelled? or should it be instant?

Share this post


Link to post
Share on other sites

It cancels it immediately at Gocardless, but it's the Gocardless webhook which tells WHMCS to delete it from the database, not the action of clicking the button.

Share this post


Link to post
Share on other sites
It cancels it immediately at Gocardless, but it's the Gocardless webhook which tells WHMCS to delete it from the database, not the action of clicking the button.

 

thanks- the webhook in gogardelss is showing a 400 bad request?

 

Below is the request and response:

User-Agentgocardless-webhook-service/1.1

Content-Typeapplication/json

Webhook-Signature0ac632ee73fbb0d54b3a996341519cac961f27e180224e13f30ea76e5701800a

Body

{

"events": [

{

"id": "EV0038K9JH5CM0",

"created_at": "2017-02-03T16:01:44.892Z",

"resource_type": "mandates",

"action": "submitted",

"links": {

"mandate": "MD0003ZEA8BR6T"

},

"details": {

"origin": "gocardless",

"cause": "mandate_submitted",

"description": "The mandate has been submitted to the banks."

},

"metadata": {}

 

Resonse:

 

dateFri, 03 Feb 2017 16:37:49 GMT

pragmano-cache

serverApache

expiresThu, 19 Nov 1981 08:52:00 GMT

connectionclose

set-cookieWHMCSSJwMo4T3Yydq=361ndthcmrt08m68sejupuhfq6; path=/; secure; HttpOnly

content-typetext/html; charset=utf-8

cache-controlno-store, no-cache, must-revalidate, post-check=0, pre-check=0

content-length26

Body

77: Unknown mandate action

Share this post


Link to post
Share on other sites

sorry - you are correct,however the DD is not cancelled when you press cancel DD and no webhook logs are created on gocardless for the cancellation

 

is there anyway we can debug?

Share this post


Link to post
Share on other sites

in the whmcs gateway logs we are getting this error when we can to cancel a mandate:

 

Could not determine given resource type. callback.php 187

Share this post


Link to post
Share on other sites

Not sure if anyone can help, I have client who has a direct debit setup but some reason no payment is being taken when the invoice is due. Is the GoCardless module supposed to take payment once an invoice is issued or am I missing something?

 

Thanks,

Alex

Share this post


Link to post
Share on other sites

Hi we've been using the old original version of the GoCardless module (although we may have upgraded to one of the forks along the way at some stage to fix some errors) but it's worked great. UNTIL! moving from PHP5.6 to PHP7 and mysql 5.7 on a new server.

 

Now when we create an invoice and a client logs in and pays it - WHMCS doesn't mark it as paid. The payment is there in GoCardless dashboard though... Can anyone help suggest how to fix this - or does anyone know how to migrate our current GoCardless module over to this newer Github version by YHUK?

 

Thanks for any help :)

Share this post


Link to post
Share on other sites
Hi we've been using the old original version of the GoCardless module (although we may have upgraded to one of the forks along the way at some stage to fix some errors) but it's worked great. UNTIL! moving from PHP5.6 to PHP7 and mysql 5.7 on a new server.

 

Now when we create an invoice and a client logs in and pays it - WHMCS doesn't mark it as paid. The payment is there in GoCardless dashboard though... Can anyone help suggest how to fix this - or does anyone know how to migrate our current GoCardless module over to this newer Github version by YHUK?

 

Thanks for any help :)

 

ok further to this I've removed the older module and installed the new module. However I can't seem to get it working with the sandbox credentials entered. On the payment screen for a new test email it says a direct debit is already in place which is great, so they I click Pay and it says it is successful and will show as paid once cleared.

 

But then when logging into the sandbox there are no payments there showing...

 

Thanks again for any help with this.

Share this post


Link to post
Share on other sites
Hi we've been using the old original version of the GoCardless module (although we may have upgraded to one of the forks along the way at some stage to fix some errors) but it's worked great. UNTIL! moving from PHP5.6 to PHP7 and mysql 5.7 on a new server.

 

Now when we create an invoice and a client logs in and pays it - WHMCS doesn't mark it as paid. The payment is there in GoCardless dashboard though... Can anyone help suggest how to fix this - or does anyone know how to migrate our current GoCardless module over to this newer Github version by YHUK?

 

Thanks for any help :)

 

Hi further to this I've now given up on the old module with php7 and deleted it and installed this new version which looks great. I've set up a sandbox for the new api and put the details in the module settings.

 

However when I make a payment on a test invoice the module gives the confirmation:

Your direct debit has been charged, this invoice status will update when the payment has cleared.

 

But then when I log back into the sandbox no payments are there? If anyone could please help me to fix this...

Share this post


Link to post
Share on other sites

i still use the ' GoCardless for WHMCS v1.1.0.' and this works fine in WHMCS version 7.1.2 marks invoices as paid as it should do.

Share this post


Link to post
Share on other sites

Hi thanks for the reply. We've since now moved on to the new GoCardless API instead and done some work to update the newer module originally posted at the top of this thread so it works with php7 and some of our old subscriptions etc.

 

So we've ended up with a further updated new and improved module, PM me if anybody needs any revised code.

Share this post


Link to post
Share on other sites

Hi soydemadrid,

 

Would you be able provide a link to your updated code please? For some reason my profile won't let me PM.

 

We are currently using the https://github.com/impelling/gocardless-whmcs version of the module which is a fork of the original.

 

The database schema of this new module looks a little different.

 

Did you have to change much to get your existing authorisations working with the new module?

Share this post


Link to post
Share on other sites

Hi soydemadrid,

 

Just tried to send you a PM but it say you've exceeded your stored private messages quota.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines