1
0
Fork 0
mirror of synced 2025-04-04 21:53:37 +03:00

add receipt message payload

This commit is contained in:
DmitryZagorulko 2018-09-27 17:54:00 +03:00 committed by Neur0toxine
parent b88edd8392
commit b536bf7766

View file

@ -443,6 +443,39 @@ type StructuredMessagePayload struct {
Buttons *[]StructuredMessageButton `json:"buttons,omitempty"`
Url string `json:"url,omitempty"`
AttachmentID string `json:"attachment_id,omitempty"`
ReceiptMessagePayload
}
type ReceiptMessagePayload struct {
RecipientName string `json:"recipient_name,omitempty"`
OrderNumber string `json:"order_number,omitempty"`
Currency string `json:"currency,omitempty"`
PaymentMethod string `json:"payment_method,omitempty"`
Timestamp int64 `json:"timestamp,omitempty"`
Address *Address `json:"address,omitempty"`
Summary *Summary `json:"summary,omitempty"`
Adjustments []Adjustment `json:"adjustments,omitempty"`
}
type Address struct {
Street1 string `json:"street_1,omitempty"`
Street2 string `json:"street_2,omitempty"`
City string `json:"city,omitempty"`
PostalCode string `json:"postal_code,omitempty"`
State string `json:"state,omitempty"`
Country string `json:"country,omitempty"`
}
type Summary struct {
Subtotal float32 `json:"subtotal,omitempty"`
ShippingCost float32 `json:"shipping_cost,omitempty"`
TotalTax float32 `json:"total_tax,omitempty"`
TotalCost float32 `json:"total_cost,omitempty"`
}
type Adjustment struct {
Name string `json:"name,omitempty"`
Amount float32 `json:"amount,omitempty"`
}
// StructuredMessageElement is a response containing structural elements
@ -453,6 +486,13 @@ type StructuredMessageElement struct {
Subtitle string `json:"subtitle"`
DefaultAction *DefaultAction `json:"default_action,omitempty"`
Buttons []StructuredMessageButton `json:"buttons"`
ReceiptMessageElement
}
type ReceiptMessageElement struct {
Quantity float32 `json:"quantity,omitempty"`
Price float32 `json:"price,omitempty"`
Currency string `json:"currency,omitempty"`
}
// DefaultAction is a response containing default action properties