Receipt Template Doc Error + OAuth "Facebook Platform" "invalid_request" "(#100) Invalid keys \\"total_amount\\" were found in param \\" Key
reyreaud-l opened this issue · comments
ExKo commented
- Expected behaviour:
Display receipt - What actually happens:
Invalid Key : OAuth "Facebook Platform" "invalid_request" "(#100) Invalid keys "total_amount" were found in param " - Which bot engine (facebook, skype...):
facebook
I literally cc'ed the doc code, had to fix currency (need to be ISO 4217, not '$' but 'USD') + total_amount raise invalid_keys.
Code:
function sendReceiptMessage(recipientId) {
return new fbTemplate.receipt('Pizza order', 'ORDER-123', 'USD', 'Paypal')
.addTimestamp(new Date())
.addItem('Pizza')
.addSubtitle('32cm')
.addQuantity(1)
.addPrice(4.99)
.addShippingAddress('Some street 123', null, 'San Francisco', '123', 'CA', 'US')
.addTotal(4.99)
.get();
}
Slobodan Stojanović commented
Thanks for reporting.
It's fixed and v1.3.3 is published to npm.