ubiquity / pay.ubq.fi

Generate and claim spender permits (EIP-2612)
https://pay.ubq.fi
8 stars 35 forks source link

Pick & offer the single best virtual card to user #273

Open EresDev opened 1 month ago

EresDev commented 1 month ago

Currently, the virtual card feature is offering all visa & mastercard to users based on their location.

As discussed in https://github.com/ubiquity/pay.ubq.fi/issues/259#issuecomment-2252453717 and https://github.com/ubiquity/pay.ubq.fi/issues/259#issuecomment-2266190734, pick and offer only single virtual card to the user.

Important files

How to pick the best card for a user?

Please note that the virtual cards feature is present in beta branch at the moment. But it can move to development branch anytime. So, keep an eye on that and open a PR accordingly.

ubiquibot[bot] commented 1 month ago

@EresDev, You are not allowed to add Time: <1 Week

ubiquibot[bot] commented 1 month ago
! No permission to set labels
0x4007 commented 1 month ago

I imagine that the initial set up would have taken longer, how come this iterative feature is estimated to take a week compared to a day?

EresDev commented 1 month ago

I imagine that the initial set up would have taken longer, how come this iterative feature is estimated to take a week compared to a day?

The initial setup was easier. Reloadly API was doing most of the things for us. This is going to take a little more time. 2-3 days I estimate as we are using a custom formula pick a card and data source isn't just the API anymore. We have to read these files or turn them into json.

Free free to adjust the estimate of the initial setup or this, and let me know if I should label the time differently.

rndquu commented 1 month ago

We probably will not fetch a product list from Reloadly anymore.

Why not? I mean the flow for picking up the "best" card could be:

  1. Fetch user country
  2. If user country is in MasterCard International.xlsx then use card from that list
  3. If user country is in MC allow list 3052024.xlsx the use card 18597
  4. Otherwise use reloadly API to fetch available range cards
EresDev commented 1 month ago
  1. Otherwise use reloadly API to fetch available range cards

I see this is the step where we would need to fetch the product list. This step will be unnecessary because there wouldn't be any card for a country that is not in the allow list. We are not offering visa, we are offering only mastercard. But even if we were offering visa, the allowed country list for mastercard and visa contains exactly the same countries.

Only case I can think this would be useful is when the mastercard is out of stock for user and we offer them another non-tokenized mastercard or visa with limitations. Here, we also have another problem of again picking a card from this list. We don't have solid rules to pick one. Maybe choose randomly? I don't plan to support this. Let me know if you think we should support this.

Also, please note that I will need product details and for that I am thinking to use single product details API route. But if I find loading product list to be more useful, I will go with that. So, it is not a final decision to not load product list.

rndquu commented 1 month ago
  1. Otherwise use reloadly API to fetch available range cards

I see this is the step where we would need to fetch the product list. This step will be unnecessary because there wouldn't be any card for a country that is not in the allow list. We are not offering visa, we are offering only mastercard. But even if we were offering visa, the allowed country list for mastercard and visa contains exactly the same countries.

Only case I can think this would be useful is when the mastercard is out of stock for user and we offer them another non-tokenized mastercard or visa with limitations. Here, we also have another problem of again picking a card from this list. We don't have solid rules to pick one. Maybe choose randomly? I don't plan to support this. Let me know if you think we should support this.

Also, please note that I will need product details and for that I am thinking to use single product details API route. But if I find loading product list to be more useful, I will go with that. So, it is not a final decision to not load product list.

So the 4. Otherwise use reloadly API to fetch available range cards step is really useful for non-tokenized or visa cards. I would implement this feature because it serves as kind of a fallback. @0x4007

0x4007 commented 1 month ago

I like fallbacks and redundancies to make our system more resilient. I imagine it will boost confidence in our brand with our end users.

EresDev commented 1 month ago

/start

ubiquibot-dev[bot] commented 1 month ago
DeadlineThu, Aug 15, 9:24 AM UTC
Registered Wallet 0xE7a9fdf596D869AF34a130fa9607178B2B9800D9
Tips:
<ul>
<li>Use <code>/wallet 0x0000...0000</code> if you want to update your registered payment wallet address.</li>
<li>Be sure to open a draft pull request as soon as possible to communicate updates on your progress.</li>
<li>Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the task.</li>
<ul>
ubiquibot[bot] commented 1 month ago

DeadlineThu, Aug 15, 9:24 AM UTC
Registered Wallet 0xE7a9fdf596D869AF34a130fa9607178B2B9800D9
Tips:
EresDev commented 3 days ago

/start

ubiquity-os[bot] commented 3 days ago
! EresDev you were previously unassigned from this task. You cannot be reassigned.
ubiquity-os[bot] commented 3 days ago

@EresDev the deadline is at Wed, Sep 18, 8:27 PM UTC

ubiquity-os[bot] commented 8 hours ago

@EresDev, this task has been idle for a while. Please provide an update.