String key = (String) iterator.next();
String value = paymentGatewayForm.getGlobalAttributeMap().get(key);
boolean success = paymentGateway.updateAttribute(key, value);
if(!success){
// ATTRIBUTE DOESN'T EXIT - ADD
AttributeDefinition attributeDefinition = attributeService.getAttributeDefinitionByCode(key);
paymentGateway.addAttribute(null, attributeDefinition, value);
}
}
for (Iterator<String> iterator = paymentGatewayForm.getMarketAreaAttributeMap().keySet().iterator(); iterator.hasNext();) {
String key = (String) iterator.next();
String value = paymentGatewayForm.getMarketAreaAttributeMap().get(key);
boolean success = paymentGateway.updateAttribute(key, value);
if(!success){
// ATTRIBUTE DOESN'T EXIT - ADD
AttributeDefinition attributeDefinition = attributeService.getAttributeDefinitionByCode(key);
paymentGateway.addAttribute(marketArea, attributeDefinition, value);
}
}
List<PaymentGatewayOption> availableOptions = paymentGatewayService.findPaymentGatewayOptions();