=== CIHWEB Anywhere Cart ===
Contributors: cihweb
Tags: payments, ecommerce, bank transfer, stripe, jpyc
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.28.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a buy button to any post or page. Take bank transfer, JPYC and Stripe payments with no shopping cart. One product, one sales page, one QR code.

== Description ==

CIHWEB Anywhere Cart lets you place a **buy button anywhere** in an existing WordPress post or page. You do not rebuild your site as a shop.

Register one product and you get a **dedicated sales page URL** and a **QR code** for that single product. Share the URL, or drop a block or shortcode below an article and that article becomes the sales page. Buyers check out **without creating an account**.

This is not a full shopping cart. One order buys **one product** (quantity and quantity-discounts are supported). For a set, register a single "set" product. If you need a real multi-product cart, a full e-commerce plugin is a better fit. CIHWEB Anywhere Cart is "a quiet payment window you can place in the middle of an article."

**Payment methods (each is off by default; the owner turns on what they need)**

* **Bank transfer** — no approval and no external sign-up. Works today. Order → you receive it → confirm the deposit → mark as paid → the buyer gets a thank-you mail.
* **Stripe (credit card)** — standard hosted checkout. The buyer pays on Stripe's own page; card numbers never pass through your site. Payment is confirmed automatically by webhook. Requires your Stripe API key.
* **JPYC (stablecoin on Polygon, via CIHPAY)** — enabled by pasting a shop configuration issued by CIHWEB.

**Highlights**

* A single product becomes a sales page, a block, shortcodes and ad-sized banners (728x90 / 300x250, etc.).
* "Returned from the payment page" does not mean "paid." Returned orders are marked *pending*; the deposit is confirmed by webhook or by the owner. The same notification arriving many times still marks paid and sends mail **only once** (idempotency key).
* Legal pages (Specified Commercial Transactions Act notice, Terms, Privacy Policy) are generated for you — no need to build static pages.
* A built-in contact form, with spam protection that uses **no external service and no CAPTCHA**.
* Postal-code to address auto-fill for Japan, using **bundled data — no external lookup service**.
* QR codes are generated **inside the plugin** (no external image service).
* An "Ask AI how to use it" screen: copy a help prompt to paste into ChatGPT or Claude.

Order status is shown as a simple to-do list (confirm the transfer / ship it / done).

== External services ==

This plugin connects to outside services **only when the store owner enables the matching payment method**. Every payment method is off by default. No data is sent unless a customer actually chooses that method.

