I have set up a woo commerce site and integrated to ERP next as per https://docs.erpnext.com/docs/user/manual/en/erpnext_integration/woocommerce_integration
I can not get it success.
problem is I have multi tenant via port.
but endpoint shows something like below.
http://server ip/api/method/erpnext.erpnext_integrations.connectors.woocommerce_connection.order
but my site is like
http://server ip:port
is that a reason to not to connect?
Hi, Any one like to help me. My current freelancers are does not know much about this.
All treads pointed to “check the log” slogan.
I know this is miss match for data fields
But I do nor know how to find those mismatches.
Any one like to help me on this and I am willing to pay.
Which version of erpnext you are currently on.
item_group.insert()
def validate_settings(self):
if self.enable_sync:
if not self.secret:
self.set("secret", frappe.generate_hash())
if not self.woocommerce_server_url:
frappe.throw(_("Please enter Woocommerce Server URL"))
if not self.api_consumer_key:
frappe.throw(_("Please enter API Consumer Key"))
if not self.api_consumer_secret:
frappe.throw(_("Please enter API Consumer Secret"))
def create_webhook_url(self):
endpoint = "/api/method/erpnext.erpnext_integrations.connectors.woocommerce_connection.order"
try:
url = frappe.request.url
Try chaning this
url = frappe.request.url
to:
url = frappe.request.scheme + '://' + frappe.request.host
If it works send a PR to erpnext branches.
I am using and tried with V12
@Sanath_Udayawansa2
In your bench that received the webhook, can you run the following and check the output:
grep -H webhook_error logs/*
This will simply go through all your bench’s log files and find the error from the webhook. That might be able to give you a reason why the request failed with a 500.
If that doesn’t return anything, then you might want to look at the last few updated error logs manually.
Search for “WooCommerce Error”
if (
frappe.request.data
and not sig == frappe.get_request_header("X-Wc-Webhook-Signature", "").encode()
):
frappe.throw(_("Unverified Webhook Data"))
frappe.set_user(woocommerce_settings.creation_user)
@frappe.whitelist(allow_guest=True)
def order(*args, **kwargs):
try:
_order(*args, **kwargs)
except Exception:
error_message = (
frappe.get_traceback() + "\n\n Request Data: \n" + json.loads(frappe.request.data).__str__()
)
frappe.log_error("WooCommerce Error", error_message)
raise
Would you tell me exact cmd
grep -H "WooCommerce Error" logs/*
I can’t help you in with woocommerce. I don’t have woocommerce or wordpress.
Ok that is bad luck for me.
Any one would like to help me on this please…