Black Bean Shop — Getting started
Black Bean Shop — Getting started 1. Prerequisites Install and activate Black Bean Tables Seed + sync shop tables if prompted (Tables → Settings / Structure) Activate Black Bean Shop Flush permalinks…
Black Bean Shop — Getting started#
1. Prerequisites#
- Install and activate Black Bean Tables
- Seed + sync shop tables if prompted (Tables → Settings / Structure)
- Activate Black Bean Shop
- Flush permalinks (Settings → Permalinks → Save)
2. Configure payments#
PayPal (optional)#
- Open Shop → Settings
- Enable PayPal Checkout and Show PayPal at checkout as needed
- Enter PayPal client ID / secret (sandbox or live)
- Save and register the webhook URL shown in settings (live mode):
POST /wp-json/blackbean/v1/shop/paypal-webhook- Subscribe to
CHECKOUT.ORDER.APPROVEDandPAYMENT.CAPTURE.COMPLETED
MoMo (optional)#
- Open Shop → Settings → MoMo
- Enable MoMo Checkout and Show MoMo at checkout as needed
- Enter Partner Code, Access Key, and Secret Key (sandbox or live)
- Set a USD → VND fallback rate (used when the exchange-rate API is unavailable)
- Register the IPN URL in the MoMo merchant portal:
POST /wp-json/blackbean/v1/shop/momo-ipn
You can enable PayPal only, MoMo only, or both. Checkout shows a selector when more than one gateway is enabled and visible.
Store prices remain in USD. MoMo checkout converts the order total to integer VND using Open ExchangeRate-API (cached 12 hours) with admin fallback.
3. Create a product#
- Shop → Products → Add product
- Set title, price, digital flag
- Attach a download file (Media ID) or external download URL
- Optional license: prefix + max activations
- For plugin updates: fill Auto-updates (slug, version, requires WP/PHP)
4. Test the storefront#
- Visit
/products/on the front end - Add to cart → checkout
- Choose PayPal or MoMo (if both are enabled)
- Complete payment in sandbox
- Confirm order email includes license key + download link
5. License a customer site#
- Copy the license key from the order email or Shop → Licenses
- On the customer WordPress site, open the product’s License settings
- Activate the key
- Dashboard → Updates will show new versions when you publish them
6. Publish a new plugin version#
# Build ZIP
npm run release:full --prefix wp-content/plugins/blackbean-forms
# Publish to shop registry (optional automation)
node scripts/publish-release.mjs blackbean-forms --product-id=N --apply
Or manually: upload ZIP to Media → set product Download file → bump Latest version under Auto-updates.
7. Verify versions#
- Shop → Versions — code vs shop registry
- Or:
composer versions/composer versions:difffrom the site root
8. Verify product indexing#
- Open
/bb-shop-sitemap.xmland confirm the catalog and published products are listed - With Rank Math active, open
/sitemap_index.xmland confirm it references/bb-shop-sitemap.xml - After deploying a new sitemap rewrite, save Settings → Permalinks once
- If Rank Math still serves a cached index, save Rank Math → Sitemap Settings
Troubleshooting#
| Symptom | Fix |
|---|---|
404 on /products/ |
Flush permalinks |
404 on /bb-shop-sitemap.xml |
Save Settings → Permalinks to refresh rewrite rules |
| Shop sitemap missing from Rank Math | Ensure Rank Math's Sitemap module is enabled, then save its Sitemap Settings to clear the cache |
| Shop won’t load | Activate Black Bean Tables first |
| No payment methods at checkout | Enable and configure at least one gateway in Shop → Settings |
| MoMo checkout fails with rate error | Check outbound HTTPS to open.er-api.com or set a fallback USD→VND rate |
| Updates not showing | Customer license inactive, or shop version ≤ installed version |
| Download fails | Attach Media ID on the product, re-fulfill order if needed |