-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat : APP-363 another user purchased credits modal #2500
base: dev
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for regen-website ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Relevant files: |
@blushi I'm not sure how @erikalogie @clevinson can test this, can you help please? |
They need to go through the buy flow with an initial user but then before clicking "purchase", they need to purchase the same credits (with crypto, since fiat microservice PR is not merged yet) with another account in another incognito window or another browser (or with CLI for @clevinson), testing the 2 cases:
|
Is there any 'testing' user I can use to do this myself too? |
6e7c705
to
cc6f2a3
Compare
Can I test this with credit card now? |
yes, but both users should purchase with credit card so the same sell orders get selected |
I am trying to purchase with credit card but the next button is greyed out, not sure what I am doing wrong: Screen.Recording.2024-10-17.at.7.23.49.AM.mov |
are you logged in? with which type of account? |
I am logged in with a web 3.0 account that has no email associated. So in this case, the email field should not be optional, as it shows here. Should this be a separate bug @blushi? |
yes please file a separate bug |
|
@blushi @r41ph I'm really having a lot of trouble testing this and getting it to work, there seem to be some bugs: https://www.loom.com/share/41b9dfb86ea14b1f8f4d4aac0198f35b |
could you try clearing your browser cache to see if that helps? |
The reason for having tradable credits selected might be that you tested the crypto flow with tradable credits but didn't go through the end so it kept this last step in your local storage. Then you got logged out and you come back to this saved step. We keep |
Yes that would be great. Could you open a separate issue if you think it should be separate and put in this sprint? |
Ok here is what is happening for me now: https://www.loom.com/share/ad7c0db6177e4f5fb2ba3db0e46c2798 |
The email login issue is unrelated to this, not sure what's happening, it looks like it doesn't work anymore on prod too. I'll check the server logs. |
Related to this, I've noticed that if I go back in the flow after selecting the crypto option, choose "credit card" and enter some number, then navigate away and click the "buy" button again on the same project page, I would expect to end up at the last screen I was on, which is actually first screen of the flow with credit card selected, not the last screen. Probably not the most important to address right away as most users won't be toggling between the two flows because very few people will use the keplr option. |
Nevermind, got the email on prod, I guess the server took a bit more time to process it or my email client was laggy. |
I see, right now, we only save the step as soon as the user hits the "next" button so I guess we should upgrade that to change as soon as we visit a given step. Could you create an issue for that? |
Yeah this isn't related to this work so should be in a separate issue: https://regennetwork.atlassian.net/browse/APP-409 |
|
@r41ph is this working and can be tested again? I've tried testing it so many times and have been unable to get it working. If you could provide the exact steps then maybe I can test it too. |
paymentOption === PAYMENT_OPTIONS.CARD | ||
? cardSellOrders.sort((a, b) => a.usdPrice - b.usdPrice) | ||
: filteredCryptoSellOrders?.sort( | ||
(a, b) => Number(a.askAmount) - Number(b.askAmount), | ||
) || [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we could extract this into a reusable function, the same logic is also used in ChooseCreditsForm
setUserCanPurchaseCredits({ | ||
openModal: true, | ||
amountAvailable: 0, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reading the dev note on https://www.figma.com/design/BTuUv6QXY4GbliZcXCe8RJ/Fiat-payments?node-id=365-62773&node-type=instance&m=dev, I believe we should also check for other sell orders for the project, right now it's only checking the amount still available for the already selected sell orders
@erikalogie please have a look at my question in https://www.figma.com/design/BTuUv6QXY4GbliZcXCe8RJ?node-id=365-62773&m=dev#995229028, not all cases are fully covered |
d11948f
to
638b2fe
Compare
1edd6a2
to
26a76b9
Compare
@erikalogie have a look at this please |
Ok this worked successfully for me, but I did get this error, should I file a separate bug? Also, has this one been implemented, or does it need a separate task? https://www.figma.com/design/BTuUv6QXY4GbliZcXCe8RJ/Fiat-payments?node-id=5596-91315&t=fdRLHdpN53VWcyQu-1 |
How did this happen? The payment intent / session had already been used. Had you already purchased some credits from this same tab?
We had discussed implementing it here with @r41ph |
handleClick: (action: string | null) => void; | ||
} | ||
|
||
export const BuyFiatModal = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a bit weird to call it BuyFiatModal
when it's not only about fiat credits
maybe something like BuyWarningModal
?
06c7cba
to
e4c032b
Compare
If i'm logged in with a web3 account and try to purchase fiat credits that have already all been purchased, then I get this popup (which is alright) but then clicking on "choose new credits", I see the following. It should instead set payment option to crypto: If I do the same with a visiting user, then I see the same popup for a second before being redirected to the project page, while I should see this: https://www.figma.com/design/BTuUv6QXY4GbliZcXCe8RJ/Fiat-payments?node-id=5596-91315&node-type=instance&m=dev |
Description
https://regennetwork.atlassian.net/browse/APP-363
This PR also addresses https://regennetwork.atlassian.net/browse/APP-409
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
How to test
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...