We would like to fetch the payment configuration from Order in Java class (OrderBO extension). So far we have managed to fetch the service like this:

```
final OrderBOPaymentExtension<OrderBO> paymentExtension = getExtendedObject().getExtension(OrderBOPaymentExtension.EXTENSION_ID);

final PaymentBO paymentBO = paymentExtension.getPaymentBOs().stream().findFirst().orElse(null);

PaymentServiceBO paymentServiceBO = paymentBO.getPaymentServiceBO();

```

Now we need to fetch the configuration, so we can read certain configuration parameters from the payment method. What is the best way to do that?

We know it is possible to fetch the payment configuration through the PO Factory like this:

```
PaymentConfigurationPOFactory f = (PaymentConfigurationPOFactory)NamingMgr.getInstance().lookupFactory(PaymentConfigurationPO.class);
PaymentConfigurationPO r = f.getConfigForIDAndDomain(iD, domain);

```

But we would like to avoid using deprecated code.

UPDATE:
What we are trying to achieve is access these BO parameters in Java code:

[![enter image description here](https://i.stack.imgur.com/Tyklr.png)](https://i.stack.imgur.com/Tyklr.png)