[WordPress] 外掛分享: Dotix

前言介紹

  • 這款 WordPress 外掛「Dotix」是 2019-08-21 上架。
  • 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
  • 上一次更新是 2022-05-27,距離現在已有 1073 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 4.0 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

wpdo |

外掛標籤

Ticket system for WooCommerce | Credit/point system for WooCommerce |

內容簡介

這個外掛可以啟用您的應用程式和 WooCommerce 訂單之間的數位積分使用連接。它可用於檢查一份訂單中剩餘的積分,或是使用積分。

使用方式

在付款的頁面上,重定向至您的應用程式鏈接,攜帶訂單鍵。

假設訂單鍵為wc_order_xQhmRjJ7,您的應用程式 URL 為https://app.EXAMPLE.com/refill,您的 WordPress URL 為https://EXAMPLE.com/

在該訂單的感謝頁面上,顯示一個按鈕返回app.EXAMPLE

在 https://app.EXAMPLE.com/refill 中,使用帶有 $_POST[ 'num' ] = 'max' 的 https://EXAMPLE.com/wp-json/dotix/v1/order/wc_order_xQhmRjJ7 調用,假設在返回的 JSON 中消費積分為 42 分。

將 42 積分添加到相應用戶帳戶中。

REST APIs

1) 顯示餘額:
方法:GET
URL:https://EXAMPLE.com/wp-json/dotix/v1/order/wc_order_xQhmRjJ7
返回:{"_res":"ok", "order_id":45, "status":"completed", "balance":"142"}
// 注意:只有狀態為completed的訂單可以消費積分。

2) 消費 100 積分:
方法: POST
URL:https://EXAMPLE.com/wp-json/dotix/v1/order/wc_order_xQhmRjJ7
數據:[ 'num' => 100 ]
返回:{"_res":"ok", "order_id":45, "consumed":"100", "balance":"42"}

3) 消費所有積分:
方法:POST
URL:https://EXAMPLE.com/wp-json/dotix/v1/order/wc_order_xQhmRjJ7
數據:[ 'num' => 'max' ]
返回:{"_res":"ok", "order_id":45, "consumed":"42", "balance":"0"}

對於所有錯誤,將返回 {“_res”:”err”,"_msg":"error_msg_tag 或 內容”}

訂單狀態

如果一個訂單僅包含產品詳細信息中具有有效積分的項目,那麼一旦該訂單付款,狀態將自動更改為completed,而不是processing。

之所以這樣做是因為某些未付款網關(銀行電匯,支票,貨到付款)會在下單時狀態為processing,而未付款。因此,我們不能使用processing來檢測訂單是否已付款。

為了使未付款網關的訂單中的積分可用,請更新訂單狀態為completed。

REST API中的錯誤消息標籤

錯誤代碼:wrong_hash
描述:訂單鍵不匹配任何訂單。

錯誤代碼:wrong_status
描述:訂單不是處理中/已完成狀態,可能未付款?

錯誤代碼:lack_of_param
描述:需要指定要消費的金額。可以是數字或固定的字符串max。

錯誤代碼:lack_of_bal
描述:這個訂單中剩餘的積分不足。

原文外掛簡介

This plugin will enable the connection between your app and WooCommerce orders for digital credits usage. It can be used to check the remaining credits in one order, or consume them.
Usage
Redirect to your app link on order paid page, carring on the order key.
Let’s assume the order_key=wc_order_xQhmRjJ7, your app URL is https://app.EXAMPLE.com/refill, your WordPress URL is https://EXAMPLE.com/

On the order Thank You page, show a button Go back to app.EXAMPLE.

In https://app.EXAMPLE.com/refill, call https://EXAMPLE.com/wp-json/dotix/v1/order/wc_order_xQhmRjJ7 with $_POST[ 'num' ] = 'max', assume the consumed credits is 42 in returned JSON.

Add 42 credits into the corresponding user account.

REST APIs
1) Show balance:
Method: GET
URL: https://EXAMPLE.com/wp-json/dotix/v1/order/wc_order_xQhmRjJ7
Return: {"_res":"ok", "order_id":45, "status":"completed", "balance":"142"}
// NOTE: only the order with status=completed can be consumed credits.
2) Consume 100 credits:
Method: POST
URL: https://EXAMPLE.com/wp-json/dotix/v1/order/wc_order_xQhmRjJ7
Data: [ 'num' => 100 ]
Return: {"_res":"ok", "order_id":45, "consumed":"100", "balance":"42"}
3) Consume all credits:
Method: POST
URL: https://EXAMPLE.com/wp-json/dotix/v1/order/wc_order_xQhmRjJ7
Data: [ 'num' => 'max' ]
Return: {"_res":"ok", "order_id":45, "consumed":"42", "balance":"0"}
For all errors, will return {“_res”:”err”, “_msg”:”error_msg_tag or content”}
Order Status
If an order contains only items that have valid credit in product detail, once the order is paid, the status will change to completed automatically instead of processing.
The reason to do this is because some unpaid getways (Bank Wire, Cheque, Cash on delivery) will have status processing once the order is placed while not paid. Thus we can’t use processing to detect if the order is paid or not.
To make the credits in the orders with the unpaid gateways available, please update the order status to completed.
Error Message Tag In REST API
Error code: wrong_hash
Description: The order key doesn’t match any order.
Error code: wrong_status
Description: The order isn’t in processing/completed status, maybe not paid yet?
Error code: lack_of_param
Description: Need to specify the ammount to consume. Either numeric or a fixed string max.
Error code: lack_of_bal
Description: Not enough balance left in this order.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Dotix」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.1.1 | 1.2.1 | 1.2.2 | 1.2.3 | 1.3.1 | trunk |

延伸相關外掛(你可能也想知道)

暫無相關外掛推薦。

文章
Filter
Apply Filters
Mastodon