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

Handle Wallet Onfido flow #8093

Merged
merged 4 commits into from
Mar 22, 2022
Merged

Handle Wallet Onfido flow #8093

merged 4 commits into from
Mar 22, 2022

Conversation

nkuoch
Copy link
Contributor

@nkuoch nkuoch commented Mar 11, 2022

Tested with https://github.com/Expensify/Web-Secure/pull/2174

Details

Handle Onfido flow in P2P wallet activation

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/191962

Tests

Tests can be found in https://github.com/Expensify/Web-Secure/pull/2182

QA Steps

None

Screenshots

Web

image

image

@nkuoch nkuoch self-assigned this Mar 11, 2022
@nkuoch nkuoch force-pushed the nat-onfidokyc branch 3 times, most recently from 2540370 to bb6defc Compare March 14, 2022 13:00
@nkuoch nkuoch force-pushed the nat-p2pkycquestions branch 2 times, most recently from 0b9f587 to 42459e3 Compare March 14, 2022 14:33
Base automatically changed from nat-p2pkycquestions to main March 14, 2022 21:00
@nkuoch nkuoch force-pushed the nat-onfidokyc branch 12 times, most recently from 169efc5 to 94bb792 Compare March 17, 2022 13:35
@nkuoch nkuoch changed the title [WIP] Handle Wallet Onfido flow Handle Wallet Onfido flow Mar 17, 2022
@nkuoch nkuoch marked this pull request as ready for review March 17, 2022 14:34
@nkuoch nkuoch requested a review from a team as a code owner March 17, 2022 14:34
@MelvinBot MelvinBot requested review from Gonals and removed request for a team March 17, 2022 14:36
@nkuoch nkuoch requested review from francoisl and removed request for Gonals March 17, 2022 17:26
@nkuoch
Copy link
Contributor Author

nkuoch commented Mar 21, 2022

Friendly Bump @marcaaron @ctkochan22 and @francoisl for review

@@ -212,7 +215,12 @@ function activateWallet(currentStep, parameters) {

if (response.jsonCode !== 200) {
if (currentStep === CONST.WALLET.STEP.ONFIDO) {
Onyx.merge(ONYXKEYS.WALLET_ONFIDO, {error: response.message, loading: false});
Onyx.merge(ONYXKEYS.WALLET_ONFIDO, {loading: false});
if (response.title === CONST.WALLET.ERROR.ONFIDO_FIXABLE_ERROR) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the UUID or any type of error code for this instead? As it stands, the error message sounds more likely to change in Web-Secure and break this flow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the pattern we've been using everywhere else in this method. I agree with you, although I'm not a fan of using the uuid either.
I think the proper way would be either via another type of exception php (extending from ExpError), or via a key errorType in data? (Either way, let's do it in a follow up PR, so I can do it for all the other places too).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to try to start a wider conversation about this and propose a holistic fix. There's a lot of inconsistency in the new app in general WRT error handling - in many places we look at jsonCode in others the response.message etc.

@@ -567,6 +567,12 @@ export default {
genericError: 'There was an error while processing this step. Please try again.',
cameraPermissionsNotGranted: 'Camera permissions not granted',
cameraRequestMessage: 'You have not granted us camera access. We need access to complete verification.',
originalDocumentNeeded: 'Please upload an original image of your ID rather than a screenshot or scanned image.',
documentNeedsBetterQuality: 'Your ID appears to be damaged or has missing security features. Please upload an original image of your undamaged ID that is entirely visible.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nab but if their ID is damaged, how can the user upload an "image of [their] undamaged ID"? Would it make more sense to say: Please upload an original image of an undamaged ID ...?

Comment on lines 154 to 157
* @param {String} login
* @param {String} displayName
* @param {String} firstName
* @param {String} lastName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't really tell if we have a standard for this but looking at other functions like here or here, shouldn't be params be written:

Suggested change
* @param {String} login
* @param {String} displayName
* @param {String} firstName
* @param {String} lastName
* @param {Object} params
* @param {String} params.login
* @param {String} params.displayName
* @param {String} params.firstName
* @param {String} params.lastName

?

Copy link
Contributor

@marcaaron marcaaron Mar 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe would also clearer to use a @param {Object} personalDetail. Seems this method is intended to be called with a row from personalDetails key in storage, but I wasn't sure on first glance.

Comment on lines 154 to 157
* @param {String} login
* @param {String} displayName
* @param {String} firstName
* @param {String} lastName
Copy link
Contributor

@marcaaron marcaaron Mar 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe would also clearer to use a @param {Object} personalDetail. Seems this method is intended to be called with a row from personalDetails key in storage, but I wasn't sure on first glance.

src/libs/actions/PersonalDetails.js Outdated Show resolved Hide resolved
src/libs/actions/Wallet.js Outdated Show resolved Hide resolved
src/pages/EnablePayments/EnablePaymentsPage.js Outdated Show resolved Hide resolved
src/pages/EnablePayments/EnablePaymentsPage.js Outdated Show resolved Hide resolved
@nkuoch nkuoch removed the request for review from ctkochan22 March 22, 2022 21:56
@nkuoch nkuoch merged commit 9c540f6 into main Mar 22, 2022
@nkuoch nkuoch deleted the nat-onfidokyc branch March 22, 2022 21:56
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @nkuoch in version: 1.1.46-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @timszot in version: 1.1.46-3 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

@ogumen
Copy link

ogumen commented Apr 13, 2022

Hi @nkuoch, could you please let us know if there is an easy way to get to this screen in order to test it from the accessibility perspective? Can we use any testing account to get to it? Thanks!
CC @SumitDiyora @Stutikuls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants