feat(business): add support for fetching order details#967
Open
salman0ansari wants to merge 5 commits into
Open
feat(business): add support for fetching order details#967salman0ansari wants to merge 5 commits into
salman0ansari wants to merge 5 commits into
Conversation
|
nice ... |
|
@tulir merge? |
purpshell
approved these changes
May 11, 2026
Contributor
purpshell
left a comment
There was a problem hiding this comment.
verified working on whatsapp business android
purpshell
reviewed
May 11, 2026
Comment on lines
+56
to
+64
| // Helper to get the string content of a child node. | ||
| func getStringChild(node waBinary.Node, tag string) string { | ||
| child, ok := node.GetOptionalChildByTag(tag) | ||
| if !ok { | ||
| return "" | ||
| } | ||
| content, _ := child.Content.([]byte) | ||
| return string(content) | ||
| } |
Contributor
There was a problem hiding this comment.
Not the right place for a helper like this.
Contributor
Author
There was a problem hiding this comment.
what should be done?
Contributor
Author
There was a problem hiding this comment.
should i keep this scoped to the order-details parser instead ??
func parseOrderDetailsNode(orderNode waBinary.Node) (*types.OrderDetails, error) {
getStringChild := func(node waBinary.Node, tag string) string {
child, ok := node.GetOptionalChildByTag(tag)
if !ok {
return ""
}
content, _ := child.Content.([]byte)
return string(content)
}
ag := orderNode.AttrGetter()
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GetOrderDetailsto fetch order detailsbusiness.gofile is introduced to house this and other business-related logic.types/business.go.Usage
Response
{ "id": "order-id-here", "created_at": "YYYY-MM-DDTHH:MM:SS+TZ", "catalog_id": "catalog-id-here", "price": { "subtotal": 1, "total": 1, "currency": "USD", "price_status": "provided" }, "products": [ { "id": "product-id-here", "image_id": "image-id-here", "image_url": "https://example.com/product-image.jpg", "price": 1, "currency": "USD", "name": "Product Name", "quantity": 1, "variant_info": {} } ] }