web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Unanswered

Payment connector - how to call method "ExecuteTask"

(2) ShareShare
ReportReport
Posted on by 62
Hi,
 
I have a payment connector for a payment device (INamedRequestHandler) and that holds a method called "ExecuteTask".

The description for "ExecuteTask" is as follows:

_This extension request can be invoked from the POS through customizations. It is used to enable additional payment-related flows._
 
I want to create a new button on the POS and when the user pushes that button I want to call this "ExecuteTask" method so that this method can execute a certain task on my payment device.

Can someone please advice me how to approach this or perhaps share a code sample where I can see how this "ExecuteTask" method is called?
 
Any help is welcome.
 
Thx in advance!
 
 
I have the same question (0)
  • Suggested answer
    Oksana Kovaliova Profile Picture
    3,597 on at
    Payment connector - how to call method "ExecuteTask"
    Dear Mica
     
    Please, see a sample below (call it from POS).
    1) taskName is your task name you will define in Payment device class
    2) Input - any input parameters you need to do for task.
     
    import { PaymentTerminalExecuteTaskResponse, PaymentTerminalExecuteTaskRequest } from "PosApi/Consume/Peripherals";

    public async executeTask(taskName: string, input: ClientEntities.IExtensionTransaction): Promise<void> {
            var success = true;
            var taskRequest = new PaymentTerminalExecuteTaskRequest<PaymentTerminalExecuteTaskResponse>(taskName, input);
            var taskResponse = await this.context.runtime.executeAsync(taskRequest);
            var output = [];
            var errorMessage = '';
            var anyResult: any = taskResponse.data.result;
            if (anyResult.ExtensionProperties != undefined) {
                output = anyResult.ExtensionProperties;
                
                //Implement exception handling in a way how it works for you 
            }
            return Promise.resolve(); //Return any data needed for you here
        }
  • LC-01111219-0 Profile Picture
    3 on at
    Payment connector - how to call method "ExecuteTask"
    I would just like to comment and confirm that I have tried out this solution and it works really well! 
    Thank you for this response! 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 244

#2
Siv Sagar Profile Picture

Siv Sagar 222 Super User 2025 Season 2

#3
Danny Bilodeau Profile Picture

Danny Bilodeau 205 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans