Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Monetization flow - Background] Start payment #165

Closed
Tracked by #77
dianafulga opened this issue Mar 11, 2024 · 3 comments
Closed
Tracked by #77

[Monetization flow - Background] Start payment #165

dianafulga opened this issue Mar 11, 2024 · 3 comments
Assignees
Labels
area: background Improvements or additions to extension background script

Comments

@dianafulga
Copy link
Contributor

dianafulga commented Mar 11, 2024

  1. In background - call monetizationServer.start()
    4.1 request incoming payment grant
    4.2 create incoming payment - NO AMOUNT
    4.3 try to send payment - if received status code is 403, rotate token
    4.4 revoke grant after creating incoming payment
    4.5 add incoming payment details to a map - (key: tabId, value: {"uuidv4" : { ...incomingPaymentDetails, active: true }, ...})
  2. Create quote with receiveAmount = RATE_OF_PAY / 3600 to incoming payment (active: true)
    5.1. We multiply by X times the interval (X - the number of link tags that we have in the page)
    5.2. What should happen when the wallet address has a low asset scale (2 for example)?
    • If the sending wallet address has a low asset scale how are we splitting the amounts? For asset scale 2 it will need to send 4 units ($0.04) - $0.02 for each link tag
    • If the receiving wallet address has a low asset scale - we will need to ignore the WM user rate of pay and send the minimum amount x number links (two links, with the minimum amount of 2 units - $0.04)
  3. Create outgoing payment with quote identifier (active: true)
@dianafulga dianafulga added the area: background Improvements or additions to extension background script label Mar 11, 2024
@dianafulga dianafulga mentioned this issue Mar 11, 2024
7 tasks
@ionutanin
Copy link
Contributor

Covered:

  • request incoming payment grant
  • create incoming payment - NO AMOUNT
  • try to send payment - if received status code is 403, rotate token
  • revoke grant after creating incoming payment
  • Create outgoing payment with quote identifier (active: true)

In progress:

  • add incoming payment details to a map - (key: tabId, value: {"uuidv4" : { ...incomingPaymentDetails, active: true }, ...})
  • We multiply by X times the interval (X - the number of link tags that we have in the page)
  • If the sending wallet address has a low asset scale how are we splitting the amounts? For asset scale 2 it will need to send 4 units ($0.04) - $0.02 for each link tag
  • If the receiving wallet address has a low asset scale - we will need to ignore the WM user rate of pay and send the minimum amount x number links (two links, with the minimum amount of 2 units - $0.04)

@tselit
Copy link

tselit commented Mar 27, 2024

Still need to confirm the following point, but working towards completing and having PR ready for review tomorrow/Friday, 28/29 Mar

  • add incoming payment details to a map

Functional testing (currently manual):

  • test with 2 wallet addresses that have different asset scales

@tselit
Copy link

tselit commented Mar 27, 2024

Overall, the task has been delayed due to (1) annual leave and (2) more complexity than anticipated.
Peer reviews should be begin on Monday, 1 April

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: background Improvements or additions to extension background script
Projects
Status: Done
Development

No branches or pull requests

4 participants