In my Integration documentaion i was told to pass like below
|
Denomination details: Need to pass currency details in note and coin. DN2000#~DN500#4~DN200#5~DN100#112~DN50#~DN20#~DN10#~DN5#~DN2#~DN1#~DC10#~DC5#~DC2#~DC1#~DC20# |
i dont understand what does it mean can u pls explain.
C#
Request:
{"ClientUniqueID":"abcd124,
"CustomerMobileNo":9832167737,
"CustomerName":"regkha",
"BeneIFSCCode":"HDFC0400123",
"BeneAccountNo":"123434567",`
"BeneName":"regkha",
"Amount":100,
"RFU1":"",
"RFU2":" DN2000#~DN500#4~DN200#5~DN100#112~DN50#~DN20#~DN10#~DN5#~DN2#~DN1#~DC10#~DC5#~DC2#~DC1#~DC20#",
"RFU3":""
} and i need to pass my request like this..
for ex: if i Pass
5000
it should pass through that denomination like
2000*2
1000*1
if coins are there
5*1 like it need to check to that sequence
Example :
- Correct Case : Transaction amount and Denomination details match.
-
- Transaction amount =3001
- Denomination details = DN2000#1~DN500#~DN200#5~DN100#~DN50#~DN20#~DN10#~DN5#~DN2#~DN1#~DC10#~DC5#~DC2#~DC1#1~DC20#
-
- Incorrect Case : If Transaction amount and Denomination details not match.
-
- Transaction amount =3000
- Denomination details = DN2000#2~DN500#4~DN200#5~DN100#~DN50#~DN20#~DN10#~DN5#~DN2#~DN1#~DC10#~DC5#~DC2#~DC1#~DC20#
-
DN : Denomination Note
DC : Denomination Coin

Amit MohantyRank #112 · 20K reputationPosted Feb 13, 2024, 6:19 AM EST
DN: Means a bank note.
DC: Means a coin.
#: Separates the denomination from the quantity.
~: Separates different denominations.
For example, in the string "DN2000#~DN500#4~DN200#5~DN100#112~DN50#~DN20#~DN10#~DN5#~DN2#~DN1#~DC10#~DC5#~DC2#~DC1#~DC20#"
DN2000#: This means there are denomination note of 2000 currency units, and there's no quantity. Because after # there is nothing specified.
DN500#4: This means there are 4 denomination note of 500 currency units.
DN200#5: This means there are 5 denomination note of 200 currency units.
DN100#112: This means there are 112 denomination note of 100 currency units.
DN50#, DN20#, DN10#, DN5#, DN2#, DN1#: Similar to above, with no quantity.
DC10#, DC5#, DC2#, DC1#, DC20#: Similar to above, but for coins instead of notes.
Amit MohantyRank #112 · 20K reputationPosted Feb 13, 2024, 6:43 AM EST
Check this:
public class DenominationCalculator { public static string CreateDenominationString(List denominations) { List originalDenominations = new List { "DN2000", "DN1000", "DN500", "DN200", "DN100", "DN50", "DN20", "DN10", "DN5", "DN2", "DN1", "DC20", "DC10", "DC5", "DC2", "DC1" }; StringBuilder denominationString = new StringBuilder(); foreach (string denomination in originalDenominations) { bool exists = denominations.Any(d => d.Item1 == denomination); if (exists) denominationString.Append($"{denomination}#{denominations.FirstOrDefault(d => d.Denomination == denomination).Count}~"); else denominationString.Append($"{denomination}#~"); } return denominationString.ToString().TrimEnd('~'); } } class Program { static void Main() { List denominations = new List { ("DN2000", 2), ("DN1000", 1), ("DN5", 2) }; string denominationString = DenominationCalculator.CreateDenominationString(denominations); Console.WriteLine(denominationString); } }Jaya PrakashRank #1,293 · 1.3K reputationPosted Feb 13, 2024, 6:23 AM EST
yeah but how can i do that in code behind and as u said how should i compare my actual entered amount with this type of logic?