Error Implementing GoCardless Payment Gateway

Hello, I am running an on-prem version-14 erpnext manual install. I am trying to implement the GoCardless Payment gateway. I followed the documentation here: Setting up GoCardless.

The main error I’m seeing is this:
pymysql.err.OperationalError: (1054, “Unknown column ‘header_img’ in ‘field list’”)

For troubleshooting, I uninstalled the payment apps from my site and removed the app from bench (bench uninstall-app, bench remove-app). Then reinstalled with bench get-app and bench install-app, followed by bench clear-cache, bench migrate, and bench restart. Here are my current installed app versions:
erpnext 14.3.1
frappe 14.12.0
hrms 1.0.0
payments 0.0.1

I configured my GoCardless settings first in ERPNext Integrations > GoCardless Settings to create my Gateway (with webhooks secret), which also created my Payment Gateway Document, Payment Gateway Account Document, and Account Head in the Chart of Accounts. My GoCardless (non-sandbox) account is functional and the webhooks are showing green- so they are able to connect to the webhook endpoint: https://redacted-site-name/api/method/erpnext.erpnext_integrations.doctype.gocardless_settings.webhooks. Everything seems to be there, but I am still seeing this error. I am testing by creating a Payment Request from a Sales Invoice and sending it with the payment link, then clicking on the link: <a href="{{ payment_url }}"> click here to pay </a>

There is more detail in the error log, the error is called “/integrations/gocardless_checkout failed”
File “apps/frappe/frappe/website/serve.py”, line 18, in get_response

File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 725, in _read_packet
packet.raise_for_error()
self = <pymysql.connections.Connection object at 0x7f86e569a560>
packet_type = <class ‘pymysql.protocol.MysqlPacket’>
buff = bytearray(b"\xff\x1e\x04#42S22Unknown column 'header_img' in 'field list'“)
packet_header = b’4\x00\x00\x01’
btrl = 52
btrh = 0
packet_number = 1
bytes_to_read = 52
recv_data = b”\xff\x1e\x04#42S22Unknown column ‘header_img’ in ‘field list’"
packet = <pymysql.protocol.MysqlPacket object at 0x7f86e5618a90>
File “env/lib/python3.10/site-packages/pymysql/protocol.py”, line 221, in raise_for_error
err.raise_mysql_exception(self._data)
self = <pymysql.protocol.MysqlPacket object at 0x7f86e5618a90>
errno = 1054
File “env/lib/python3.10/site-packages/pymysql/err.py”, line 143, in raise_mysql_exception
raise errorclass(errno, errval)
data = b"\xff\x1e\x04#42S22Unknown column ‘header_img’ in ‘field list’"
errno = 1054
errval = “Unknown column ‘header_img’ in ‘field list’”
errorclass = <class ‘pymysql.err.OperationalError’>
pymysql.err.OperationalError: (1054, “Unknown column ‘header_img’ in ‘field list’”)

Any help appreciated, I’m trying to stay as close to possible to the most simple way to implement this. Maybe I missed something?

Any updates on this issue?
because it’s still not working, also not with V15.10.7

this makes GoCardless totally broken

br
Andres

Hey Andreas, I don’t think there has been any change. I get a similar error in my test instance of v15.10.7. Can you post your traceback? I’d like to see if it’s similar.

I’ve created a PR that fixes this:

1 Like

Hi,

As I see, there is no real movement on GitHub…
Is there manual workaround to fix this locally?

br
Andreas

The last commit to the repository was just over 2.5 months ago. How to raise the attention of one of the maintainers?

As for a local workaround, you could try adding the field by customizing the GoCardless settings form, adding the header_img field following the example from the Braintree settings form (which has this field already). I think that would work, though I have not tried it. One concern would be, if the custom field is there, then it is added later to the .json file, would a conflict arise?

Hi,
I am now using your dev branch and it’s working without issues so far.

Thank you very much!

You’re welcome. Looking back at this issue, I think maybe my PR isn’t getting the attention it needs because I didn’t follow the proper naming conventions, i.e. “fix: missing header_img field in GoCardless Settings” or something like that. Although there are a few PRs that are named according to those conventions that are older and languishing. If anyone has any suggestions on how to get a PR some attention, I’m all ears.

another question for this:

I am trying to use the webhook from gocardless to Erpnext with this URL:

https://xxx.xxx.com/api/method/erpnext.erpnext_integrations.doctype.gocardless_settings.webhooks

But I am getting this Errormessage on gocardless:

{"exception":"frappe.exceptions.ValidationError: Failed to get method for command erpnext.erpnext_integrations.doctype.gocardless_settings.webhooks. with No module named 'erpnext.erpnext_integrations.doctype.gocardless_settings.webhooks'","exc_type":"ValidationError","exc":"[\"Traceback (most recent call last):\\n  File \\\"apps/frappe/frappe/handler.py\\\", line 74, in execute_cmd\\n    method = get_attr(cmd)\\n  File \\\"apps/frappe/frappe/handler.py\\\", line 283, in get_attr\\n    method = frappe.get_attr(cmd)\\n  File \\\"apps/frappe/frappe/__init__.py\\\", line 1708, in get_attr\\n    return getattr(get_module(modulename), methodname)\\n  File \\\"apps/frappe/frappe/__init__.py\\\", line 1429, in get_module\\n    return importlib.import_module(modulename)\\n  File \\\"/usr/lib/python3.10/importlib/__init__.py\\\", line 126, in import_module\\n    return _bootstrap._gcd_import(name[level:], package, level)\\n  File \\\"<frozen importlib._bootstrap>\\\", line 1050, in _gcd_import\\ TRUNCATED

any ideas?

br
Andreas

This looks like a different error altogether. You’ll probably get more help with a new topic.