ubiquity / card-issuance

UbiquiCard
0 stars 1 forks source link

Bounty proposal: integrate Reloadly API #34

Closed sergfeldman closed 2 months ago

sergfeldman commented 8 months ago

Reloadly documentation

https://developers.reloadly.com/gift-cards/introduction Learn how to integrate Reloadly’s digital Gift Card API into your applications https://docs.reloadly.com/gift-cards API description https://www.youtube.com/playlist?list=PLHScUwVHI4TAV03VEtSWyiAp5IkIiBKSp Quick guide to get started with Reloadly’s API https://www.youtube.com/c/Reloadly https://github.com/Reloadly https://join.slack.com/t/reloadly-developers/shared_invite/zt-qflikche-fwiFA5Sxtst2mXzvJBPO3w Reloadly developers

Available prepaid cards

Visa

MasterCard

Top-up in crypto

Crypto top-up

Access

https://dashboard.reloadly.com/ To get access to the Ubiquity account in the Reloadly admin panel, please contact @sergfeldman You will need to use 2FA with Google Authenticator.

Access to the API is here

API setup

We should set up static IPs for requesting the Reloadly API https://dashboard.reloadly.com/security

Note from the Support

Please don't forget to whitelist your IPs to remove restriction on sales amount. Currently, it is set to $100 and automatically will be removed when you add IPs.

Whitelist IP

ubiquibot[bot] commented 8 months ago
! action has an uncaught error
ubiquibot[bot] commented 8 months ago
! action has an uncaught error
ubiquibot[bot] commented 8 months ago
! action has an uncaught error
0x4007 commented 7 months ago

I'm very happy to see the "Visa Prepaid Card USD US" and Mastercard equivalents. Thanks for the proposal @sergfeldman!

0x4007 commented 7 months ago
! action has an uncaught error

@wannacfuture did you handle this one as well?

ubiquibot[bot] commented 7 months ago
! action has an uncaught error
0x4007 commented 7 months ago
! action has an uncaught error

Looks like theres an issue with the wildcard handler @wannacfuture

ubiquibot[bot] commented 7 months ago
! action has an uncaught error
wannacfuture commented 7 months ago

/help

ubiquibot[bot] commented 7 months ago

Available Commands

Command Description Example
/start Assign yourself to the issue. /start
/stop Unassign yourself from the issue. /stop
/help List all available commands. /help
/query Returns the user's wallet, access, and multiplier information. /query @user
/ask Ask a context aware question. /ask is x or y the best approach?
/multiplier Set the task payout multiplier for a specific contributor, and provide a reason for why. /multiplier @user 0.5 "multiplier
reason"
/labels Set access control, for admins only. /labels @user priority time
price
/authorize Approve a label change, for admins only. /authorize
/wallet Register your wallet address for payments. /wallet ubq.eth
ubiquibot[bot] commented 7 months ago
! action has an uncaught error
ubiquibot[bot] commented 7 months ago
! action has an uncaught error
ubiquibot[bot] commented 7 months ago
! action has an uncaught error
ubiquibot[bot] commented 7 months ago
! action has an uncaught error
molecula451 commented 7 months ago

/help

ubiquibot[bot] commented 7 months ago

Available Commands

Command Description Example
/start Assign yourself to the issue. /start
/stop Unassign yourself from the issue. /stop
/help List all available commands. /help
/query Returns the user's wallet, access, and multiplier information. /query @user
/ask Ask a context aware question. /ask is x or y the best approach?
/multiplier Set the task payout multiplier for a specific contributor, and provide a reason for why. /multiplier @user 0.5 "multiplier
reason"
/labels Set access control, for admins only. /labels @user priority time
price
/authorize Approve a label change, for admins only. /authorize
/wallet Register your wallet address for payments. /wallet ubq.eth
ubiquibot[bot] commented 7 months ago
! action has an uncaught error
molecula451 commented 7 months ago

I'm very happy to see the "Visa Prepaid Card USD US" and Mastercard equivalents. Thanks for the proposal @sergfeldman!

and Dollar (UBQ) Top-Up!

