=== Sell BTC by Hayyat Apps — Cryptocurrency Exchange & Ordering ===
Contributors: hayyatapps
Author URI: https://hayyatapps.com
Plugin URI: https://hayyatapps.com/sell-btc-by-hayyatapps/
Tags: cryptocurrency, bitcoin, exchange, woocommerce, calculator
Requires at least: 5.5
Tested up to: 7.0.2
Requires PHP: 7.4
Stable tag: 2.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Turn WooCommerce into a crypto exchange: a live conversion calculator with your own rates, markup, fees and rate-locked orders.

== Description ==

**Sell BTC by Hayyat Apps** turns your WooCommerce store into a cryptocurrency exchange desk — the kind of "send one currency, receive another" service you see on sites that buy and sell Bitcoin. You do not need to be a trader or a developer to run it.

Here is what your visitors see: a calculator with two boxes. In the first box they choose what they want to send (for example Bitcoin) and type an amount. In the second box they choose what they want to receive (for example Ethereum, or a normal currency like US Dollars). The plugin instantly shows them a live conversion, your fees, and the final amount they will get. When they are happy, they press a button and check out through your normal WooCommerce payment methods.

Here is what **you** control from the WordPress admin: which currencies are offered, whether their prices update automatically or are set by hand, how much profit (markup) you add on top of the market price, what fees you charge, and the minimum/maximum amount per order. Every order lands in a dashboard where you can approve payment proof, mark it paid or completed, add a transaction hash and export everything to CSV.

Live prices are fetched from CoinMarketCap through a secure service on our own server. Your price key and pricing logic never reach the visitor's browser, and your customers' wallet, bank and contact details are never sent to CoinMarketCap.

**What the plugin can do**

* A responsive exchange calculator you drop on any page with the shortcode `[happs_sbtc_exchange_calculator]` or the "Exchange Calculator" block. It has a swap button, a live conversion summary, a fee breakdown, and a countdown that locks the rate for a short time.
* Offer as many cryptocurrencies **and** normal (fiat) currencies as you like — import the top coins in one click, or add any currency by searching for it.
* Choose per currency whether the price updates **automatically** from the live market, or is a **fixed price you type in yourself** (manual mode).
* Add your own **markup** (your profit) on the buy side and the sell side of every currency.
* Charge a **fixed fee**, a **percentage fee**, and a separate **transfer fee** (to cover the network / payout cost) — and decide whether fees are taken from the amount sent or the amount received.
* Set a **minimum and maximum** order size per currency and globally.
* Check out as a normal WooCommerce order, with the rate re-checked on the server before the order is placed so nobody can lock in a stale price.
* An **order dashboard** with filters, a status workflow, staff assignment, transaction hash, profit tracking and CSV export.
* Secure **proof-of-payment** uploads that customers submit and you approve or reject.
* A customer **"My Exchanges"** dashboard: order history, status, payment instructions, proof upload, PDF receipt and a one-click repeat exchange.
* A reusable, encrypted **wallet / bank address book** for your customers.
* **Coupons** made just for exchanges (fee discounts, free fees, better rates) that stay separate from your normal WooCommerce coupons.
* Downloadable **PDF receipts** created without any external library, so they work on ordinary shared hosting.
* **Editable labels** and email notifications for every step, full translation support, and privacy (export/erase) tools.

**Security**

The plugin uses multiple security layers to protect your site and customer data. It verifies licenses securely, checks every request and user permission, encrypts sensitive data, validates uploaded files, uses safe database queries, and helps prevent common attacks such as CSRF, XSS, SQL injection, and unauthorized access.

== Installation ==

1. Install and activate **WooCommerce** (needed for checkout and orders).
2. Install this plugin from **Plugins → Add New**, or upload the ZIP via **Plugins → Add New → Upload Plugin**, or copy the folder to `/wp-content/plugins/`.
3. Activate it through the **Plugins** menu. A few popular currencies are imported for you automatically.
4. Open **Sell BTC → Currencies** and add or import the currencies you want to offer.
5. Set prices on the **Rates** tab and fees on the **Fees** tab.
6. Put `[happs_sbtc_exchange_calculator]` on any page (or add the **Exchange Calculator** block) and preview it.

== Frequently Asked Questions ==

= What is this plugin, in plain words? =
It lets you run an online "money changer" for cryptocurrency on your WordPress site. A visitor chooses a currency to give you and a currency to get back, sees a live price with your fees, and pays through your normal checkout. You approve the order and send them what they bought. You do not need any trading experience to set it up.

= Which admin menu do I use for what? =
Everything lives under the **Sell BTC** menu in your WordPress sidebar:
* **Dashboard** — a quick overview of your exchange activity.
* **View Orders** — every exchange order, with filters and status changes.
* **Currencies** — this opens a set of tabs: **Currencies** (which coins/currencies you offer), **Rates** (the prices and your markup), **Fees** (what you charge), and **Payment Instructions** (what the customer is told to do to pay you).
* **Customers** — the people who have placed exchange orders.
* **Reports** — totals and profit over time.
* **Settings** — this also opens tabs: **General** (calculator options like the fee breakdown), **Labels** (change any wording on the calculator), **Email Templates**, **Coupons**, and **Security**.
* **License** — activate Pro on this site.

