⬆️ ⬇️

Currency exchange: fix the course for offline online. VTB24 experience

Currency exchange is a boring and standard process through which, for one reason or another, everyone goes through. It seems technically there is already nothing special to do. VTB24 does not think so - we, as a bank, are aware of several unresolved currency exchange problems that can be encountered suddenly and at the most inappropriate moment. And they decided with the help of IT. What problems and how exactly decided - read under the cut.







VTB24 invented a new currency exchange service - by fixing the exchange rate online, you can come to the office and exchange currency. The course can be recorded on the bank's website or in a chat bot in Facebook messenger. The service allows customers to fix the currency exchange rate for two working days, not counting the day of the order, and to make a cash currency exchange, even if the market rate changes.



The service is available to customers with a card of any Russian bank, both for buying and selling cash in cash, with the exchange rate fixed online 24/7.

')

How did we come up with this idea



There were several prerequisites for the formation of ideas and the creation of a new service.

These are the most common questions during the holiday season of the population: “Where can I change the currency? Where is the best course? How to change profitable? ”, As well as dynamic changes in exchange rates and the desire for greater certainty on the part of customers.



More and more purchases are happening online, and therefore banking services are also changing, even for such a conservative market as the exchange of cash currency. Innovations are, as usual, from the needs of customers.



When a client has a need to exchange cash currency, he, as a rule, is sent to a bank exchange office, while no one is ever sure that there is a sufficient amount of currency at the bank’s cash office, especially if it is large. At best, an advanced client will try to call the bank and clarify about the availability of currency. At the same time, everyone understands that a bank can sell a currency to another customer who came earlier or give it to a depositor, which is often a priority for many banks. In addition, at any time the bank can change the course - sometimes it happens 5-6 times a day. All this creates discomfort to the consumer.



Therefore, it was decided to implement the idea of ​​an online store, in which you can fix the rate in real time and at the same time exchange the cash currency.



Thus, the new service solves two problems:



  1. gives the customer the opportunity to fix the course online and come with the amount of the transaction for cash exchange later at a convenient time.
  2. guarantees the client the availability of the necessary amount of currency or rubles for an exchange at the bank’s cash desk.


Someone will say that it is possible to exchange currency in the Internet bank, but it must be taken into account that a transaction is made cashless there and the amount of coverage must be in advance on the account. Many people prefer to deal with cash and do not limit the choice of a bank to those with an account and an Internet bank.



We decided not only to implement the service on the site, but also to make it available through popular social networks - for example, a chat bot on Facebook .



VTB24 is one of the first banks to implement it in its branches, and for a client interaction with a well-known banking brand with state participation is convenient and reliable.



Technically, the process looks like this. A user visits obmen.vtb24.ru or a chat bot on Facebook and sees an exchange rate that he can fix for 2 days.



Next, he enters his data - last name, first name, if desired, patronymic and contact phone number - and necessarily an e-mail. Chat bot saves these parameters for new orders - until the user asks him to delete them. After entering the currency amount, the bot registers in the chat the period up to which the currency must be exchanged, and the amount (10% of the transaction amount) reserved in the client's account as a guarantee of exchange until the transaction - in case of refusal or delay, the bank holds it. Similar reservations are made by travelers, booking hotels on the Internet or renting a car, while providing funds on the card as a security deposit.



After confirming the order, the client goes to the payment page, enters the card details, and in case the reservation of funds is successful, will receive an order confirmation (number and parameters) on the next page. Receipt of the order will be sent to the e-mail.









From the point of view of updating the rates, the bot and the site are connected with the front-office system of the bank, which gives real-time currency quotes (real-time mode - by ticks from the stock exchange, that is, once a second).







How did we handle this?



For the development of the site and chatbot we attracted partners from EPAM and InspiredGames and

asked them to comment on the technical features of the project.



Word InspiredGames:



“Our studio took on the task of selling the bot for all the main messengers to provide banking services in the field of foreign exchange operations. It would seem - nothing complicated, almost an ordinary online store.



But:





At the same time, the bot is an interface, but the functions that are usually associated with the back-end part are implemented (receiving the actual rates from the bank, the automated workplace for its authorized employees, mentioned above, ordering data, transactional actions with the payment system, reminders, audit ...).



The task was successfully solved, the service is working, and we would like to talk about several approaches that we have applied. Of course, we will be happy and verification of these approaches, and any opinion.



So, first of all, there was a choice - whether to use any frameworks or constructors? The Microsoft Bot Framework is great, but there is no connector to Viber and even more so to VKontakte. Other designers (at least, those that we found) did not have the flexibility we needed. Therefore, we decided to do everything ourselves. As for the infrastructure solution, they thought it would be best to use our usual and familiar use of the RESTful Web API, respectively, IIS, and for convenience, MS SQL as a DBMS (with all views, access sharing, a couple of stored procedures and triggers).



