Bill Payment Simulation
๐งพ Simulating Bill Payment with Dummy Products (OperatorId: 9992 & 9989)
๐ฆ Dummy Products for Bill Payment
Product ID | Product Name | Behavior Summary |
---|---|---|
9992 | DummyBills | Full flow: invoice query + payment simulation |
9989 | DummyBills2 | Simplified flow: direct payment without invoice query |
๐ Simulation Flow
Product 9992
(Full Flow)
1.
2.
3.
Product 9989
(Simplified Flow)
1.
2.
๐น Step 1: Get Parameters
GET /bill-payment/parameters/{terminalId}/{operatorId}
operatorId = 9992
or 9989
{
"rc": 0,
"message": "OK",
"front": [
{
"name": "account",
"label": "Contract or Account Number",
"type": "INPUT",
"list": [],
"minLength": 6,
"maxLength": 12
}
],
"query": [
"account"
],
"pay": [
"account"
]
}
account
, which determines both the invoice type and the simulated payment result.๐ธ Step 2: Query Pending Invoices (Only for 9992)
POST /bill-payment/invoices/{terminalId}/{operatorId}
[
{
"key": "account",
"value": "123002"
}
]
๐งช Siumlated Behavior Based on Last 3 Digits of account
Ends With | Payment Type | Customer Name | Transaction Code |
---|---|---|---|
000 | OPEN | James May | ABC123XYZ2 |
001 | DISCRETE | Jeremy Clark | ABC123XYZ |
002 | TOTAL | Richard Hammond | ABC123XYZ3 |
Other | No invoices | โ | โ |
additionalData
.๐งช Example of Siumlated Behavior Based on Last 3 Digits of account
{
"rc": 0,
"message": "OK",
"additionalData": [
{
"key": "customerName",
"value": "Richard Hammond"
},
{
"key": "transactionCode",
"value": "ABC123XYZ3"
}
],
"pendingInvoices": 1,
"amountToSendX100": 7000,
"destinationAmountX100": 7000,
"serviceFeeX100": 0,
"totalAmountX100": 7000,
"destinationCurrency": "EUR",
"items": [
{
"amountToSendX100": 7000,
"destinationAmountX100": 7000,
"serviceFeeX100": 0,
"totalAmountX100": 7000,
"destinationCurrency": "EUR",
"date": "2025-07-08",
"expirationDate": "2025-08-08",
"invoiceReference": "INV-XYZ-0003",
"isElegible": true
}
],
"paymentType": "TOTAL"
}
๐ Explanation of isElegible
and paymentType
in Invoice Query Response
9992
, the invoice query response provides two key fields that influence the logic of the payment flow: isElegible
and paymentType
. Here's what they mean and how to handle them in your integration:๐ข isElegible
items[]
arrayType:
boolean
โ
If isElegible: true
/bill-payment/payment
.โ If isElegible: false
Example:
"isElegible": true
โ Invoice is selectable and may be paid.
๐งพ paymentType
Type:
string
Purpose
Value | Meaning |
---|---|
"OPEN" | Amount is flexible. Payment can be partial or undefined. |
"DISCRETE" | Specific invoices must be selected individually and paid separately. |
"TOTAL" | The entire balance must be paid in a single transaction. |
Example:
"paymentType": "TOTAL"
โ The frontend should prompt payment of the full amount listed in amountToSendX100
. Invoice deselection or partial payment is not allowed.
๐ก Integration Tip
isElegible
correctly:false
.additionalData
for clarity.paymentType
:OPEN
, allow user to enter amount.DISCRETE
, show individual invoices.TOTAL
, display single pay button for full amount.paymentType
or how to simulate multiple invoices within items[]
๐งพโจ๐ธ Step 3: Execute Payment
POST /bill-payment/payment/{terminalId}/{operatorId}/{localReference}
{
"amountToSendX100": 7000,
"localDateTime": "2025-07-08T10:00:00Z",
"beneficiaryPhoneNumber": "+34600000000",
"additionalData": [
{
"key": "account",
"value": "123002"
}
]
}
โ Payload Tips
9992
, where the paymentType
determined during the invoice query was "TOTAL"
.๐ Key Behaviors
invoiceNumbers
, since individual item selection is disabled.additionalData
array contains the "account"
as a key-value pair, which is required to identify the payment context:[
{
"key": "account",
"value": "123002"
}
]
amountToSendX100 = 7000
โ this simulates a payment of โฌ70.00localDateTime
marks the timestamp of the simulated payment request:"localDateTime": "2025-07-08T10:00:00Z"
๐ Behavior Based on First Digit of account
Starts With | Simulated Result | Description |
---|---|---|
1 | โ Approved | Payment accepted |
2 | โ DENIED_FROM_PROVIDER | Simulated rejection |
3 | โ TIMEOUT_OR_COMMUNICATION | Simulated network error |
Other | โ SYSTEM_ERROR | Generic failure |
Example: account = "234567"
โ starts with2
โ triggers DENIED_FROM_PROVIDER
๐งช Test Scenarios Summary
Product ID | Account Value | Invoice Type | Payment Result |
---|---|---|---|
9992 | 123000 | OPEN | Approved (starts with 1 ) |
9992 | 456001 | DISCRETE | Rejected (starts with 2 ) |
9992 | 789002 | TOTAL | Timeout (starts with 3 ) |
9989 | 345678 | โ | Timeout (starts with 3 ) |
๐ง Developer Notes
9992
, invoice query is mandatory before payment.9989
, payment can be executed directly.account
suffix to simulate invoice type, and prefix to simulate payment result.resultcode
, resultmessage
, and finalstatus
in responses.
Modified atย 2025-07-08 13:28:05