= How do I show the calculator on a page? =
Create or edit a page and either paste the shortcode `[happs_sbtc_exchange_calculator]` into it, or add the **Exchange Calculator** block from the block inserter. Publish the page and the live calculator appears. You can place it on as many pages as you like.

= How do I add a currency (including one that is not in the list)? =
Go to **Sell BTC → Currencies** and open the **Currencies** tab. Click **Add / Import** and type the name or symbol of any coin (for example "Solana" or "SOL") or a normal currency (for example "Euro" or "EUR") into the search box. Pick it from the results and it is added to your list. Use the **Enable** switch to make it live, and the **Buy** / **Sell** toggles to control whether customers can *receive* it (buy) or *send* it (sell). You can offer both cryptocurrencies and everyday currencies like USD, EUR or GBP side by side.

= How do I set exchange rates? What is the difference between automatic and manual? =
Open **Sell BTC → Currencies → Rates**. Each currency has a **rate mode**:
* **Automatic** — the plugin keeps that currency's price up to date from the live market (CoinMarketCap) for you. Best for cryptocurrencies whose price moves all the time. You do not type a price; you only add your markup.
* **Manual** — you type the price yourself and it never changes until you change it. Best when you want a fixed rate, or for a currency you price by hand.
Pick automatic for a "set it and forget it" live price, or manual when you want full control.

= How do I add my profit (markup)? =
Still on the **Rates** tab, each currency has a **buy markup** and a **sell markup**, entered as a percentage. This is added on top of the market price so you earn a margin on every exchange. For example, a small buy markup means customers pay slightly more than the raw market price when they receive that currency — that difference is your profit. Set it to 0 if you want to match the market exactly.

= How do I set fees? =
Go to **Sell BTC → Currencies → Fees**. For each currency you can set:
* a **fixed fee** (a flat amount in that currency),
* a **percentage fee** (a share of the amount), and
* a **transfer fee** (to cover the network or payout cost when you send the coins).
At the top of the same tab, **"Fee charged in"** decides whether fees are taken from the currency being **sent** or the one being **received**, and **"Fee handling"** decides whether the fee is added to what the customer pays or deducted from what they receive. You can also set a **minimum** and **maximum** order size here. Every fee is expressed in that row's own currency.
**Important:** the Fees tab has a **Save** button at the bottom — your changes are only stored after you click it.

= Can I change how fees are shown to the customer? =
Yes. Go to **Sell BTC → Settings → General**. You can show a detailed fee breakdown, hide the small "(0.0005 BTC + 5%)" detail, or show only a single "Total Fees" line — whatever suits your store.

= Is WooCommerce required? =
Yes for checkout and orders. The admin, currencies, rates, fees and settings all work without it, but the "Proceed to Checkout" button only becomes active once WooCommerce is installed and active.

= Where do the live prices come from? =
From CoinMarketCap, fetched through a secure service on our server. Your price key stays on the server and is never exposed to your visitors, and your customers' personal details are never sent to the price provider.

= What does a customer actually do to complete an exchange? =
They enter an amount, review the live quote and fees, press **Proceed to Checkout**, and pay through your normal WooCommerce payment methods. After paying they can upload proof of payment. You review the order in **View Orders**, approve it, and mark it completed once you have sent them the currency they bought. They can download a PDF receipt from their **My Exchanges** page.

= What is included in the free version? =
Every install begins with a 7-day free trial of all Pro features. When the trial ends the plugin switches to the Free plan, which is a live conversion calculator only: visitors can see real-time conversions with your rates and fees, but WooCommerce checkout and order creation are turned off. On the Free plan you keep the currencies the plugin installed by default, but adding new currencies is disabled and the Rates and Fees tabs become read-only. A small "Powered by" credit is shown on the calculator. Activate a Pro license (Annual or Lifetime) to unlock checkout and ordering, add unlimited currencies, edit rates and fees, remove the branding, and get full customer and payment data with CSV export. Any currencies you added during the trial are re-enabled automatically when you activate a license.

= Do the PDF receipts need extra software? =
No. Receipts are created by a built-in, dependency-free writer that works on typical shared hosting — nothing to install.

= Can I translate or reword the calculator? =
Yes. Every visible label can be edited under **Sell BTC → Settings → Labels**, and the plugin is fully translation-ready for use with any WordPress translation tool.

== Screenshots ==

1. Front-end exchange calculator with live quote and rate-lock countdown
2. Admin dashboard showing summary and profit tracking
3. Manage Currencies, rates and fees management
4. Add more currencies
5. Fees & Limits
6. General Settings for brand color and quote
7. Cusomize Labels
8. Cusomize Transactional Emails