// Array with meta tag data $metaData = array( "" => array( "title" => "Online Payment System | Connecting Payment Systems and Banks Without Fees.", "description" => "Tegro.money offers advantageous tariff plans for online acquiring with a variety of payment acceptance methods. Register and start accepting payments today!", "keywords" => "tegro, online cash register, internet acquiring, payment acceptance, fund withdrawal, acquiring, card payment, online payment, online payment through internet, tegro.money" ), "referral-program" => array( "title" => "Referral Program | Online Payment System - Tegro.Money", "description" => "Invite acquaintances and friends – earn a percentage of their turnover. A unique opportunity for additional income from invited users.", "keywords" => "tegro, online cash register, internet acquiring, partnership, referral" ), "security" => array( "title" => "Security | Online Payment System - Tegro.Money", "description" => "We use PCI DSS security standard, SSL protocol, Verified by Visa and MasterCard SecureCode security systems.", "keywords" => "" ), "pricing" => array( "title" => "Tariffs | Online Payment System - Tegro.Money", "description" => "Payments for your customers will become simpler and more accessible, and more profitable for you.", "keywords" => "" ), "coupons" => array( "title" => "Discounts and Coupons | Online Payment System - Tegro.Money", "description" => "Payments for your customers will become simpler and more accessible, and more profitable for you.", "keywords" => "" ), "advantages" => array( "title" => "Our Advantages | Online Payment System - Tegro.Money", "description" => "Utilize all the features of Tegro.money service.", "keywords" => "" ), "policy" => array( "title" => "Personal Data Processing Policy | Tegro.Money", "description" => "Tegro.Money prioritizes compliance with and protection of its clients' interests.", "keywords" => "" ), "offer" => array( "title" => "Public Offer for Agreement on Use of Tegro.Money Service", "description" => "Agreement on Use of Tegro.Money Service", "keywords" => "" ), "contacts" => array( "title" => "Contacts | About Tegro.Money Company", "description" => "We are a modern IT company that provides services for electronic payments on the internet and beyond.", "keywords" => "" ), "docs/en/" => array( "title" => "Documentation and API | Tegro.Money", "description" => "Tegro.money API allows you to accept payments, process refunds, check transaction statuses, and much more. To use the API, you'll need to have a store in our system.", "keywords" => "" ) ); // Get the current page's name $current_page = basename($_SERVER['REQUEST_URI'], ""); // Check if there's data for the current page in the $metaData array if (array_key_exists($current_page, $metaData)) { $title = $metaData[$current_page]["title"]; $description = $metaData[$current_page]["description"]; $keywords = $metaData[$current_page]["keywords"]; } else { // If data is absent, set default values $title = "Online Payment System"; $description = "Tegro.money offers advantageous tariff plans for online acquiring with a variety of payment acceptance methods."; $keywords = "tegro, online cash register, internet acquiring, payment acceptance, fund withdrawal, acquiring, card payment, online payment, online payment through internet, tegro.money"; } ?>

WordPress — a payment plugin built by AI

A prompt for ChatGPT / Claude. It generates a plug-and-play WordPress plugin that adds a [tegro_pay amount="500" desc="..."] shortcode — so you can drop a payment button into any page or post.

Prompt

Paste it into ChatGPT / Claude. The reply will be the full plugin code.

Create a WordPress plugin "Tegro.Money Pay" — a single PHP plugin file (a .zip archive is fine).

Functionality:
1) Registers a settings page in the WordPress admin (Settings → Tegro.Money) with fields:
   - Shop ID (text)
   - API Key (password)
   - Test mode (checkbox — while enabled, send orders flagged as "test")
2) Adds a shortcode [tegro_pay amount="500" desc="Product description" currency="RUB"]
   — renders a "Pay" button on the page.
   On click it makes an AJAX request to admin-ajax.php?action=tegro_create_order,
   and the server-side function:
   - Reads shop_id and api_key from settings
   - Builds the body: {shop_id, nonce: wp_generate_uuid4(), currency, amount, order_id: wp_generate_uuid4(), description}
   - body_string = wp_json_encode(body)
   - sign = hash_hmac('sha256', body_string, $api_key)
   - HTTP POSTs to https://tegro.money/api/createOrder/ via wp_remote_post, with header Authorization: Bearer <sign>
   - the request body is EXACTLY body_string (do NOT json_encode it again)
   - Parses the response. If type=success — returns data.url. Otherwise — an error.
3) Page-side JS — after the response, does window.location.href = data.url.
4) Registers a POST /wp-json/tegro/v1/notify endpoint to receive the webhook from Tegro.Money:
   - Parses the form-urlencoded body
   - Verifies the signature per the docs at https://tegro.money/docs/en/payments/notify/
   - Stores the order in a custom post type "tegro_order" with its status
5) In the admin — Tegro.Money → Orders, a table of all received payments.

Requirements:
- Compatible with WordPress 6.x and PHP 8.1+
- No third-party Composer dependencies (WordPress functions + PHP core only)
- i18n-ready (text domain 'tegro-money')
- README.txt in wordpress.org format
- Security: nonce check in the admin, sanitize all POST input, escape all output
- No eval / curl_exec — wp_remote_post only

File structure:
tegro-money-pay/
├── tegro-money-pay.php          (main plugin file)
├── README.txt
├── includes/
│   ├── class-admin.php
│   ├── class-shortcode.php
│   ├── class-api.php             (Tegro API calls + HMAC sign)
│   └── class-webhook.php
└── assets/
    └── pay.js

At the end, give instructions on how to package it into a zip and install it.

After it's generated

  1. Save the files into wp-content/plugins/tegro-money-pay/ on your WordPress install.
  2. In the admin: Plugins → Activate "Tegro.Money Pay".
  3. Settings → Tegro.Money — paste your Shop ID and API Key from your merchant cabinet.
  4. Enable test mode until your first live payment.
  5. Drop [tegro_pay amount="500" desc="Subscription"] into any page or post.
  6. In the shop settings, set notify_url = https://<your-site>/wp-json/tegro/v1/notify.
Not a vibe-coder? Once the AI generates the code, ask it to bundle everything into a single .zip archive — then install it through the standard WordPress installer.