PicPay Payments July 25, 2023 20:47 Updated Index: Introduction How does it work? Installation and configuration Usage examples Support Introduction PicPay Payments is an extension that allows for a quick and simple integration of PicPay as a payment method in the intelligent contact. For example: It is possible to provide the user with a PicPay payment link and check the transaction history that occurred in the bot through the extension itself. Note: Extension available only in Portuguese! How does it work? The PicPay Payment Module offers the following functionalities: Creation of payment links Report of transactions made in the bot It is supported on the following channels: WhatsApp Installation and configuration After activating the extension from Blip Store, it must be installed on the ROUTER bot with the WhatsApp channel enabled. After activation, you should follow the steps below for proper functioning: 1.Create a bot to be used for the payment flow. This subbot will be used by the extension to publish the payment flow that will be used by the integration API. Suggested name for the bot: Bot PicPay Payments. Suggested name for the service on the router: picpay You will only need to create the bot, ENABLE THE ROUTER CONTEXT, publish the existing flow, and connect it as a service on the router. Configure router context Publish flow Finally, set up the service on your router. Learn how to do it in our article "How to create a bot router" in the Help Center. 2.Access the PicPay Payments extension Insert your PicPay credentials and choose the previously created subbot to publish the payment flow. After that, just click on connect. By clicking on connect, the payment flow will be added to the selected subbot. Extension Home Screen You can obtain the PicPay credentials from your PicPay Empresas (PicPay Business) account. Obtaining PicPay Credentials 3. Configure the redirection of the existing flow to the subbot. Please note that adding a new payment method will require adjustments to the intelligent contact flow, such as adding a menu of options for the user to choose the payment method. To send the user from your flow to the payment subbot, you will need to create a redirection that will send the following object as a message: { "origin": "nomeDoServicoAtual", //fluxo que envia o usuario "destination": "picpay", //nome do servico do subbot "userInput": "inputDoUsuario", //ultimo input do usuario "custom": { "picpay": { "firstName": "PRIMEIRO NOME", //primeiro nome do usuario "lastName": "ULTIMO NOME", //sobrenome do usuario "cpf": "01234567890", //cpf do usuario "amount": 1.99 //valor da transacao a ser criada } }, "callback": { "serviceName": "servicoAposPagamento" //nome do servico que o usario devera ser redirecionado na volta do pagamento }} This object must be generated through a "Run Script" action that should be executed before the "Redirect to a Service" action. Example of script to build the object: function run(input,firstName,lastName,cpf,valor) { let obj = { "origin": "main", "destination": "payments", "userInput": input, "custom": { "picpay": { "firstName": firstName, "lastName": lastName, "cpf": cpf, "amount": parseFloat(valor) } }, "callback": { "serviceName": "main" } }; return obj;} This script receives the input variables: input.content firstName lastName cpf valor With the exception of input.content, the variables need to be defined at some point in the conversation flow with your client; the valor variable needs to be sent as a float format in the object. Considering that the return variable of the above script will be objService, you can configure the redirection to the service as follows: When the user is redirected back, after the payment has been successful or not, they will be redirected to the service added to the callback with the following message: { "origin": "open-finance-take", "destination": "servicoAposPagamento", "userinput": "inputDoUsuario", "custom": { "picpay": { "Success": "true", "FailReason": "" } }} This message will allow you to handle each situation of the payment flow return in the best way possible. 4. Tracking the sales made by the bot Once everything is set up, your intelligent contact is now ready to sell using PicPay as a payment method through the extension. You will be able to track the transactions that occur in the bot through the extension. Extension report screen Usage examples Connection with your PicPay account Access the Extension: [Link to access the extension] Please enter the credentials and choose the previously published bot, according to the installation topic. After connecting, the screen will automatically change to the transaction report, where you can track the transactions that are carried out in the intelligent contact. The extension will not display all sales made with your PicPay account, only those made through the CI (Intelligent Contact). Support If you have any questions or encounter any issues with the extension, please contact us at the following number: (31) 3349-6201. For more information, visit the discussion on the subject in our community or the videos on our channel. 😃 Related articles Configuring payments in the Blip builder Using Dynamic Content How to build bots using SDKs or HTTP API Features of the Blip Chat Widget Custom Breaks