<?php

declare (strict_types=1);
namespace DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Service\Ucp\Discovery;

use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Service\Ucp\Enums\UcpVersion;
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Service\Ucp\Integration\WcPaymentConfigProvider;
/**
 * Builds the /.well-known/ucp JSON response document.
 */
final class DiscoveryResponseBuilder
{
    private WcPaymentConfigProvider $wc_payments;
    public function __construct(WcPaymentConfigProvider $wc_payments)
    {
        $this->wc_payments = $wc_payments;
    }
    /** @return array<string, mixed> */
    public function build(): array
    {
        $endpoint = \untrailingslashit(\rest_url('ucp/v1'));
        return ['ucp' => ['version' => UcpVersion::CURRENT, 'services' => ['dev.ucp.shopping' => [['version' => UcpVersion::CURRENT, 'spec' => 'https://ucp.dev/specification/overview', 'transport' => 'rest', 'endpoint' => $endpoint, 'schema' => 'https://ucp.dev/' . UcpVersion::CURRENT . '/services/shopping/openapi.json']]], 'capabilities' => ['dev.ucp.shopping.checkout' => [['version' => UcpVersion::CURRENT, 'spec' => 'https://ucp.dev/specification/checkout', 'schema' => 'https://ucp.dev/' . UcpVersion::CURRENT . '/schemas/shopping/checkout.json']], 'dev.ucp.shopping.fulfillment' => [['version' => UcpVersion::CURRENT, 'spec' => 'https://ucp.dev/specification/fulfillment', 'schema' => 'https://ucp.dev/' . UcpVersion::CURRENT . '/schemas/shopping/fulfillment.json', 'extends' => 'dev.ucp.shopping.checkout']], 'dev.ucp.shopping.discount' => [['version' => UcpVersion::CURRENT, 'spec' => 'https://ucp.dev/specification/discount', 'schema' => 'https://ucp.dev/' . UcpVersion::CURRENT . '/schemas/shopping/discount.json', 'extends' => 'dev.ucp.shopping.checkout']], 'dev.ucp.shopping.order' => [['version' => UcpVersion::CURRENT, 'spec' => 'https://ucp.dev/latest/specification/order', 'schema' => 'https://ucp.dev/' . UcpVersion::CURRENT . '/schemas/shopping/order.json']], 'dev.ucp.shopping.buyer_consent' => [['version' => UcpVersion::CURRENT, 'spec' => 'https://ucp.dev/specification/buyer-consent', 'schema' => 'https://ucp.dev/' . UcpVersion::CURRENT . '/schemas/shopping/buyer_consent.json', 'extends' => 'dev.ucp.shopping.checkout']]], 'payment_handlers' => $this->wc_payments->get_google_pay_handler()]];
    }
}