ubiquibot[bot] commented 7 months ago
! action has an uncaught error
ubiquibot[bot] commented 7 months ago
! action has an uncaught error
ubiquibot[bot] commented 7 months ago
! action has an uncaught error
ubiquibot[bot] commented 7 months ago
! action has an uncaught error
ubiquibot[bot] commented 6 months ago
# Issue was not closed as completed. Skipping.
ubiquibot[bot] commented 6 months ago
! action has an uncaught error
EresDev commented 5 months ago

I am interested in working on this if it is not already planned to be handed over to someone else. Here is what I understand about the deliverables and my observations.

This is supposed to be an enhancement to https://pay.ubq.fi/ to include Reloadly Gift Cards as a payment method for contributors to claim their reward. It is only for this purpose, and we are not opening a gift card shop for the general public.

The contributor has to go to a third-party website https://myprepaidcenter.com/ for card activation, and balance check. I am not sure yet if it can be done via API.

I think it is a job mostly to be handled on ubiquibot side. One way is, when a permit is generated, the contributor can ask ubiquibot to convert it to a gift card. The bot talks to Reloadly API, and gives user the card. It posts the card details right there in GitHub comments but encrypted with the user's public key from his wallet. Now, the user can decrypt that message and get the card with links to the website to check the balance and activate it.

Some changes like decrypting gift card info message on https://pay.ubq.fi/ would be cool but are not necessary.

sergfeldman commented 5 months ago

@EresDev Thanks for your vision.

Some details may be useful:

0x4007 commented 5 months ago

My vision was that there would be two "claim" buttons on pay.ubq.fi interface.

One is to claim to metamask (or connected wallet) and the other is to "claim to card"

When the user "claims to card" the permit is withdrawn and then the user automatically transfers ubiquity dollars to ubq.eth (or some smart contract)

Now ubiquity can take that money as credit to generate a new card of that amount and reveal it to the user on that interface.

The user can add to their mobile wallet for easy spend. We save the cards generated in their browser local storage to start.

EresDev commented 5 months ago

By default, Reloadly sends the activation code for the gift prepaid card to the user’s email address.

I see card activation is happening using email, or a website (not ours). Any other way you are aware of? I have not gone through documentation yet, but I will do so soon. I will lean toward the simplest and most private way possible at this stage.

One is to claim to metamask (or connected wallet) and the other is to "claim to card"

Sounds much cleaner from a contributor's perspective but I see some extra challenges. Ubiquibot has backend, but pay.ubq.fi doesn't have a backend as far as I am aware. I think Reloadly API communication will also require a backend.

When the user "claims to card" the permit is withdrawn and then the user automatically transfers ubiquity dollars to ubq.eth (or some smart contract)

How will we know the permit is withdrawn specifically for this purpose and not some other. You probably withdraw for other purposes too? Do we track the withdraw reason somehow? If it is not already in place, then building it and handling the atomicity or at least tracking of operations: cancel permit > get gift card from API > maybe save card in db > present to user.

Do you have any recommendations about the backend operations?

sergfeldman commented 5 months ago

@EresDev Since we plan to use the Reloadly API, it would be good to check API methods https://docs.reloadly.com/gift-cards/Orders/Order-Gift-Card https://docs.reloadly.com/gift-cards/Orders/Get-Redeem-Code

0x4007 commented 5 months ago

Do you have any recommendations about the backend operations?

It's simple. We watch ubiquity dollar deposits to a specific address and then expose the card details to the wallet that funded it.

We could even consider encrypting the card details and they can write their signature to decrypt maybe. I'm not sure if we can use signatures in this manner.

Then we can use the blockchain as the backend purely.

EresDev commented 5 months ago

I have read the documentation now. Find below the description of the sequence that I see we are going to build.

When the contributor selects to paid via Gift Card on pay.ubq.fi, a list of available gift cards is displayed to them. It could be visa, mastercard, and cards with limitations on usage (e.g. US only), so that the contributor can pick the cheapest and most useful option.

Once the user picks a gift card, we may have to ask for some more info from user. For example, to order a gift card, senderName is a required field. https://docs.reloadly.com/gift-cards/Orders/Order-Gift-Card Or optional email too if the user wants to receive card on the email.

