
Senior Software Engineer D365
Subscribe to the newsletter
Slow, outdated payment processes don’t belong at modern retail checkouts. Today’s customers expect fast, secure, and contactless transactions, and they expect them to work flawlessly. To meet this demand, retailers are integrating digital wallet solutions that simplify payments while improving operational efficiency at the point of sale.
If your retail outlet uses the Store Commerce (MPOS) system, you’ll be pleased to know that modern payment solutions like Alif Pay and JazzCash can be seamlessly integrated for smooth, efficient transactions.
Are you curious about how it works? This blog is your step-by-step guide to integrating these payment solutions into your Store Commerce setup.
Why do QR-based payments matter?
Integrating QR-code payment methods like Alif Pay and JazzCash into the Dynamics 365 MPOS environment enables faster, contactless transactions at checkout. Customers scan a QR code using their mobile wallet apps instead of manually entering payment details or using physical cards.
This shortens the transaction time, reduces dependency on physical payment devices, minimizes cashier input errors, and simplifies end-of-day reconciliation. Additionally, supporting QR payments future-proofs your store setup, making adopting other wallet-based or digital payment methods easier as they become standard.
Read more: How to install and configure the store commerce app in Microsoft Dynamics 365?
Integrating Alif Pay and JazzCash into D365 Store Commerce app: End-to-end payment workflow explained
The standard payment process in the Microsoft Dynamics 365 Store Commerce App (MPOS) has been enhanced to support seamless QR-based transactions with digital wallets like Alif Pay and JazzCash. With this integration, the cashier or shopper triggers a QR-code generation directly within MPOS, and the customer scans and approves the payment in their mobile wallet app. MPOS finalizes the sale, all without leaving the familiar POS interface.
Below, we have outlined each process phase to help you understand the full cycle.
1. User authentication and login
Each transaction begins with a secure login to the Retail MPOS system. Only authenticated users are granted access to initiate sales and manage transactions, ensuring system integrity and compliance with organizational access policies.
2. Product search and cart management
Retail users can add items to a customer’s cart in two ways:
- Search bar: By entering product names or codes manually.
- Barcode scanner: For quick product identification.
3. Payment method selection
At the point of checkout, customers are offered multiple payment methods. If Alif Pay or JazzCash is selected:
- The MPOS system requests the corresponding payment gateway, e.g., Alif Pay or JazzCash.
- A unique QR code is generated using the gateway’s API and displayed on the customer’s screen.
4. QR code scanning and payment initiation
The customer scans the displayed QR code using their mobile payment app (Alif Pay or JazzCash), initiating the payment process directly from their device.
5. Payment verification and completion
Once the customer confirms payment on their app:
- The cashier clicks the “Verify Payment” button in the MPOS.
- The system checks the transaction status via the gateway API.
- If successful, the transaction and the sale are finalized.
- If unsuccessful, an error message is displayed, prompting a retry or alternative payment method.
6. Logs and transaction tracking
To ensure traceability and support auditing:
- All transaction logs are recorded, including request payloads, responses, and errors.
- Logs are maintained in the MPOS and central Headquarters (HQ) systems for enterprise-level visibility.
7. System interfaces
The integration leverages both internal and external system communication layers:
- External interfaces: The MPOS interacts with third-party APIs provided by Alif Pay and JazzCash to manage real-time payment requests and responses securely.
- Internal interfaces: The payment module connects seamlessly with the Sales Management Module, ensuring updates to inventory, order status, and transactional data post-payment.
Process flow diagram
Here’s a visual representation of a process flow diagram illustrating the integration workflow from login to payment completion.
Alif Shop
JazzCash
Step-by-step implementation in Dynamics 365 MPOS
Integrating Alif Pay and JazzCash into Dynamics 365 MPOS involves extending the existing payment workflow to support QR code-based transactions. The implementation includes frontend customization for QR display, backend service development for API communication, and operational logic for verifying and completing payments.
Further reading: How can MPOS in Dynamics 365 be customized for payment extension scenarios?
Follow the steps below to set up the implementation:
Step 1: Open the project in the scale unit
Begin by opening the project in the Commerce Scale Unit. This will be the backend layer where all service logic and controller classes will be implemented.
Step 2: Set up folder structure
Create a new folder dedicated to payment integration inside the Extend folder, such as CFZ_JazzCash.
Divide your code into three main components:
- Dialog layer: This includes the HTML and module files used to create the dialog box for QR display.
- Operations layer: This will house logic to handle dialog actions.
- Backend layer (CRT): For controllers, services, and message contracts.
Step 3: Create the dialog box
DialogSample HTML
DialogSampleModule
Step 4: Implement the operations handler
In the second folder, named Operations, write a handler class responsible for:
- Controlling the dialog interface
- Refreshing the QR code
- Checking the payment status via the external gateway
Refer to the example image provided to structure your class effectively.
Step 5: Add the PreAddTenderLine trigger
Next, integrate the PreAddTenderLine trigger into the Dynamics 365 MPOS flow. This trigger will invoke the payment dialog when a QR-based method is selected at checkout.
Step 6: Backend development – Commerce runtime
Switch to the backend in the Commerce Runtime (CRT) and follow these steps:
- Update the customer controller: Add code to the customer controller that facilitates the interaction between the MPOS and the payment gateway.
Step 7: Create message contracts
Inside the Message Request folder, define your:
- Request class: To send payment data and request the QR code.
- Response class: To receive and interpret responses from the payment gateway.
These classes are essential for communication between the frontend and the backend.
This is an example image of the response class:
Step 8: Develop the API service class
Now, implement a service class to handle external API calls. This service should:
- Call the third-party API (JazzCash or Alif Pay) to get a QR code in Base64 format.
- Convert the Base64 string into an image displayed in the dialog.
Maintain logs for each API request and response, as shown in the attached image references.
Step 9: Implement logging
Finally, make sure all payment-related activities are logged properly. Maintain logs for:
- Transaction requests
- API responses
- Payment status
These logs should be stored in the Retail MPOS and Headquarters (HQ) systems to ensure full visibility and traceability.
Conclusion
Integrating third-party payment solutions like Alif Pay and JazzCash into the Microsoft Dynamics 365 Store Commerce App (MPOS) marks a significant step toward modernizing retail transactions. By enabling secure, QR code-based payments directly within the POS workflow, this solution enhances customers’ checkout experience and streamlines operations for frontline staff.
This implementation provides a scalable foundation for adopting mobile-first payment experiences with real-time API interactions, robust logging, and backend service integration. As retailers prioritize speed, security, and convenience, such integrations will play a critical role in driving customer satisfaction and business efficiency.
If you want to implement or scale digital payment integrations within your Dynamics 365 ecosystem, contact Confiz at marketing@confiz.com. Our team of experts can help you design and deploy intelligent, secure, and scalable commerce solutions tailored to your business needs.