Interaction scenarios
Because MPay integrates multiple payable e-Service providers and different payment providers that offer a variety of payment instruments, there are many ways a payer can interact with it.
Order and pay online¶
Scenario steps:¶
-
Order creation
- A Payer fills in and submits an order at a payable e-Service page
- The order is persisted in e-Service database
-
Payment initiation
- e-Service order confirmation page displays a "Pay" button
-
Redirect to MPay
- Clicking on this button redirects payer's browser to MPay's pay page
-
Payment page request
- The browser posts ServiceID, OrderKey and, optionally, a ReturnUrl to MPay's pay page (see Perform chapter)
-
Order details retrieval
- Before displaying the pay web page, MPay invokes
IServiceProvider.GetOrderDetailsoperation implemented by e-Service web-service
- Before displaying the pay web page, MPay invokes
-
Invoice generation
- Based on returned OrderDetails, MPay creates or updates an existing invoice and shows the invoice details to the payer
-
Payment method selection
- Payer selects a payment method (instrument)
- For bank card payments this means publishing invoice details to the appropriate card processor (which is one of the payment providers)
-
Redirect to payment provider
- MPay redirects the browser to instrument's specific payment page
-
Payment details submission
- Payer fills in the required payment details (such as card details) and submits the payment for authorization
-
Payment authorization
- Payment provider performs the appropriate payment authorization
-
Redirect to payment result
- Payment provider redirects the browser to MPay's payment result page
-
Payment confirmation retrieval
- Before displaying payment results, MPay retrieves a payment confirmation from the payment provider
-
Payment confirmation to e-Service
- If the payment is successful, MPay sends a payment confirmation to e-Service by invoking
IServiceProvider.ConfirmOrderPaymentoperation implemented by e-Service web-service and displays payment results to the payer - Note: ConfirmOrderPayment call can be retried multiple times, until it succeeds. This means that all implementations must be idempotent, i.e. multiple calls must not be considered as multiple payments
- If the payment is successful, MPay sends a payment confirmation to e-Service by invoking
-
Receipt download (optional)
- Optionally, payer can download and print a payment receipt
-
Return to e-Service (optional)
- Optionally, if ReturnUrl was provided at step 4, payer can choose to return to e-Service page
- In this case, MPay redirects the browser to the ReturnUrl
Pay an existing oder¶
Scenario steps:¶
-
Navigate to MPay
- Payer navigates to MPay:
- Test: https://testmpay.gov.md
- Production: https://mpay.gov.md
-
Select service
- Payer selects a service he has the order for
-
Enter order key
- Payer enters the order key (such as order/request number, ticket number for fines, etc.)
-
Continue with standard flow
- The scenario then continues with step 5 of the "Order and Pay online" scenario with IServiceProvider implementation (except returning to ReturnUrl)
- i.e. the order is searched by invoking
IServiceProvider.GetOrderDetailsoperation
Additional use case:¶
This scenario is also applicable when accessing payment terminals (just replace MPay with payment terminal in scenario description text).