After getting this info, the permit of user is canceled and we look for ubiquity dollar transfer. When the event is received, a request is forwarded to our pay-backend. Pay-backend checks again for the validity of the transfer, our balance on Reloadly, and if all info is valid, send a request for the required gift card to Reloadly.

When the card is received from Reloadly on pay-backend, it is sent to pay-frontend to display to the user.

Here, I don't like the following:

After getting this info, the permit of user is canceled and we look for ubiquity dollar transfer.

This is okay if parts of it are already built. If it is not, then instead of cancelling the permit, we move the xdai signed by contributor to another wallet, and continue the gift card purchase. The permit is used instead of being canceled in this process.

Canceling permits is back-and-forth communication with ubiquibot. It increases coupling.

EresDev commented 5 months ago

To get access to the Ubiquity account in the Reloadly admin panel, please contact @sergfeldman

I see it is not letting me sign up with a normal email. I will need this info from you along with API access. I am going to send you a message on telegram.

Edit: I guess you will be sending me DM on telegram first. It is not letting me send you a message. It is also @EresDev on telegram. I have also sent you request to grant me access to API on google drive.

0x4007 commented 5 months ago

I have read the documentation now. Find below the description of the sequence that I see we are going to build.

When the contributor selects to paid via Gift Card on pay.ubq.fi, a list of available gift cards is displayed to them. It could be visa, mastercard, and cards with limitations on usage (e.g. US only), so that the contributor can pick the cheapest and most useful option.

I think we should just pick visa for everybody by default, and present that as the only option. It seems to work everywhere, and I think offering more unnecessary options in the UI leads to a worse UX. Otherwise we should automatically determine the best option based on their geography (IP).

Once the user picks a gift card, we may have to ask for some more info from user. For example, to order a gift card, senderName is a required field. https://docs.reloadly.com/gift-cards/Orders/Order-Gift-Card Or optional email too if the user wants to receive card on the email.

I don't think we need any information to produce a digital card for them. We should not offer physical cards because it seems to not offer benefits over virtual cards. However I haven't been to every country in the world so please correct me if I'm wrong.

After getting this info, the permit of user is canceled and we look for ubiquity dollar transfer. When the event is received, a request is forwarded to our pay-backend. Pay-backend checks again for the validity of the transfer, our balance on Reloadly, and if all info is valid, send a request for the required gift card to Reloadly.

Cancelling permits is brittle and bad UX. I think we should always collect permits in the near future, and then transfer to a smart contract to mint the virtual card. We could possibly link/authenticate it with the permit payout with the wallet signature so that random people can't mint virtual cards.

ubq.eth should be able to withdraw the Ubiquity Dollars in the smart contract and redeem as needed to top up our fiat bank account that funds the virtual cards.

molecula451 commented 5 months ago

this realodly it's not available in some countries, the user should be able to check this accordingly while preserving using privacy. Or the user might feel it's entitled to rewards (in this method) without taking this in consideration

0x4007 commented 5 months ago

this realodly it's not available in some countries, the user should be able to check this accordingly while preserving using privacy. Or the user might feel it's entitled to rewards (in this method) without taking this in consideration

I think that privacy is a meme with these cards because I presume that we are able to access all the transaction data. If the user is concerned about privacy, then they should only claim in crypto IMO

molecula451 commented 5 months ago

I think that privacy is a meme with these cards because we are able to access all the transaction data. If the user is concerned about privacy, then they should only claim in crypto IMO

Yes, this is what i mean, maybe if someone tries to claim in card method, pop up a notification bar or something similar, "that claimables avaiable in X countries, for more info check reloadly etc... if your concerned with privacy claim crypto"

EresDev commented 5 months ago

I think we should just pick visa for everybody by default, and present that as the only option. It seems to work everywhere, and I think offering more unnecessary options in the UI leads to a worse UX. Otherwise we should automatically determine the best option based on their geography (IP).

Sounds much simpler. I like it. But is there a plan in place when a contributor asks for a refund or replacement of gift card because the one they got is not usable for them for some reason?

I don't think we need any information to produce a digital card for them. We should not offer physical cards because it seems to not offer benefits over virtual cards. However I haven't been to every country in the world so please correct me if I'm wrong.

