Rhymen / go-whatsapp

WhatsApp Web API
MIT License
2.07k stars 492 forks source link

add new resource #518

Closed Romerito007 closed 3 years ago

beshoo commented 3 years ago

Is there any how to?

hrizal commented 3 years ago

just a comment, Order Message is a shopping cart message that users send. There should be additional messages that can be received, but contextInfo contains nil, maybe it should contain products in the shopping cart

beshoo commented 3 years ago

No description provided.

Dear @Romerito007 As @hrizal It will be more useful to send the order details along with the notification Here is the Messages To ask for the cart detiles 745.--26,,["query","order",{"id":"35206.44710-1","orderId":"961297227737359","imageWidth":"80","imageHeight":"80","token":"AR5zzk+vCTfMZNGd7sbYCJiLXWUMqLZaC8S+SjDABOZX1g=="}]

Response 745.--26,{"status":200,"data":{"products":[{"quantity":"1","name":"Salad Dinner","currency":"SAR","price":"22000","image":{"id":"3559607547489179","url":"https://mmg.whatsapp.net/v/t45.5328-4/p110x80/129260187_3559607550822512_8408083876833686624_n.jpg?ccb=3&_nc_sid=c48759&_nc_ohc=IY6DQJMo9BMAX-6N2b_&_nc_ad=z-m&_nc_cid=0&_nc_ht=mmg.whatsapp.net&tp=6&oh=2050bc113f9ad5966cc2cd6f2724deb5&oe=6062A1AF"},"id":"3076009552499500"},{"quantity":"1","name":"Car","currency":"SAR","price":"1000","image":{"id":"3596434427044793","url":"https://mmg.whatsapp.net/v/t45.5328-4/s110x80/121854963_3596434430378126_7909908820759479537_n.jpg?ccb=3&_nc_sid=c48759&_nc_ohc=hVmMKPRyK7EAX-SdFPE&_nc_ad=z-m&_nc_cid=0&_nc_ht=mmg.whatsapp.net&tp=7&oh=9d60e60e33e0174f281a467bd6798ac1&oe=60637D32"},"id":"4647291648677283"}],"price":{"price_status":"provided","total":"23000","currency":"SAR","subtotal":"23000"},"creationTS":"1614543349"}}

beshoo commented 3 years ago

base on https://github.com/Rhymen/go-whatsapp/issues/539 Please kindly can you add the order information function to your PL and return it with the context, the way User can see the Order and the cart details.

Thank you for this great addon

beshoo commented 3 years ago

@Romerito007 waw, you add a new things, is there any explanation?

What is this search business profile... A small documentation will be greatly appreciated.

beshoo commented 3 years ago

Great work, but let me give a small piece of advice. When a user is going to use this handler, he will expect to have the full details, check @hrizal what he said. So I advise you to make the SearchProductDetails inside getOrderMessage handler and return the JSON text along with the main handler result. You may attach the JSON to the OrderMessage struct.

so when the user is going to use this handler it will be something like this

func (wh *WaHandler) HandleOrderMessage(message wa.OrderMessage) {
}

Now the message will have all information, the order, and the order details. In this way, it will be completed 100%, let's save some steps and time :) you are great!

Thank you

beshoo commented 3 years ago

@Romerito007 waiting for your kindly reply. Regard

Romerito007 commented 3 years ago

@Romerito007 waiting for your kindly reply. Regard

I will be able to implement it at the weekend.

beshoo commented 3 years ago

@Romerito007 waiting for your kindly reply. Regard

I will be able to implement it at the weekend.

Oh Thank you, I am waiting for your kind effort.

Diden05 commented 3 years ago

will be able to implement it at the weekend.

Tell me, is it worth waiting until the end of the implementation or do you need to do it yourself?

Romerito007 commented 3 years ago

will be able to implement it at the weekend.

Tell me, is it worth waiting until the end of the implementation or do you need to do it yourself?

You can implement in the event handler, HandleOrderMessage

func (wh *WacSessionHandler) HandleOrderMessage(evt whatsapp.OrderMessage) { // Implementation }