← 所有集成在 GitHub 查看源代码 →
Tier 2 — Full Deakee partner
WooCommerce
WordPress + WooCommerce
A drop-in WordPress plugin that runs your loyalty program end-to-end inside WooCommerce. Customers earn points on every order (centralized — stored in your DB). At any time they can connect their Deakee wallet and bridge points on-chain to trade across the Deakee network — and bring them back when they want to spend at your store again.
Download
Upload via WordPress → Plugins → Add New两种集成模式
同一插件代码支持两种模式。今天先以 OAuth2 模式启动;日后通过配置切换加入桥接层 — 无需数据迁移。
OAuth2 模式
计划中你的数据库中维护中心化忠诚度,通过 OAuth2 同步到 Deakee。不上链、不进交易所 — 但客户可在 Deakee 中查看余额,你可接受 Deakee 凭证。
- 对接当前的 deakee.com/api/oauth/* 后端。
- 无代币、无作为发行者的法律风险。
- 通过配置切换即可升级到桥接模式。
桥接模式
计划中部署 ERC-8063 合约;客户可将中心化余额铸造为链上代币,并在 Deakee 交易所交易。
- 增加交易所上市和跨品牌兑换。
- 需要 Deakee 中继器(尚未发布)。
- 与 OAuth2 模式同一套插件代码 — 准备好时再启用。
安装
- Download the plugin zip (or clone from GitHub).
- Upload via WordPress → Plugins → Add New → Upload Plugin → activate.
- WooCommerce → Deakee Loyalty: set earn rate, redemption rules, and paste your Deakee partner API key.
- Click "Deploy My Token" to create your brand's ERC-8063 contract on Sepolia (one-time).
- Done — customers earn on every order; the "Send to Deakee" button shows up in their account page for bridging.
示例
// Earn is centralized — no chain involvement:
add_action('woocommerce_order_status_completed', function($order_id) {
$order = wc_get_order($order_id);
$points = DeakeeLoyalty::computePoints($order->get_total_cents());
DeakeeLoyalty::members()->credit(
$order->get_user_id(),
$points,
"wc_order_$order_id",
);
});
// Bridge is user-initiated — fires only when the customer
// clicks "Send N points to my Deakee wallet" in their account:
DeakeeLoyalty::bridge()->withdraw($user_id, $amount);Deakee 如何连接到你的插件
你的合作伙伴 API 密钥用于向 Deakee 中继器认证调用。OAuth2 authorize/token URL 每个客户使用一次,用于获取钱包地址(范围:仅 identity)。
| authorize_url | https://deakee.com/oauth2/authorize (scope=identity, one-time wallet link) |
| token_url | https://deakee.com/oauth2/token |
| api_base_url | https://deakee.com/api/relayer/v1 (mint, burn, deploy) |
验证合规性
上线前,针对你的部署运行官方一致性验证器。它会检查中心化账本、identity OAuth 流程、桥接铸造/销毁连接以及幂等性。
npx @deakee/loyalty-verifier \
--partner-api-key <your key> \
--plugin-url <your plugin URL> \
--contract-address <your ERC-8063 contract> \
--test-user-email test@example.com遇到问题?阅读完整的 README 或在 github.com/deakee/loyalty/issues 提交 issue。