Request for Payment from Bot

Nowadays, chatbots are being used for various applications like Retail, Customer Relationship Management, Citizen Services etc., There are a bunch of scenarios that require users to pay for the products and services that they browse within the Chatbot interface. However, it wouldn’t be a good user experience if we force the users to pay for the products/services outside of the chat interface, as it disconnects the users’ interaction and makes it slightly complex for them to get back to the conversation that they have been participating in with the bot.

The Bot Framework v3 supported the payment process out of the box, but v4 doesn’t. But it doesn’t mean that we can’t build one. There are numerous scenarios where directly paying from within the bot could be immensely useful.

I have been toying with this idea of building the payment process on v4 framework that uses Stripe as payment provider and it is PCI compliant (ie., the bot/solution does not store the credit card related details anywhere). The concept is going to be pretty much the same if you choose to integrate with a different payment provider such as PayPal or Authorize.Net etc.,

To work with the stripe, all you have to get is a Stripe Developer Account and once you verify your mobile number, you will have access to the dashboard where you will find the Publishable Api Key and Secret Key. You need to add the values in the appsettings.json.

I’d also like to highlight that this sample uses Adaptive Cards. Visit this link if you would like to learn more. Watch out for fun samples to play with and learn on your own quite easily.

Here is how it works.

Here is the GitHub link for the solution. Hope it provides a good starting point to build payment processes in your own Bot solutions.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s