claudiajs / claudia-bot-builder

Create chat bots for Facebook Messenger, Slack, Amazon Alexa, Skype, Telegram, Viber, Line, GroupMe, Kik and Twilio and deploy to AWS Lambda in minutes

Home Page:https://claudiajs.com/claudia-bot-builder.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

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();
}

Thanks for reporting.

It's fixed and v1.3.3 is published to npm.