This website uses cookies. By continuing to browse the site, you are agreeing to our use of cookies
Digital & Software Solutions
October 8, 2024
In 2010, Apple’s launch of the Siri voice assistant set the standard for what we’ve all come to expect from this technology. While voice assistants are no longer cutting edge, Apple isn’t backing away from investing in Siri’s potential, including by incorporating advanced technologies like large language models to enhance her capabilities. Apple’s ongoing commitment to Siri demonstrates the potential for voice to make everyday tasks, such as paying bills, easier.
The most obvious benefit of including voice enabled payments is the unparalleled level of convenience for your customers. With just a few simple words, they can complete transactions in a matter of seconds, saving both time and effort.
Voice-based payments are particularly appealing to those with mobility issues. For individuals who may struggle with physical manipulation of payment methods or those who are visually impaired, voice payments provide an accessible alternative. By offering this option, you can cater to a wider range of customers and ensure that everyone has equal access to your services.
Including the option to pay by voice also enhances the overall customer experience. It provides a seamless and streamlined payment process, eliminating any friction that may occur with traditional payment methods.
In this article, we’ll share the steps that a developer would need to take to include voice in a financial application.
Siri Shortcuts require the developers to think about and create common phrases that the customer will use so that Siri can recognize them. With Siri Payments, developers need to consider requests about money (send and request payment, pay a friend, etc.) and show the users which application supports these functionalities. Then the users, using only their voices, can start the dialogue with Siri and use their app of choice.
To better explain, here is a real-life example:
If you are an ING, bunq, or Monzo user, you can ask Siri to transfer a certain amount of money to a person that uses the same bank. After that, Siri will guide you throughout the short process to finalize the payment which includes biometric security checks.
Since iOS 13, Siri has had the ability to handle four payment flows:
The following are the steps to implement Siri “Send Payment” with a bank/finance application:
First, you need to add a SiriKit Intent Definition file:
Then, select the file from the project navigator and add the Customize Intent you need. In our case, we selected “Send Payment.”
Compared with Siri Custom Intents, you will have a prefilled configuration.
The next step is to write the code that will handle user requests (in this example, “Send Money to Someone”).
Application Extension
Just like with Siri Shortcuts, you need to add an Intents Extension.
Intents Handler
With the extension creation, Xcode adds a new class to your project:
`final class IntentHandler: INExtension, INSendPaymentIntentHandling`
In this class, we will create all the logic to interact with the user’s requests made with Siri. Every time Siri recognizes a voice request related to “Send Money to Someone,” it will first ask which application the user wants to handle the request. If the user chooses your application, all the dialogue between Siri and the user goes through INSendPaymentIntentHandling delegates:
The basic flow is:
In the following demo code snippets, I show a basic implementation, without real interaction with a backend and covering only “happy paths” (wherein no user path leads to an error).
Check the transfer request currency and if it’s not correct, ask the user to confirm the change.
Check if the amount is above the maximum allowed (or minimum) and if the user has money in the account.
Finally, remove the amount from the user’s account and process the transfer.
To ensure a smooth transition and maximize the benefits of voice payments, consider the following best practices:
We hope you see how easy it is to add Siri Payments to an existing application. Since Siri can’t access personal data or control app logic, following some best practices makes its implementation a no-brainer.
If you’re interested in working with the author of this blog and our other talented engineers, visit the Hexaware jobs portal to check out our open positions.
About the Author
Alessio Roberto
Principal Mobile Engineer
Alessio Roberto is a Principal Mobile Engineer specializing in mobile development. Based in Amsterdam, he has a strong background in building user-friendly applications for both Android and iOS platforms. Alessio excels at blending functionality with intuitive design, ensuring seamless user experiences. His expertise covers the entire development lifecycle, from concept to deployment.
Read more
Every outcome starts with a conversation