This is all clear. But there are two things that for us were not obvious from the very beginning, and which we did not see in those bots with whom we became acquainted.



First: modularity.



The engine (“core”) of the bot “communicates” both with messengers and with other systems (the specialized part of the bank’s back-office, the payment card system) not directly, but through specialized modules - “connectors”. In addition, the data service is separated. So there is:





The interaction of the modules, by the way, is also through the REST API.



When a messenger user — no matter what — receives a message, the corresponding connector sends it to the kernel, the kernel analyzes it, generates a response message (this also requires a data service, and often other services) and sends it back to this connector . This allowed us to:





The second: the concept of “text-context-subtext”.



In short, within this concept, the bot's response depends not only on the text (semiotically, geolocation, which the user transmits, also the text) the user's message, but also on the context (in what state _nach_ the user is in dialogue with the bot, " what the user is talking about now "), and, further, from the subtext (_story_ of dialogue, and not only this particular user, -" what was the conversation before) ".



Probably, someone has already guessed that such a concept can be implemented in terms of the finite state machine Miles (text-context-> new context-response) with infinite memory (subtext). But if you do not go into details, the easiest way is to explain with examples.



The user sends the bot message "order". Text = "order", but not enough to know the text. The kernel accesses the data service and gets the current context of this user. (For reference, we now have just over 200 contexts, and they can be configured without programming).



If the received context is “a user sends a message to a bank employee”, then no subtext is needed, you just need to send a message to the bank, reply to the user that everything has been sent and will contact him after some time, and get into the new context “main menu”.



If the received context is the “main menu”, then a subtext is also needed. Namely, the kernel receives a subtext from the data service, consisting of a set of formal (as in a passport) surname, first name, middle name and email address of this user. And now the answer of the bot depends on the subtext. If such a subtext is non-empty (which means that the user has previously informed his bot), the bot will offer to use it (or change it if necessary) and place an order. If such a subtext is empty, then the bot as a condition for placing an order will indicate the need to communicate this data. And when the data is received, the necessary subtext appears, and the order can be made. The following context - “all user data is received, we continue the order”. It is clear that with all this history is accumulating (which, in turn, will be used to obtain a new subtext).



Great, but where is the NLP? True, NLP (Natural Language Processing) is now a very fashionable abbreviation. But just for now, even here, on Habrahabr, sometimes natural language processing is confused with neuro-linguistic programming. And, like NLP - “programming”, NLP - Russian processing now does not work as well as we would like. In addition, there is another subtlety - in our opinion (and in the opinion of other experts), the user does not want to communicate with the bot as a person. He understands that this is a program, and wants to get a UI as with a program - buttons, colors, pictures ...



But if you have a lemon, then you can make lemonade out of it. That is why we:

- preferred to make a “team” (and not pure chat) bot;

- we use the NLP service as a module (service for the kernel, as described above), which allows us, along with the context and subtext, to sort through the text what the user wants. This module (depending on the context!) Returns us an array of objects that are analyzed by the kernel. A simple example is if the context is “placing an order at the stage of selecting the main exchange parameters”, then this text will generate an array for the text “$ 500”:



{    "deal_candidates":    [ { "direction": "buy", "amount":500, "ISOCode": "USD"}, { "direction": "sell", "amount":500, "ISOCode": "USD"} ] } 


And already on this array, the bot's core will ask "choose what you want."



The result of our experience:





Why the site was chosen not only for the site, but also for the chat bot:





VTB24 plans to release chat bots in all available instant messengers in the future (we will add VibER and Vkontakte, and we also hope to wait for the opening of the WhatsApp API).



Also, despite all the difficulties, we will continue to delve into the topic of NLP for more convenient user interaction. In the personal account on the bank site, the chat bot is already working, with which you can chat and get advice and help from it. The results of the work and training of this bot will be implemented in the conversion chat bots in instant messengers.



We also plan to increase the range of financial services offered by chat bots, not only related to foreign exchange transactions.



Fixing an offline course online is a new important channel for providing services to the public.



This is a real innovative service, another small step in the digitalization of banking services. The new service allows you to exchange cash currency "here and now." At the same time, the bank is getting closer to the consumers of the mass segment: it is not necessary to be a VTB24 customer; in order to use the service, it is enough to have a card of any Russian bank.



For VTB24, this is also a great opportunity to play and test new technologies in order to determine the vector of further development.

Source: https://habr.com/ru/post/333724/



All Articles