**Stripe (credit-card payments) — optional**
When Stripe is enabled and a customer chooses to pay by card, the plugin creates a Checkout Session by sending the order amount, an order reference and the product name to the Stripe API (https://api.stripe.com). The customer is then redirected to Stripe's hosted checkout page (https://checkout.stripe.com) to enter card details; card numbers never pass through your site. Payment is confirmed back to your site by a Stripe webhook, whose signature the plugin verifies. Your own Stripe secret key and webhook signing secret are required.
Provider: Stripe, Inc. — Terms: https://stripe.com/legal — Privacy: https://stripe.com/privacy

**CIHPAY / JPYC (stablecoin payments on Polygon) — optional**
When JPYC is enabled and a customer chooses it, the plugin sends the order amount, an order reference and the return URL (HMAC-signed with your shop secret) to the CIHPAY gateway (https://cih-pay.com) and redirects the customer there to pay. Payment is confirmed back by a signed webhook. A shop configuration issued by CIHWEB is required.
Provider: CIH GK (CIHWEB) — Site: https://cih-web.com

**Japan Post postal-code data — optional, only on demand**
Postal-code lookups use data bundled with the plugin; no external service is contacted for a lookup. Only if the owner clicks "Import from Japan Post" does the plugin download the latest ken_all postal-code file from Japan Post (https://www.post.japanpost.jp). Nothing is uploaded; it only downloads that file.
Provider: Japan Post Co., Ltd. — Site policy / terms: https://www.post.japanpost.jp/sitepolicy.html — Privacy: https://www.post.japanpost.jp/privacy/

**Trademarks**
"JPYC" is a registered trademark of JPYC Inc. "Stripe" is a trademark of Stripe, Inc. This plugin is not provided, endorsed by, or affiliated with JPYC Inc. or Stripe, Inc.; those names are used only to describe the payment methods this plugin can connect to.

== Installation ==

1. Upload the plugin to `wp-content/plugins/` (or install the ZIP from Plugins → Add New), then activate it.
2. Go to **CIHWEB Anywhere Cart → First-time setup** and work down the list (shop name, notification email, bank details, etc.).
3. Add one product (**CIHWEB Anywhere Cart → Add product**) and publish it.
4. Place a test order yourself and check that the confirmation mail arrives.

Bank transfer needs no approval and no external account — you can accept orders the same day. Your site must be served over HTTPS for Stripe and JPYC.

== Frequently Asked Questions ==

= Do I need a shopping cart? =
No. This plugin has no cart. One order buys one product. Register a "set" product to sell several items together. Quantity discounts for the same product are supported.

= Is a payment gateway required to start? =
No. Bank transfer works with no external sign-up. Stripe and JPYC are optional and off until you enable them.

= Where do customers enter their card number? =
On Stripe's own hosted checkout page (checkout.stripe.com). Card numbers never pass through your site, which keeps your PCI scope minimal.

= Does the postal-code lookup send data to an outside service? =
No. The lookup uses data bundled with the plugin and runs entirely on your site. Only an explicit "Import from Japan Post" click downloads an updated data file.

= Does the plugin send order or customer data to an AI? =
No. The "Ask AI" screen only gives you a help text to copy; the plugin does not send your orders or customer data anywhere.

= Are the generated legal pages legal advice? =
No. They are templates. Review them for your business and consult a professional where needed before publishing.

== Screenshots ==

1. Product edit screen — name, price, images, shipping on/off, and optional per-product fields.
2. The auto-generated single-product sales page with the purchase form.
3. Stripe hosted checkout (card entry happens on Stripe, not on your site).
4. Orders shown as a simple to-do list (confirm transfer / ship / done).
5. Payment and store settings, including the Stripe and JPYC connection fields.

== Changelog ==

= 0.28.5 =
* Renamed the plugin to "CIHWEB Anywhere Cart" for the WordPress.org directory (distinctive name using the author's own brand).

= 0.28.3 =
* All page CSS/JS is now enqueued (no inline script/style); postal-code import uses wp_handle_upload; added Japan Post terms/privacy links and a trademark note.

= 0.28.2 =
* WordPress.org review fixes: replaced move_uploaded_file() with wp_handle_upload() for the postal-code import, and removed the unused Domain Path header.

= 0.28.1 =
* Coding-standards tidy-up for the WordPress.org plugin review (input unslashing).

= 0.28.0 =
* On the storefront, the Terms / Legal / Privacy links (in the purchase form and footer) now open in a closeable overlay so buyers don't lose their place.

= 0.27.4 =
* The product "View sales page" preview now also opens in the closeable overlay (shared with the legal-page preview).

= 0.27.3 =
* The legal-page "open to check" buttons now preview in an overlay you can close, instead of navigating away.

= 0.27.2 =
* Fixed: the postal-code test box in settings now shows the town name too, matching the purchase form.

= 0.27.1 =
* Clearer wording for the optional referral/credit setting (enter your CIHWEB referral code).

= 0.27.0 =
* Optional "Powered by" credit link on sales pages (off by default; nofollow sponsored) with a referral code.

= 0.26.1 =
* Minor input-sanitization tidy-up for coding-standards compliance.

= 0.26.0 =
* Prepared for the WordPress.org directory: English readme, GPLv2 license headers, `uninstall.php`, and external-service disclosure.

= 0.25.0 =
* Stripe credit-card payments via Stripe's standard hosted Checkout. The plugin creates a Checkout Session and receives payment confirmation through a signature-verified webhook; card data never touches the site.

= 0.24.0 =
* First Stripe integration groundwork (later replaced by the hosted-checkout approach in 0.25.0).

= 0.23.0 – 0.23.1 =
* Per-product custom input fields (preferred date, size, gift wrapping, etc.), with an in-editor "how to write it" help popup. Updated the built-in AI help document.

= 0.22.0 – 0.22.2 =
* Pay-what-you-want / donation mode (set price to 0): a large amount field with quick-amount buttons.

= 0.21.0 =
* Product structured data (schema.org/Product JSON-LD) on sales pages for search engines.

= 0.20.0 =
* Five selectable card skins for the purchase card.

= 0.18.0 – 0.18.1 =
* Landing-page product type with embedded call-to-action banners; safer activation (rewrite rules are only flushed when they actually change).

= 0.13.0 – 0.13.2 =
* Up to three shipping carriers with tracking links; JPYC connection values are set by pasting the shop configuration rather than typed by hand.

= 0.12.0 – 0.12.3 =
* Bundled Japan postal-code data (prefecture, city and town) with fast local lookup and no external service.

= 0.7.0 – 0.11.1 =
* Auto-generated legal pages, contact form, postal-code auto-fill, self-generated QR codes, and an admin home dashboard.

= 0.2.0 =
* Core rewrite: products, orders, price snapshots, tax and shipping, the pre-purchase confirmation screen, bank-transfer flow, and the webhook receiver.

= 0.1.0 =
* First release.

== Upgrade Notice ==

= 0.26.0 =
Adds Stripe hosted-checkout card payments and prepares the plugin for the WordPress.org directory. Existing bank-transfer and JPYC settings are unchanged.
