How to display the current and parent category in WordPress
Need to show the category hierarchy in your theme? Learn how to get the current category and its parent using get_the_category() and get_category_parents().
A PHP application that collects fees, fines or permits for an Italian public body does not simply call a payment gateway. It joins pagoPA, the national platform, and from that moment its data model follows pagoPA’s. I am Mariusz Szatkowski, a PHP developer in Gdynia. I work remotely and in writing, and I build the application side of such a connection or implement the design your team already has.

Photo: FrDr, licensed CC BY-SA 4.0, via Wikimedia Commons.
Every statement below comes from the pagoPA developer portal. Where the portal’s pages did not show a detail when I read them, I say so instead of guessing.
The overview page says pagoPA lets creditor bodies (enti creditori, EC) manage collections centrally. Reporting and reconciliation services come with it. A single framework agreement lets creditor bodies and payment service providers (PSP) operate on the platform.
The portal’s own page titles show a third role, the technological partner (partner tecnologico). There are separate Back Office manuals for creditor bodies, for PSPs and for technological partners, and a tutorial on how to become a technological partner. A software supplier that builds a collection system for a municipality, a chamber or a hospital trust works in that third role or on behalf of the body.
For a PHP team this means the legal and organisational set-up comes first, and the code second. The adhesion and the Back Office configuration are the body’s business. The code starts when the credentials exist.
The quick start page lists five steps for joining the new connectivity:
The page names the certificate rules. The certificate must come from a Certification Authority that is a member of the CA/Browser Forum. Its Subject CN must match the FQDN of the service URL, and the service URL has the form https://FQDN/nomeservizio. pagoPA S.p.A. may authorise other CAs or certificate types, including for the external test environment.
Steps 3 to 5 are only named on the quick start page itself. The detail sits in the guides, the API reference and the tutorials.
The connectivity appendix of the SANP guide describes two directions.
Inbound, to pagoPA. The API key goes in the header Ocp-Apim-Subscription-Key on every call. A missing, wrong or no longer valid key returns HTTP 401 from the API gateway. The keys do not expire, and a primary and a secondary key are both valid, with the primary used normally. The same procedure applies to test and production.
Outbound, from pagoPA to the participant. Mutual authentication is enabled for traffic from the Nodo dei Pagamenti, so the participant’s endpoint is a mutual TLS endpoint. The appendix requires HTTPS with TLS 1.2 or higher and x.509 certificates for the TLS channel. The platform certificate can be downloaded from the GitHub links the page gives, with one file for test (UAT) and one for production. The page lists no IP addresses and says the platform is reachable over the Internet by default.
Two PHP consequences follow. The API key belongs in the environment or a secrets store, never in the repository, and because primary and secondary keys are both valid, rotating one at a time is possible. And the outbound endpoint is a web server configuration job as much as a PHP job: the TLS client certificate check happens in the web server in front of PHP, so the application should read the verified result from the server and not parse certificates itself.
<?php
declare(strict_types=1);
// The path comes from the API reference of the API you call.
function pagopaRequest(string $url, string $method = 'GET', ?array $body = null): array
{
$headers = [
'Ocp-Apim-Subscription-Key: ' . getenv('PAGOPA_API_KEY'),
'Content-Type: application/json',
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => $method,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 15,
CURLOPT_POSTFIELDS => $body === null ? null : json_encode($body, JSON_THROW_ON_ERROR),
]);
$raw = curl_exec($ch);
$status = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($raw === false || $status === 401) {
throw new RuntimeException("pagoPA call failed, HTTP $status");
}
return ['status' => $status, 'data' => json_decode((string) $raw, true)];
}The sketch only shows where the header goes and that a 401 is a configuration error, not a retry case. Base URLs and paths for each API come from its own page in the catalogue.
The API catalogue lists 15 entries. Those a collection application is most likely to meet, with the portal’s own descriptions:
| API | What the portal says it does |
|---|---|
| GPD, debt position management | create, update, delete and retrieve debt positions with their payment options (the page is marked as GPD legacy) |
| GPD, bulk management | bulk insert, update and delete of debt positions |
| GPD, receipt retrieval | retrieve the payment receipts managed by GPD |
| Reporting flows | upload and download of reporting flows on the Nodo dei Pagamenti, for PSPs and creditor bodies |
| Payment at the creditor body front end | lets a body start a payment for a cart of up to 5 notices from its own portal |
| Receipt retrieval | retrieve receipts under the unified model if one is lost |
| Payment notice printing | self-service printing of payment notices |
| Payment options (verifyPaymentOptions) | lets a body offer several options for one notice, such as instalments or discounts, through PSPs |
| eBollo 2.0 | lets a body charge a citizen a stamp duty from its own website |
I could read the catalogue page and the titles and summaries above. The pages of the individual APIs loaded without their request and response sections when I fetched them, so I do not state field names or paths here. The reference of the chosen API is the contract.
The vocabulary matters before the code does. A creditor body records what a citizen owes as a debt position, and the notice (avviso di pagamento) is the document the citizen pays from, on paper or digitally. The notice guide says its models must be used by creditor bodies that joined pagoPA, and the URLs I read carry version 3.5.1. The guide refers to dedicated APIs for generating the notice as a PDF.
The specifications behind it are the SANP (Allegato B of the payment guidelines, the implementation specifications of the Nodo dei Pagamenti) and the SACI (Allegato A, the identification codes for payment, reversal and reporting). The SANP page shows version 3.12.1, dated 17 November 2026, and says it is read together with the SACI and the guidelines.
For the PHP data model this has a practical shape:
The portal has a tutorial for each of the reporting flows and for handling the APIs asynchronously, and I mention them because both topics decide how the queue and the reconciliation job are designed, not because I have summarised them here.
A citizen who pays at a PSP is not on your site. The result comes back to your application as a receipt. The catalogue lists receipt retrieval APIs, one of them for a receipt that was lost. I read that as a hint on how to build, and it is my reading, not a pagoPA rule: take the receipt from the platform as the normal path, and use retrieval as the repair path.
Reporting flows are the second source of truth. The portal describes them as the files on the Nodo that PSPs and creditor bodies upload and download, and it has a tutorial on what they are and how to use them correctly. A reconciliation job in PHP compares the flows with the receipts you stored. A mismatch is a ticket for a person in the accounts office, with both records attached.
A pattern that works in PHP, as engineering advice and not as a pagoPA rule:
The portal states where each question belongs. Questions about the SACI and SANP specifications go to GitHub issues on the pagopa-api repository. Support tickets are opened from the Area Riservata on the pagoPA self-care portal. The adhesion portal has its own guide.
I work from those pages in the same order a body’s IT office would. I cannot open tickets on a body’s behalf, because the Area Riservata is tied to the body’s own login.
I build the PHP side: the client above, the data model, the receipt handler, the reconciliation job, tests against the UAT environment once the body has its test credentials, and a written runbook so your own team can operate it. I work remotely, in email and shared documents, and I reply within 24 hours on working days.
I do not file the adhesion, I do not interpret what the body must collect, and I do not give legal advice. Those belong to the body and its advisers. An existing Symfony or Laravel application is welcome, and a plain PHP codebase works as well. The PHP developer page describes the general scope.
If your team plans a collection system on pagoPA, describe the body, the kinds of payment and the stack in the contact form. The first written estimate is free, and it names the APIs I would read first for your case.
Examples of my work.
The sztuczne-rosliny.pl website is a modern e-commerce platform for a company specializing in the import and distribution of high-quality artificial plants in Poland.
Innoopract is a company specializing in software and services, supporting developers and corporations in maximizing returns on investment in developer tools and platforms.
Jobsin.co is a modern job board focused on posting job offers for qualified specialists in the fields of construction, mechanics, and engineering worldwide.
Describe your project by e-mail. I reply within 24 hours.
Describe your projectNeed to show the category hierarchy in your theme? Learn how to get the current category and its parent using get_the_category() and get_category_parents().
Need to get the URL of the first image or link in an article? Prefer DOMDocument over regex. Ready-made WordPress PHP for developers.
On 1 December 2026 Taylor Otwell shipped the Laravel Rust beta, and Laravel Go followed a day later. What the framework contains, what the 18x benchmark really measures, what happens to Laravel PHP and WordPress, and when a rewrite makes sense.
Custom WordPress engineering and architecture.
Scalable headless, ERP, and AI architecture for enterprise.
Stores, checkout flow, and sales logic.
Stability, updates, and post-launch support.
What the monthly care fee covers and what changes it.
Business process automation around WordPress and company systems.
Headless WordPress, Sanity, Strapi, and Contentful with Astro or Next.js.
Astro, MDX, edge delivery, and Core Web Vitals measured on real traffic.

How to start as a WordPress developer in 2026. Local environment, theme and plugin development, REST API and headless paths, security and Core Web Vitals. A practitioner playbook that does not waste your first month.

WordPress 7.0 with AI Client against Astro 7 with the Rust compiler and Vite 8. Speed, cost, SEO and security compared, plus the real bill for my own Astro 6 to 7 migration.

A detailed comparison table of EmDash CMS and WordPress across architecture, security, plugins, AI features, content model, hosting, and ecosystem maturity.