# ivyforms/1.5.1/backend/src/Controllers/Square/SquareLocationsController.php

The Innovative Form Builder – IvyForms, version 1.5.1. 30 lines.

- Page: https://pluginprobe.com/plugins/ivyforms/1.5.1/code/backend/src/Controllers/Square/SquareLocationsController.php
- Raw: https://pluginprobe.com/plugins/ivyforms/1.5.1/raw/backend/src/Controllers/Square/SquareLocationsController.php
- Modified: 2026-10-05T14:37:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ivyforms/1.5.1/code/backend/src/Controllers/Square/SquareLocationsController.php#L10-L20`.

```php
<?php

namespace IvyForms\Controllers\Square;

use IvyForms\Common\Sanitizer\Sanitizer;
use IvyForms\Controllers\Controller;
use IvyForms\Services\Payment\SquarePaymentService;
use IvyForms\Services\Translations\BackendStrings;
use WP_REST_Request;
use WP_REST_Response;

class SquareLocationsController extends Controller
{
    private SquarePaymentService $squarePaymentService;

    public function __construct(SquarePaymentService $squarePaymentService)
    {
        $this->squarePaymentService = $squarePaymentService;
    }

    public function handle(WP_REST_Request $data): WP_REST_Response
    {
        Sanitizer::verifyNonce($data->get_header('X-WP-Nonce'));

        $locations = $this->squarePaymentService->getLocations();

        return new WP_REST_Response(['locations' => $locations], 200);
    }
}

```
