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

[$1000] Create new library and native module react-native-wallet #36957

Open
thienlnam opened this issue Feb 20, 2024 · 84 comments
Open

[$1000] Create new library and native module react-native-wallet #36957

thienlnam opened this issue Feb 20, 2024 · 84 comments
Assignees
Labels
External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2

Comments

@thienlnam
Copy link
Contributor

thienlnam commented Feb 20, 2024

To support tokenization in NewDot which is adding a virtual card to Apple / Google Pay, we will need access to some native methods.

Problem:
Apple Pay and Google Pay are table stakes in the card market today. We support both of them for physical and virtual cards. Going forward, members will be able to access their virtual card details in NewDot. However, it isn't intuitive to know that you can copy your virtual card details, and manually key them into the Apple/Google wallet apps to tokenize your virtual card.

We're going to create a new package that will return the necessary parameters and call native methods for adding a card to the wallet

The endpoint we want to call is CreateDigitalWallet.
We will need to call native modules to fetch specific native variables to call CreateDigitalWallet

  • deviceID
  • certificates
  • nonce
  • nonceSignature

Then once we have the return values, we will call the native modules to add these to apple / google wallets

CreateDigitalWallet Summary

The parameters required for the new CreateDigitalWallet API/auth command are:

Mutual parameters Android specific parameters iOS specific parameters
1.appVersion 1.walletAccountID 2.deviceID 1.certificates 2.nonce 3.nonceSignature

The return values for the new CreateDigitalWallet API/auth command are:

Mutual return values Android return values iOS return values
1.cardToken 1.opaquePaymentCard 2.userAddress 3.network 4.tokenServiceProvider 5.displayName 6.lastDigits 1.encryptedPassData 2.activationData 3.ephemeralPublicKey
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e91e840e65f1cbba
  • Upwork Job ID: 1765158784361259008
  • Last Price Increase: 2024-03-12
@thienlnam thienlnam self-assigned this Feb 20, 2024
@melvin-bot melvin-bot bot added the Monthly KSv2 label Feb 26, 2024
@thienlnam thienlnam changed the title Create new library react-native-wallet Create new library and native module react-native-wallet Mar 5, 2024
@thienlnam thienlnam added the External Added to denote the issue can be worked on by a contributor label Mar 5, 2024
@melvin-bot melvin-bot bot changed the title Create new library and native module react-native-wallet [$500] Create new library and native module react-native-wallet Mar 5, 2024
Copy link

melvin-bot bot commented Mar 5, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01e91e840e65f1cbba

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 5, 2024
Copy link

melvin-bot bot commented Mar 5, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @akinwale (External)

@melvin-bot melvin-bot bot added the Daily KSv2 label Mar 5, 2024
@thienlnam thienlnam added NewFeature Something to build that is a new item. and removed Daily KSv2 labels Mar 5, 2024
@melvin-bot melvin-bot bot removed the Monthly KSv2 label Mar 5, 2024
Copy link

melvin-bot bot commented Mar 5, 2024

@melvin-bot melvin-bot bot added the Weekly KSv2 label Mar 5, 2024
Copy link

melvin-bot bot commented Mar 5, 2024

⚠️ It looks like this issue is labelled as a New Feature but not tied to any GitHub Project. Keep in mind that all new features should be tied to GitHub Projects in order to properly track external CAP software time ⚠️

@thienlnam thienlnam added the Daily KSv2 label Mar 5, 2024
@suneox
Copy link
Contributor

suneox commented Mar 7, 2024

Hi @thienlnam how can I access issue?

@thienlnam
Copy link
Contributor Author

Hey @suneox, I copied what was relevant from the issue into this description

@melvin-bot melvin-bot bot added the Overdue label Mar 11, 2024
@lschurr
Copy link
Contributor

lschurr commented Mar 11, 2024

Hey @thienlnam - are we just waiting for proposals on this one?

@melvin-bot melvin-bot bot removed the Overdue label Mar 11, 2024
Copy link

melvin-bot bot commented Mar 12, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@thienlnam thienlnam changed the title [$500] Create new library and native module react-native-wallet [$1000] Create new library and native module react-native-wallet Mar 12, 2024
Copy link

melvin-bot bot commented Mar 12, 2024

Upwork job price has been updated to $1000

@thienlnam
Copy link
Contributor Author

Updated the bounty since this is a more intensive - let's give it another week and then we can hand it to our expert contributors? cc @lschurr

@brunovjk
Copy link
Contributor

brunovjk commented Mar 12, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

The problem identified is that users may find it unintuitive to manually input their virtual card details into the Apple Pay or Google Pay wallet apps.

What is the root cause of that problem?

New Feature

What changes do you think we should make in order to solve the problem?

The proposed solution is to create a new package that will handle the process of adding a Expensify NewDot Virtual Card to the Google Pay/Apple Pay Wallet by creating a new package that will return the necessary parameters and call native methods for adding the card to the wallet

