# Changelog

All notable changes to Black Bean Shop are documented here.

## [0.2.0] — 2026-07-17

### Added

- Optional **MoMo Payment Gateway v2** (`payWithMethod`) alongside PayPal — enable either or both independently in Shop → Settings
- Payment gateway registry and checkout dispatcher: single gateway auto-selected; multiple gateways show a radio selector at checkout
- USD → VND conversion for MoMo via Open ExchangeRate-API (12-hour cache, last-known-good, admin fallback rate)
- Order payment audit fields: `payment_method`, provider reference, charged amount/currency, FX rate snapshot
- MoMo IPN endpoint: `POST /wp-json/blackbean/v1/shop/momo-ipn` — signature verification + server-side query before fulfillment
- Admin order detail shows gateway, charged amount, provider ref, and FX snapshot

### Changed

- Checkout POST accepts `payment_gateway`; free orders still fulfill without a gateway
- PayPal and MoMo each have separate **Enable** and **Show at checkout** toggles
- Schema v2.2.0 adds payment columns to orders (auto-upgrade on init)

## [0.1.9] — 2026-07-17

### Fixed

- `/bb-shop-sitemap.xml` returned 404 when Rank Math is active: its generic `*-sitemap.xml` rewrite intercepted the URL before the plugin's own rule. The sitemap is now served through a native Rank Math provider (`bb-shop` type), which also adds it to `sitemap_index.xml` with `lastmod`
- Rank Math's sitemap file cache is invalidated when products are created, updated, or deleted

## [0.1.8] — 2026-07-17

### Added

- Product XML sitemap at `/bb-shop-sitemap.xml` (published products + catalog archive)
- Rank Math integration: shop sitemap is appended to the `sitemap_index.xml`
- WP core sitemap provider (`bbshop`) when core sitemaps are enabled

## [0.1.7] — 2026-07-16

### Added

- Product auto-update channel for licensed sites (`POST /updates/check`, `GET /updates/download`, `GET /updates/manifest/{slug}`)
- Shop → Versions admin overview (code catalog vs shop registry)
- Shared `license-client/` updater (`Blackbean_Updater`) for customer plugins/themes
- Product admin fields: update slug, type, latest version, requires WP/PHP, changelog
- Distribution bootstrap (`inc/blackbean-distribution.php`) for customer release ZIPs

### Changed

- Release packaging can bake `update-config.php` + copy `license-client/` into distributable ZIPs

## [0.1.0] — Initial

### Added

- Products, cart, checkout, and orders on Black Bean Tables (no WooCommerce)
- PayPal checkout + webhook fulfillment
- Digital downloads with tokenized links
- License keys with activate / deactivate / check REST API
- Shop admin: Products, Orders, Licenses, Settings
