...
Timestamp
Items
item
description - e.g. domain name
type
FIO Domain
FIO Address
FIO Domain Renewal
Bundles
Amount in FIO
Amount in USDC
Executed to blockchain
True
False
Target FIO Public Key
Status
Created
Pending
Success
Partial Success
Purchase Error
Declined
Payment type
FIO Tokens
CoinPaymentsStripe
Bitpay
Link to User
Links to Payments
...
Order Created
Funds credited to Order, e.g. “CoinPayments payment “Stripepayment notification received (TX: 3213123131231, Status: Completed)”
Funds debited from Order, e.g. “Charge for pawel@hodl”
FIO Domain/Address registered on chain, e.g. “Registred pawel@hodl (FIO TX: kjdhakjdhkadhkajsdhkasjdhkasjhdkas)”
FIO Domain/Address registration error, e.g. “Failed to register pawel2@hodl (FIO error: "Insufficient funds")”
Funds credited to user, e.g. “Crediting FIO to user”
...
Payment notification received, e.g. “CoinPayments “Stripe payment notification received (TX: 3213123131231, Status: Pending)”
...
Depicts payment transactions executed against specific Order. This is akin to Registration site transaction.
Timestamp
Type
Coinpayments
Credit Card (future)
FIO TokensFIO Tokens
Stripe
Bitpay
Currency
Amount
Amount in USDC
External transaction ID
Description
...
Create Order
Auto-generate order ID (6 alphanumeric, e.g. ABC123)
Payment is not created as there is no payment to Dashboard, it’s made on-chain directly
Execute on-chain action
On Success
Update Order as Success
Display https://fioprotocol.atlassian.net/wiki/spaces/DAO/pages/500793345/Dashboard+Checkout#Success
On complete Purchase Error
Update Order as Purchase Error
Display https://fioprotocol.atlassian.net/wiki/spaces/DAO/pages/500793345/Dashboard+Checkout#Purchase-Error
On Partial Success
Update Order as Partial Success
Display https://fioprotocol.atlassian.net/wiki/spaces/DAO/pages/500793345/Dashboard+Checkout#Partial-Success
Paid with
...
Bitpay
Success
Zenuml sequence macro lite | ||||||
---|---|---|---|---|---|---|
| ||||||
User FIODashboard CoinPayments FIOChain
@Starter(User)
"{Confirmation}" = User->FIODashboard.PayWithCoinPayments() {
FIODashboard.CreateOrder(amount_usdc=123,amount_fio=456)
User->CoinPayments: Redirect.Pay()
CoinPayments->FIODashboard: WebHookNotification
FIODashboard.CreatePayment(ReceivedFromCoinPayments)
FIODashboard.CreatePayment(SpentOnOrder)
"Registered" = FIODashboard->FIOChain.Register()
FIODashboard.UpdateOrder()
} |
With Errors
Zenuml sequence macro lite | ||||||
---|---|---|---|---|---|---|
| ||||||
User FIODashboard CoinPayments FIOChain
@Starter(User)
"{Confirmation}" = User->FIODashboard.PayWithCoinPayments() {
FIODashboard.CreateOrder(amount_usdc=123,amount_fio=456)
User->CoinPayments: Redirect.Pay()
CoinPayments->FIODashboard: WebHookNotification
FIODashboard.CreatePayment(ReceivedFromCoinPayments)
FIODashboard.CreatePayment(SpentOnOrder)
"Errors" = FIODashboard->FIOChain.Register()
FIODashboard.CreatePayment(ReceivedBackDueToErrors)
FIODashboard.CreatePayment(SpentOnFIOTokens)
"{Confirmation}" = FIODashboard->FIOChain.SendTokensToUser()
FIODashboard.UpdateOrder()
} |
| |
Create Order as Pending
Auto-generate order ID (6 alphanumeric, e.g. ABC123)
Redirect in same window to https://www.coinpayments.net/index.php based on this spec and the following parameters:
cmd: _pay_simple
reset: 1
merchant: 3143e56ef04c6125c3a246c34b421fd7
currency: USDT
amountf: (total cart value in USDC)
item_name: “FIO Dashboard cart”
item_desc: “FIO Domains: (list comma delimited), FIO Crypto Handles: (list comma delimited)”
If length exceeds 125 character truncate rest and add “…”
Do not show FIO Domains label if no domains
Do not show Crypto Handles label if no domains
Examples
“FIO Domains: test, test1, test2; FIO Crypto Handles: example@test, example@test1”
“FIO Domains: test”
“FIO Crypto Handles: example@test, example@test1”
invoice: (shopping cart reference)
email: (Dashboard user’s email address)
success_url: (Link to Payment Progress Page - In Progress)
cancel_url: (Link to Payment Progress Page - Cancelled)
Await Webhook notification. See Create Invoice via API
currency
= USDmerchantName
= “FIO Dashboard”price
= Total price of orderorderId
= Order IDnotificationURL
= webhook notification urlredirectURL
= link to Order details where user will be redirected after paymentbuyer
email
= Email address of user
token
= API token provided by Bitpay
Capture response
id
Trigger Modal Invoice
Await Webhook notification.
Payload spec: https://bitpay.com/docs/invoice-webhooks
When received fetch invoice via API to ensure not spoofed
Action based on status
new/complete
No action
paid
Set order status to Pending
User should stay on Invoice Modal
expired
Update Order as Cancelled and display https://fioprotocol.atlassian.net/wiki/spaces/DAO/pages/
Payload spec: https://www.coinpayments.net/merchant-tools-ipn
Action based on status
< 0
Update Order as Cancelled and display
invalid
Set order status to Pending
Display https://fioprotocol.atlassian.net/wiki/spaces/DAO/pages/500793345/
DashboardCheckout#Cancelled2 or >=100Checkout#Pending
confirmed
Create Payment for amount received
Create Payment for amount of order
Execute on-chain action
On success
Update Order as Success
Display https://fioprotocol.atlassian.net/wiki/spaces/DAO/pages/500793345/
Dashboard+Checkout#Success.1
On complete Purchase Error
Create Payment for amount of order back to User
Create Payment for amount of order Spent On FIO
Send FIO to User’s account
On Error Create Payment for amount of order back to User
Display https://fioprotocol.atlassian.net/wiki/spaces/DAO/pages/500793345/
DashboardShopping+and+Checkout#Purchase-Error
.1Update Order as Purchase Error
On Partial Success
Create Payment for amount of failed items back to User
Create Payment for amount of failed items Spent On FIO
Send FIO to User’s account
On Error Create Payment for amount of failed items back to User
Display https://fioprotocol.atlassian.net/wiki/spaces/DAO/pages/500793345/
DashboardShopping+and+Checkout#Partial-Success
.1
Any other status
Handling price changes
Preserve FIO pricing and USDC pricing for cart
When payment is received compare total price of cart when saved to what it is at the time when payment notification is received
If price deviation is +/- 25% from saved price do not alter pricing and execute transaction
If price deviation is more than +/- 25% reprice send FIO to User’s account at new rate of exchange
...