Top-Up Simulation
π§ͺ How to Simulate Prepaid Top-Up with Dummy Product (operatorId
9990)
9990
, ideal for safe integration testing. It uses the real methods from the Recharge category and shows how the input and output flow should behave, including dynamic parameter discovery via Get Parameters.π Recommended Flow for Dummy Recharge
1.
2.
3.
πΉ Step 1: Discover Required Fields (Get Parameters)
Get Parameters
Use
operatorId = 9990
for DummyTopupReturns a list of required fields that must be submitted to perform the recharge. These fields are used to dynamically build the form or request body.
{
"rc": 0,
"message": "OK",
"dynamic": false,
"parameters": [
{
"field": "account",
"labels": {
"en": "Mobile number",
"es": "NΓΊmero de mΓ³vil"
}
}
]
}
account
is required, representing the beneficiary phone number.πΈ Step 2: Build the Purchase Payload
Purchase
{
"amountToSendX100": 1000,
"localDateTime": "2025-07-08T10:00:00Z",
"account": "600000001" // Ends in '001' β triggers simulated error 971 (Dummy logic)
}
account
SuffixEnds With | Response Outcome |
---|---|
000 | β Success |
001 | β Error 971 |
002 | β Error 990 |
other | β Error 991 (default) |
account
value you submit.π§ͺ Notes for Testing
600000000
) to trigger different results.resultcode
and resultmessage
fields in the response to validate frontend handling.πΆ About amountToSendX100
amountToSendX100
represents the amount to be sent or paid β expressed in cents, not units. That means:100
corresponds to 1.001000
corresponds to 10.00β Accepted Range
100
and 1000
, inclusive.Value | Interpreted As |
---|---|
100 | 1.00 |
250 | 2.50 |
500 | 5.00 |
1000 | 10.00 |
π‘οΈ This validation range applies to dummy product flows and ensures safe testing without exceeding preset thresholds. π When integrating real products β as opposed to dummy ones β be sure to use the valid price ranges or denominations supported by each product, in line with the values published in the catalog. β Submitting unsupported or incorrect amounts may result in validation errors or rejected transactions from the provider. π§Ύ Tip: Always consult the product catalog or pricing metadata to ensure the amountToSendX100
aligns with available denominations (e.g. β¬500, β¬1000, etc.) for the selected operator or voucher.Make sure your frontend UI reflects this correctly β for example, showing the amount in euros while submitting in cents. Let me know if you'd like helper functions or snippets to convert user-entered values into the correct format πβ¨
π§ Developer Tips
GET /parameters
first to dynamically detect required fields.account
to force the desired response.GET /products
since dynamic
is false for DummyTopup.
Modified atΒ 2025-07-08 13:54:42