I am a little worried about retriving card info later if a user couldn't see card info right after confirmation due to any failure like network failure. There is a way in API but I am not sure about that until I write code. If we can't retrive it from Reloadly API, then asking for email would be a good option.

Cancelling permits is brittle and bad UX. I think we should always collect permits in the near future, and then transfer to a smart contract to mint the virtual card. We could possibly link/authenticate it with the permit payout with the wallet signature so that random people can't mint virtual cards.

I see this is a plan for the future. For now, we are going to cancel the permit.

EresDev commented 5 months ago

/start

ubiquibot[bot] commented 5 months ago

Warning! This task was created over 87 days ago. Please confirm that this issue specification is accurate before starting.
DeadlineWed, Apr 17, 9:07 AM UTC
Registered Wallet 0xE7a9fdf596D869AF34a130fa9607178B2B9800D9
Tips:
0x4007 commented 5 months ago

But is there a plan in place when a contributor asks for a refund or replacement of gift card because the one they got is not usable for them for some reason?

No I guess we should eventually include a disclaimer that they take responsibility for any problems like that.

I am a little worried about retriving card info later if a user couldn't see card info right after confirmation due to any failure like network failure.

Part of the reason why I want to use the blockchain as our backend, and use their signing key to decrypt the card information.

ubiquibot[bot] commented 5 months ago
! action has an uncaught error
ubiquibot[bot] commented 5 months ago
! action has an uncaught error
EresDev commented 5 months ago

Work is in progress. I will have something to show you within the next few days. Here are some info about what is going on.

I am trying my best to rely on blockchain as a backend as much as possible, but I will still have to use some centralized backend for communication with Reloadly. I am trying to follow what we already have, either a GitHub workflow/action or Cloudflare. GitHub workflow seems to make the task more complicated than it is, so I am doing that using Cloudflare worker functions.

We are going to offer only visa gift cards, but Reloadly visa gift cards appear to be unavailable for 90% of the countries.

0x4007 commented 4 months ago

Reloadly visa gift cards appear to be unavailable for 90% of the countries.

What about Mastercard? Do you have any recommendations @sergfeldman @EresDev

ubiquibot[bot] commented 4 months ago
! action has an uncaught error
sergfeldman commented 4 months ago

@EresDev Please, provide links to the sources of information regarding

Reloadly visa gift cards appear to be unavailable for 90% of the countries.

@0x4007 Information regarding the Mastercard that we tested:

There are no additional restrictions from Reloadly. The restrictions for some countries set by the card vendor can be found here https://myprepaidcenter.com/prohibited-countries

The complete list of restricted countries contains 27 countries: Afghanistan (AF) Albania (AL) Belarus (BY) Central African Republic (CF) Cuba (CU) Democratic Republic Of The Congo (CD) Eritrea (ER) Ethiopia (ET) Iran (Islamic Republic Of) (IR) Iraq (IQ) Lebanon (LB) Libyan Arab Jamahiriya (LY) Mali (ML) Myanmar (Burma) (MM) Nicaragua (NI) North Korea aka Democratic People’s Republic of Korea (KP) Russian Federation (RU) Somalia (SO) South Sudan (SS) Sudan (SD) Syrian Arab Republic (SY) Tunisia (TN) Turkey (TR) Ukraine (UA) Venezuela (VE) Yemen (YE) Zimbabwe (ZW)

According to Wikipedia, different calculation methodologies provide from 193 UN member states to 205 entities https://en.wikipedia.org/wiki/List_of_sovereign_states

Mastercard claims that it is available in 210 countries and territories https://www.mastercard.us/en-us/vision/who-we-are.html

If subtract the number of restricted countries from the total number of countries, Mastercard gift cards should be available in 160 - 180 countries and territories.

ubiquibot[bot] commented 4 months ago
! action has an uncaught error
ubiquibot[bot] commented 4 months ago
! action has an uncaught error
EresDev commented 4 months ago

@EresDev Please, provide links to the sources of information regarding

I see a visa card is available when I select a country like the US, Germany, France, or Canada.

I could not find a visa card when I selected the country as UK, Bahrain, Bangladesh, Chile, China, Pakistan, Costa Rica, Malaysia, and more.

image

ubiquibot[bot] commented 4 months ago
! action has an uncaught error