The escrow smart contract for a WebAuth-Enabled Gateway for WooCommerce To ease the pain of a bulky installation and configuration from the store owner, Wookey provides a smart contract that handles the process for all stores in one place :
The core of the smart contract is the following actions:
- Payment Registration (pay.reg) That registers the checksum SHA256 key (generated by the Wookey gateway at order creation) amongst a token amount. When registered, the payment is flagged as “AWAIT”.
- Transfer tokens notification actions (transfer) The transfer memo must contain the same checksum SHA256 key provided to the Payment Registration. Thus the contract can find the payment, validate both the token and amount that have to be paid, and finally flag the payment as “PAID”.
It also provides other actions to manage stores, withdrawals, and refunds:
- Store registration (store.reg) Register a store to allow payment and multi-balance storage (for different tokens).
- Store unregistration (store.unreg) Remove a store from the store list, but keep the balance stored.
- Refund by the store owner (pay.refund) Allow the refund of payment that is not already a part of a withdrawal, and flag the payment as “REFUNDED”.
- Withdraw of payments by the store owner (bal.claim) Allow the user to claim all payments made on his store marked as “PAID” since the last claim. It transfers an amount of {tokens}, defined by a symbol param, from the store-scoped balance table to the registered store account. It also flag concerned payments as “PAID_OUT”, the refund of those payments is not possible anymore for the Wookey smart contract.