File tree Expand file tree Collapse file tree
adyenv6core/src/com/adyen/v6/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import java .math .BigDecimal ;
99import java .math .RoundingMode ;
1010
11+ import static com .adyen .util .Util .getDecimalPlaces ;
12+
1113public class AmountUtil {
1214
1315 public static Amount createAmount (BigDecimal value , String currency ) {
@@ -20,37 +22,6 @@ public static Amount createAmount(BigDecimal value, String currency) {
2022 return amount ;
2123 }
2224
23- public static int getDecimalPlaces (String currency ) {
24- switch (currency ) {
25- case "CVE" :
26- case "DJF" :
27- case "GNF" :
28- case "IDR" :
29- case "JPY" :
30- case "KMF" :
31- case "KRW" :
32- case "PYG" :
33- case "RWF" :
34- case "UGX" :
35- case "VND" :
36- case "VUV" :
37- case "XAF" :
38- case "XOF" :
39- case "XPF" :
40- return 0 ;
41- case "BHD" :
42- case "IQD" :
43- case "JOD" :
44- case "KWD" :
45- case "LYD" :
46- case "OMR" :
47- case "TND" :
48- return 3 ;
49- default :
50- return 2 ;
51- }
52- }
53-
5425 public static BigDecimal calculateAmountWithTaxes (final AbstractOrderModel abstractOrderModel ) {
5526 final Double totalPrice = abstractOrderModel .getTotalPrice ();
5627 final Double totalTax = Boolean .TRUE .equals (abstractOrderModel .getNet ()) ? abstractOrderModel .getTotalTax () : Double .valueOf (0d );
You can’t perform that action at this time.
0 commit comments