@Test public void shouldConvert() throws Exception { RequestMap expectedMap = new RequestMap(); expectedMap.putMap(new HashMap<String, String>(){{ put("currency", "BRL"); put("extraAmount", "9.99"); put("reference", "reference"); }}); RequestMap map = mapConverter.convert(checkoutRegistration); Assert.assertEquals(expectedMap, map); }
@Override protected void convert(RequestMap requestMap, CheckoutRegistration checkoutRegistration) { requestMap.putCurrency("currency", checkoutRegistration.getCurrency()); requestMap.putString("reference", checkoutRegistration.getReference()); requestMap.putCurrency("extraAmount", checkoutRegistration.getExtraAmount()); requestMap.putMap(SHIPPING_MC.convert(checkoutRegistration.getShipping())); requestMap.putMap(SENDER_MC.convert(checkoutRegistration.getSender())); requestMap.putMap(PAYMENT_ITEMS_MC.convert(checkoutRegistration.getItems())); requestMap.putMap(PRE_APPROVAL_MC.convert(checkoutRegistration.getPreApproval())); requestMap.putMap(PARAMETER_MC.convert(checkoutRegistration.getParameters())); requestMap.putMap(ACCEPTED_PAYMENT_METHODS_MC.convert(checkoutRegistration .getAcceptedPaymentMethods())); requestMap.putMap(PAYMENT_METHOD_CONFIGS_MC.convert(checkoutRegistration .getPaymentMethodConfigs())); }
CheckoutRegistrationV2MapConverter extends AbstractMapConverter<CheckoutRegistration> { @Override protected void convert(RequestMap requestMap, CheckoutRegistration checkoutRegistration) { requestMap.putCurrency("currency", checkoutRegistration.getCurrency()); requestMap.putString("reference", checkoutRegistration.getReference()); requestMap.putCurrency("extraAmount", checkoutRegistration.getExtraAmount()); requestMap.putMap(SHIPPING_MC.convert(checkoutRegistration.getShipping())); requestMap.putMap(SENDER_MC.convert(checkoutRegistration.getSender())); requestMap.putMap(PAYMENT_ITEMS_MC.convert(checkoutRegistration.getItems())); requestMap.putMap(PRE_APPROVAL_MC.convert(checkoutRegistration.getPreApproval())); requestMap.putMap(PARAMETER_MC.convert(checkoutRegistration.getParameters())); requestMap.putMap(ACCEPTED_PAYMENT_METHODS_MC.convert(checkoutRegistration .getAcceptedPaymentMethods())); requestMap.putMap(PAYMENT_METHOD_CONFIGS_MC.convert(checkoutRegistration .getPaymentMethodConfigs())); } }
CheckoutRegistrationV2MapConverter extends AbstractMapConverter<CheckoutRegistration> { @Override protected void convert(RequestMap requestMap, CheckoutRegistration checkoutRegistration) { requestMap.putCurrency("currency", checkoutRegistration.getCurrency()); requestMap.putString("reference", checkoutRegistration.getReference()); requestMap.putCurrency("extraAmount", checkoutRegistration.getExtraAmount()); requestMap.putMap(SHIPPING_MC.convert(checkoutRegistration.getShipping())); requestMap.putMap(SENDER_MC.convert(checkoutRegistration.getSender())); requestMap.putMap(PAYMENT_ITEMS_MC.convert(checkoutRegistration.getItems())); requestMap.putMap(PRE_APPROVAL_MC.convert(checkoutRegistration.getPreApproval())); requestMap.putMap(PARAMETER_MC.convert(checkoutRegistration.getParameters())); requestMap.putMap(ACCEPTED_PAYMENT_METHODS_MC.convert(checkoutRegistration .getAcceptedPaymentMethods())); requestMap.putMap(PAYMENT_METHOD_CONFIGS_MC.convert(checkoutRegistration .getPaymentMethodConfigs())); } CheckoutRegistrationV2MapConverter(); }
CheckoutRegistrationV2MapConverter extends AbstractMapConverter<CheckoutRegistration> { @Override protected void convert(RequestMap requestMap, CheckoutRegistration checkoutRegistration) { requestMap.putCurrency("currency", checkoutRegistration.getCurrency()); requestMap.putString("reference", checkoutRegistration.getReference()); requestMap.putCurrency("extraAmount", checkoutRegistration.getExtraAmount()); requestMap.putMap(SHIPPING_MC.convert(checkoutRegistration.getShipping())); requestMap.putMap(SENDER_MC.convert(checkoutRegistration.getSender())); requestMap.putMap(PAYMENT_ITEMS_MC.convert(checkoutRegistration.getItems())); requestMap.putMap(PRE_APPROVAL_MC.convert(checkoutRegistration.getPreApproval())); requestMap.putMap(PARAMETER_MC.convert(checkoutRegistration.getParameters())); requestMap.putMap(ACCEPTED_PAYMENT_METHODS_MC.convert(checkoutRegistration .getAcceptedPaymentMethods())); requestMap.putMap(PAYMENT_METHOD_CONFIGS_MC.convert(checkoutRegistration .getPaymentMethodConfigs())); } CheckoutRegistrationV2MapConverter();  }
CheckoutRegistrationV2MapConverter extends AbstractMapConverter<CheckoutRegistration> { @Override protected void convert(RequestMap requestMap, CheckoutRegistration checkoutRegistration) { requestMap.putCurrency("currency", checkoutRegistration.getCurrency()); requestMap.putString("reference", checkoutRegistration.getReference()); requestMap.putCurrency("extraAmount", checkoutRegistration.getExtraAmount()); requestMap.putMap(SHIPPING_MC.convert(checkoutRegistration.getShipping())); requestMap.putMap(SENDER_MC.convert(checkoutRegistration.getSender())); requestMap.putMap(PAYMENT_ITEMS_MC.convert(checkoutRegistration.getItems())); requestMap.putMap(PRE_APPROVAL_MC.convert(checkoutRegistration.getPreApproval())); requestMap.putMap(PARAMETER_MC.convert(checkoutRegistration.getParameters())); requestMap.putMap(ACCEPTED_PAYMENT_METHODS_MC.convert(checkoutRegistration .getAcceptedPaymentMethods())); requestMap.putMap(PAYMENT_METHOD_CONFIGS_MC.convert(checkoutRegistration .getPaymentMethodConfigs())); } CheckoutRegistrationV2MapConverter();   }