Messenger components
These components only work on Facebook Messenger and Meya's live chat
meya.receipt
A receipt card that outputs a variety of information pertaining to a purchase.
Support
Currently only Messenger and Meya Live chat support the receipt card.
Property | Description | |
---|---|---|
recipient_name | the name of the purchaser | Required |
order_number | the order number (must be unique) | Required |
currency | the currency in which the purchase was made | Required |
payment_method | a shorthand string to show the purchase method (e.g. Visa 1234) | Required |
summary | a summary of the purchase, including total | Required
|
elements | the list of elements purchased | Required
|
address | the shipping address |
|
adjustments | the list of adjustments made to the price |
|
timestamp | the time the purchase was made | |
order_url | a link to more purchase information |
Example of a receipt card in a flow and custom component.
component: meya.receipt
properties:
recipient_name: Nikola Tesla
order_number: "123456789"
currency: USD
payment_method: Mastercard 1234
summary:
subtotal: 42.00
total_cost: 45.00
elements:
- title: Red bag flux
price: 22.00
image_url: 'http://i.imgur.com/1c3xI4a.jpg'
- title: Blue bag coil
price: 20
image_url: 'http://i.imgur.com/FdF9EXB.jpg'
address:
street_1: 125 Main St
postal_code: "123456"
city: Megacity
state: 'OH'
country: USA
adjustments:
- name: New customer
amount: 5
from meya.cards import Receipt
receipt_data = {
'recipient_name': 'Nikola Tesla',
'order_number': '123456789',
'currency': "CAD",
'payment_method': "Mastercard 1234",
'order_url': "https://meya.ai/asdfasdf",
'timestamp': "1465492181",
'summary': {
'subtotal': 42.00,
'total_cost': 45.22
},
'elements': [
{
'title': "Red bag flux",
'price': 22,
'image_url': "http://i.imgur.com/1c3xI4a.jpg"
},
{
'title': "Blue bag coil",
'price': 20,
}
],
'address': {
'street_1': "125 Main St.",
'street_2': "Unit 100",
'postal_code': "1234562",
'city': "Megacity",
'state': "OH",
'country': "USA",
},
'adjustments': [
{
'name': "New customer",
'amount': 5.00
}
]
}
card = Receipt(payload=receipt_data)
Updated 18 days ago