Need some help on Checkout page

Hi to all!
I am trying to create a payment plugin for ShopWare 6 and I am stuck when try to get the Shipping and the Billing address.
I know I am new in Shopware development, but few directions will be very helpful.
So, I am on the Checkout page and have access to the Cart and Shopware\Core\Framework\Context. From the Cart I can see the delivery address calling:


but from this result I can not get the address details.
The second problem is I can not get the Billing address. Looks like it is not into the Cart. I tried to use the Customer object, but if the Customer has more than one address I always get the first one.


PS - OK from the delivery address I got the first one, then got the customer id and did what I guy suggested into StackOverflow:

$criteria = (new Criteria())
            ->addFilter(new EqualsFilter('id', $first_address->getCustomerId()))
$customer_data = $this->customerRepository->search($criteria, $this->context);

but this is still not the active address. Into the admin my user has selected another address.

Looks like I will answer to myself.
Into the Cart there is defaultShippingAddresId and defaultBillignAddressId, with them and the customerId I can get the correct addresses from address repository.
I hope this will help someone else.


The SalesChannelContext has a customer entity. If a customer is logged in then you can access to activeBillingAddress or activeShippingAddress.