tawn33y / whatsapp-cloud-api

A Node.js library for creating bots and sending/receiving messages using the Whatsapp Cloud API.
https://www.npmjs.com/package/whatsapp-cloud-api
GNU General Public License v3.0
182 stars 51 forks source link

Receive shopping cart message #56

Open irq20xdfr opened 1 year ago

irq20xdfr commented 1 year ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch whatsapp-cloud-api@0.3.1 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/whatsapp-cloud-api/dist/startExpressServer.js b/node_modules/whatsapp-cloud-api/dist/startExpressServer.js
index 23b17a1..c7ae54d 100644
--- a/node_modules/whatsapp-cloud-api/dist/startExpressServer.js
+++ b/node_modules/whatsapp-cloud-api/dist/startExpressServer.js
@@ -71,6 +71,12 @@ const startExpressServer = (options) => new Promise((resolve) => {
                     ...(rest.interactive.list_reply || rest.interactive.button_reply),
                 };
                 break;
+            case 'order':
+                event = type;
+                data = {
+                    order: rest.order,
+                };
+                break;
             default:
                 break;
         }

This issue body was partially generated by patch-package.

tawn33y commented 1 year ago

Hi @irq20xdfr 😊 Thank you for sharing this! I'll work on adding the functionality to the main package.