MS Bot Framework Response to Facebook Payment Buy Request

92 views Asked by At

When you show a buy button on Facebook the callback to your bot is an "invoke". Details here [Show the buy button and process the payment on facebook messenger with Bot Framework

It is up to the bot to respond to FB with a 200 for success or something else for a failure. No matter what response I've sent Facebook processes the request as if it were successful.

v3.0 of the bot framework with the C# Connector SDK

I've attempted:

Standard reply:

ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl));
Activity replyToConversation = activity.CreateReply();
replyToConversation.Recipient = activity.From;
replyToConversation.Type = "invoke";
connector.Conversations.ReplyToActivity(replyToConversation);
or
return Request.CreateResponse(HttpStatusCode.InternalServerError);
or
return Request.CreateErrorResponse(...);
or
return null;

I've also forced the Controller to respond with an error by throwing a new exception.

There was a suggestion to rely using channelData however channelData seems to only support attachment type replies and what is needed here is a direct reply to the Payment request.

How do I correctly respond to FB to indicate the payment was NOT successful?

0

There are 0 answers