...
If cart contains a FCH on a domain owned by the user check domain status (private/public)
If owner wallet is a Ledger Wallet registration of FCH on private domain is not allowed
Display error: “At this moment registration of FIO Cryptyo Handles on private domains is not supported. We are working hard to add this capability to the Ledger’s FIO App.”
If the FCH being registered is on a private domain (domain registered in the same transaction will be private):
Have the user sign a transaction registering that FCH using pay with FIO functionality (PIN code will be required immediately after they click Purchase)
Set the
max_fee
parameter to 125% of fee obtained from get_fee forregister_fio_address
Once payment is received (e.g. webhook notification from Stripe received):
If domain is being registered in the same purchase, register it first
If registration fails, automatically fail FCH registrations on that domain
Re-check current
register_fio_address
feeIf just obtained
register_fio_address
is more than the fee signed by user in the step above fail FCH registration
Send FIO Tokens to user in the amount of just obtained
register_fio_address
If transaction fails with
Insufficient funds to cover fee
:re-check current
register_fio_address
feeSend users the difference between new fee and number of tokens they received
Resubmit the transaction with higher fee
Registering or renewing domains for multiple years
If cart contains a domain registration or renewal for more than 1 year, it will be captured as a single cart item, but needs to be executed sequentially as follows:
Register 2+ years
First call is register_fio_domain
For each additional year execute renew_fio_domain
Renew 2+ years
For each year of renewal execute renew_fio_domain
On errors:
If first call fails, the entire item fails, https://fioprotocol.atlassian.net/wiki/spaces/DAO/pages/500793345/Shopping+and+Checkout#Purchase-Error error message is shown and appropriate form of payment refund is processed (Stripe, Bitpay).
If 2nd or later call fails, the item needs to be modified as follows:
Original item is modified to reflect what was purchased
New item is added to reflect what fails
Example:
User wants to buy a domain for 3 years
1st register_fio_domain is sucesful
2nd renew_fio_domain fails
Original item (“FIO Domain Registration - 3 years”) is modified to “FIO Domain Registration - 1 year” and marked as Success
New item is created: FIO Domain Renewal - 2 years and is marked Failed
The overall order is marked Partial Success, https://fioprotocol.atlassian.net/wiki/spaces/DAO/pages/500793345/Shopping+and+Checkout#Partial-Success error messages is shown and appropriate form of payment refund is processed (Stripe, Bitpay)
Analytics and Reporting
There is no change to analytics or reporting
Register/renewal for 1 year shows up the same as multi-year, except the value will be higher.
On-chain execution of cart items
...