|
34 | 34 | import static com.forgerock.sapi.gateway.ob.uk.common.datamodel.converter.v4.account.FRBalanceTypeConverter.toOBBalanceType1CodeV4; |
35 | 35 | import static com.forgerock.sapi.gateway.ob.uk.common.datamodel.converter.v4.account.FRCashBalanceConverter.toFRBalanceType; |
36 | 36 | import static com.forgerock.sapi.gateway.ob.uk.common.datamodel.converter.v4.account.FREntryStatusConverter.toExternalEntryStatus1CodeV4; |
| 37 | +import static com.forgerock.sapi.gateway.ob.uk.common.datamodel.converter.v4.account.FREntryStatusConverter.toFREntryStatusV3; |
37 | 38 |
|
38 | 39 | public class FRTransactionConverter { |
39 | 40 |
|
@@ -71,19 +72,19 @@ public static OBTransaction6 toOBTransaction6(FRTransactionData transaction) { |
71 | 72 | } |
72 | 73 |
|
73 | 74 | public static ExternalEntryStatus1Code toOBEntryStatus1Code(FRTransactionData.FREntryStatus status) { |
74 | | - return status == null ? null : ExternalEntryStatus1Code.valueOf(status.name()); |
| 75 | + return status == null ? null : ExternalEntryStatus1Code.fromValue(status.name()); |
75 | 76 | } |
76 | 77 |
|
77 | 78 | public static ExternalCategoryPurpose1Code toOBExternalCategoryPurpose1Code(FRExternalCategoryPurposeCode categoryPurposeCode) { |
78 | | - return categoryPurposeCode == null ? null : ExternalCategoryPurpose1Code.valueOf(categoryPurposeCode.name()); |
| 79 | + return categoryPurposeCode == null ? null : ExternalCategoryPurpose1Code.fromValue(categoryPurposeCode.name()); |
79 | 80 | } |
80 | 81 |
|
81 | 82 | public static OBExternalPurpose1Code toExternalPurpose1Code(FRExternalPaymentPurposeCode externalPaymentPurposeCode) { |
82 | | - return externalPaymentPurposeCode == null ? null : OBExternalPurpose1Code.valueOf(externalPaymentPurposeCode.name()); |
| 83 | + return externalPaymentPurposeCode == null ? null : OBExternalPurpose1Code.fromValue(externalPaymentPurposeCode.name()); |
83 | 84 | } |
84 | 85 |
|
85 | 86 | public static OBInternalTransactionMutability1Code toOBTransactionMutability1Code(FRTransactionData.FRTransactionMutability transactionMutability) { |
86 | | - return transactionMutability == null ? null : OBInternalTransactionMutability1Code.valueOf(transactionMutability.name()); |
| 87 | + return transactionMutability == null ? null : OBInternalTransactionMutability1Code.fromValue(transactionMutability.name()); |
87 | 88 | } |
88 | 89 |
|
89 | 90 | public static OBBankTransactionCodeStructure1 toOBBankTransactionCodeStructure1(FRTransactionData.FRBankTransactionCodeStructure transactionCode) { |
@@ -133,11 +134,11 @@ public static OBMerchantDetails1 toOBMerchantDetails1(FRTransactionData.FRMercha |
133 | 134 | } |
134 | 135 |
|
135 | 136 | public static OBTransactionCardInstrument1CardSchemeName toOBTransactionCardInstrument1CardSchemeName(FRTransactionData.FRCardScheme cardSchemeName) { |
136 | | - return cardSchemeName == null ? null : OBTransactionCardInstrument1CardSchemeName.valueOf(cardSchemeName.name()); |
| 137 | + return cardSchemeName == null ? null : OBTransactionCardInstrument1CardSchemeName.fromValue(cardSchemeName.name()); |
137 | 138 | } |
138 | 139 |
|
139 | 140 | public static OBTransactionCardInstrument1AuthorisationType toOBTransactionCardInstrument1AuthorisationType(FRTransactionData.FRCardAuthorisationType authorisationType) { |
140 | | - return authorisationType == null ? null : OBTransactionCardInstrument1AuthorisationType.valueOf(authorisationType.name()); |
| 141 | + return authorisationType == null ? null : OBTransactionCardInstrument1AuthorisationType.fromValue(authorisationType.name()); |
141 | 142 | } |
142 | 143 |
|
143 | 144 | // OB to FR |
@@ -176,19 +177,19 @@ public static FRTransactionData toFRTransactionData(OBTransaction6 transaction) |
176 | 177 | } |
177 | 178 |
|
178 | 179 | public static FRTransactionData.FREntryStatus toFREntryStatus(ExternalEntryStatus1Code status) { |
179 | | - return status == null ? null : FRTransactionData.FREntryStatus.valueOf(status.name()); |
| 180 | + return status == null ? null : FRTransactionData.FREntryStatus.fromValue(String.valueOf(toFREntryStatusV3(status.name()))); |
180 | 181 | } |
181 | 182 |
|
182 | 183 | public static FRTransactionData.FRTransactionMutability toFRTransactionMutability(OBInternalTransactionMutability1Code transactionMutability) { |
183 | | - return transactionMutability == null ? null : FRTransactionData.FRTransactionMutability.valueOf(transactionMutability.name()); |
| 184 | + return transactionMutability == null ? null : FRTransactionData.FRTransactionMutability.fromValue(transactionMutability.name()); |
184 | 185 | } |
185 | 186 |
|
186 | 187 | public static FRExternalCategoryPurposeCode toFRExternalCategoryPurposeCode(ExternalCategoryPurpose1Code externalCategoryPurpose1Code) { |
187 | | - return externalCategoryPurpose1Code == null ? null : FRExternalCategoryPurposeCode.valueOf(externalCategoryPurpose1Code.name()); |
| 188 | + return externalCategoryPurpose1Code == null ? null : FRExternalCategoryPurposeCode.fromValue(externalCategoryPurpose1Code.name()); |
188 | 189 | } |
189 | 190 |
|
190 | 191 | public static FRExternalPaymentPurposeCode toFRExternalCategoryPurposeCode(OBExternalPurpose1Code obExternalPurpose1Code) { |
191 | | - return obExternalPurpose1Code == null ? null : FRExternalPaymentPurposeCode.valueOf(obExternalPurpose1Code.name()); |
| 192 | + return obExternalPurpose1Code == null ? null : FRExternalPaymentPurposeCode.fromValue(obExternalPurpose1Code.name()); |
192 | 193 | } |
193 | 194 |
|
194 | 195 | public static FRTransactionData.FRBankTransactionCodeStructure toFRBankTransactionCodeStructure(OBBankTransactionCodeStructure1 transactionCode) { |
@@ -244,10 +245,10 @@ public static FRTransactionData.FRTransactionCardInstrument toFRTransactionCardI |
244 | 245 | } |
245 | 246 |
|
246 | 247 | public static FRTransactionData.FRCardScheme toFRCardScheme(OBTransactionCardInstrument1CardSchemeName cardSchemeName) { |
247 | | - return cardSchemeName == null ? null : FRTransactionData.FRCardScheme.valueOf(cardSchemeName.name()); |
| 248 | + return cardSchemeName == null ? null : FRTransactionData.FRCardScheme.fromValue(cardSchemeName.name()); |
248 | 249 | } |
249 | 250 |
|
250 | 251 | public static FRTransactionData.FRCardAuthorisationType toFRCardAuthorisationType(OBTransactionCardInstrument1AuthorisationType authorisationType) { |
251 | | - return authorisationType == null ? null : FRTransactionData.FRCardAuthorisationType.valueOf(authorisationType.name()); |
| 252 | + return authorisationType == null ? null : FRTransactionData.FRCardAuthorisationType.fromValue(authorisationType.name()); |
252 | 253 | } |
253 | 254 | } |
0 commit comments