# ivyforms/1.5/backend/src/Controllers/Payment/GetPaymentController.php

The Innovative Form Builder – IvyForms, version 1.5. 34 lines.

- Page: https://pluginprobe.com/plugins/ivyforms/1.5/code/backend/src/Controllers/Payment/GetPaymentController.php
- Raw: https://pluginprobe.com/plugins/ivyforms/1.5/raw/backend/src/Controllers/Payment/GetPaymentController.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/code/backend/src/Controllers/Payment/GetPaymentController.php#L10-L20`.

```php
<?php

namespace IvyForms\Controllers\Payment;

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

class GetPaymentController extends Controller
{
    private PaymentManager $paymentManager;

    public function __construct(PaymentManager $paymentManager)
    {
        $this->paymentManager = $paymentManager;
    }

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

        $payment = $this->paymentManager->getPaymentByEntryId($entryId);

        return new WP_REST_Response([
            'message' => BackendStrings::getCommonStrings()['ok'],
            'data' => $payment ? $payment->toArray() : null,
        ], 200);
    }
}

```