First we need to call native modules to fetch specific native variables:

  1. Mutual Parameters:

    • appVersion: We'll utilize the react-native-device-info library to fetch the current version of the application.
  2. For Android:

    • walletAccountID: We'll use native methods provided by the Google Pay API to retrieve the user's Google account ID associated with their Google Pay wallet. This ID is typically obtained through the Google Pay PaymentDataRequest object, specifically from the getGoogleTransactionId() method.
    • deviceID: To fetch the unique device identifier (ID) for Android devices, we'll utilize the react-native-device-info library.
  3. For iOS:

    • certificates: We will utilize the server certificates provided by Apple's PKAddPaymentPassRequest class for adding payment passes to Apple Pay.
    • nonce: We will generate a nonce using cryptographic operations, such as elliptic curve cryptography (ECC), as required by Apple's PKAddPaymentPassRequest class.
    • nonceSignature: nonceSignature: We will generate a nonce signature using cryptographic operations, such as ECC, as specified by Apple's PKAddPaymentPassRequest class.

Fetch return values:

  1. For Android:

    • Android Push Provisioning API: We need to utilize this API to interact with Google Pay services and retrieve the necessary return values. This includes obtaining the opaquePaymentCard, userAddress, network, tokenServiceProvider, displayName, and lastDigits. We can integrate the Android Push Provisioning API using the official documentation provided by Google.
  2. For iOS:

    • Apple Wallet PassKit Framework: To interact with Apple Wallet and retrieve return values such as encryptedPassData, activationData, and ephemeralPublicKey, we'll need to use Apple's PassKit framework. This framework provides APIs for adding passes to Apple Wallet and managing pass data.

What alternative solutions did you explore? (Optional)

N/A

Note: While I've outlined the proposed solution based on the current understanding of the problem and available resources, I'm open to exploring alternative approaches suggested by the team.

@melvin-bot melvin-bot bot added the Overdue label Mar 14, 2024
@lschurr
Copy link
Contributor

lschurr commented Mar 14, 2024

Could you review the proposal @akinwale?

@brunovjk
Copy link
Contributor

Sorry, I can't answer your question. Unfortunately when it comes to permissions I cannot do much.

@brunovjk

This comment was marked as outdated.

@brunovjk
Copy link
Contributor

Same as above :D

@thienlnam
Copy link
Contributor Author

thienlnam commented Apr 29, 2024

Update: Attempted to test canAddPaymentPass() method for adding cards to Apple Pay, but discovered that we need a production build to fully test it:
"Adding a card to Apple Wallet can be tested only via TestFlight, which requires a production build with a specific entitlement in both provisioning profile and in Entitlements-Release.plist."

I can generate an adhoc build on your PR which should allow this to get tested on an iOS device.

Can you turn your branch into a draft PR?

@thienlnam @brunovjk do we still need to whitelist the new App ID with Apple/Google? If so, curious if y'all have any ideas for #36957 (comment)?

I can get the answers to these - will DM you

@joekaufmanexpensify
Copy link
Contributor

sweet. TY!

@brunovjk

This comment was marked as outdated.

@brunovjk
Copy link
Contributor

brunovjk commented May 2, 2024

I'll be OOO until May 6th

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels May 6, 2024
@brunovjk
Copy link
Contributor

brunovjk commented May 8, 2024

Update: Continuing to gather iOS native calls this week

@brunovjk
Copy link
Contributor

Same as above :D

@melvin-bot melvin-bot bot added the Overdue label May 13, 2024
@brunovjk
Copy link
Contributor

brunovjk commented May 13, 2024

Update: Keep working on iOS modules

@melvin-bot melvin-bot bot removed the Overdue label May 13, 2024
@brunovjk
Copy link
Contributor

Update: Started structuring files for native Android modules

@brunovjk
Copy link
Contributor

brunovjk commented May 17, 2024

Update: Keep working on native Android modules
local branch: https://github.com/brunovjk/Expensify-App/tree/feat/36957/modules/react-native-wallet

@melvin-bot melvin-bot bot added the Overdue label May 20, 2024
@brunovjk
Copy link
Contributor

Update: Continue working on the local branch

@melvin-bot melvin-bot bot removed the Overdue label May 20, 2024
@brunovjk
Copy link
Contributor

Update: Same as above.

@melvin-bot melvin-bot bot added the Overdue label May 24, 2024
@brunovjk
Copy link
Contributor

Update: Continue working on the local branch: https://github.com/brunovjk/Expensify-App/tree/feat/36957/modules/react-native-wallet

@melvin-bot melvin-bot bot removed the Overdue label May 24, 2024
@brunovjk
Copy link
Contributor

Same as above

Copy link

melvin-bot bot commented May 30, 2024

📣 @Darren120! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@brunovjk
Copy link
Contributor

brunovjk commented Jun 3, 2024

Update: Making progress on error handling, documentation, and unit tests.
Next: Build the library locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2
Projects
Status: Polish
Development

No branches or pull requests

8 participants