Conversation
🦋 Changeset detectedLatest commit: 601a6ee The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (18)
WalkthroughThis pull request adds native wallet provisioning support for iOS and Android platforms. It introduces SDK integration via configuration plugins, React Native components for Apple Pay and Google Pay provisioning flows, server-side wallet credential retrieval with processor card details, and corresponding test coverage with necessary dependency and build configuration updates. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant CardDetails as CardDetails Component
participant WalletButtons as WalletButtons Component
participant useWalletProvisioning as useWalletProvisioning Hook
participant MeaPushSDK as MeaPushProvisioning SDK
participant Backend as Backend Server
participant ApplePay as Apple Pay / Google Pay
User->>CardDetails: View card details
CardDetails->>WalletButtons: Render with card data (lastFour, displayName)
WalletButtons->>useWalletProvisioning: Query wallet eligibility & state
useWalletProvisioning->>MeaPushSDK: Initialize SDK (cached)
MeaPushSDK->>Backend: Check Apple Pay capabilities & Google Pay availability
Backend-->>useWalletProvisioning: Return eligibility (eligible.apple, eligible.google)
WalletButtons->>User: Display Apple/Google Pay buttons (if eligible)
User->>WalletButtons: Tap Add to Wallet button
WalletButtons->>useWalletProvisioning: Call addToAppleWallet() or addToGoogleWallet()
useWalletProvisioning->>Backend: getWalletCredentials() → Fetch card wallet data
Backend->>Backend: Get processor details via Panda API
Backend-->>useWalletProvisioning: Return credentials & processor details (with timeBasedSecret)
useWalletProvisioning->>MeaPushSDK: Build MppCardDataParameters with credentials
useWalletProvisioning->>ApplePay: Trigger OEM tokenization & presentation or push card to Google Pay
ApplePay-->>User: Display payment pass provisioning dialog
User->>ApplePay: Confirm addition to wallet
ApplePay-->>useWalletProvisioning: Success
useWalletProvisioning->>WalletButtons: Update provisioning state
WalletButtons->>User: Show success or reset UI
Estimated code review effort🎯 4 (Complex) | ⏱️ ~55 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 12 minutes and 18 seconds.Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces native wallet provisioning for Apple Pay and Google Pay using the MeaWallet SDK. The implementation includes new UI components, a custom hook for provisioning logic, and Expo config plugins to manage native assets and build-time configurations. Feedback highlights a security risk regarding hardcoded credentials in the .npmrc file and points out the fragility of using regex-based string replacements for modifying build.gradle and Podfile, which could lead to silent failures during the build process.
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 57f13078-e054-43d7-ac63-6fce08240922
⛔ Files ignored due to path filters (2)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlsrc/assets/images/google-wallet-button.svgis excluded by!**/*.svg
📒 Files selected for processing (15)
.changeset/gentle-cases-fold.md.changeset/rich-months-double.md.npmrcapp.config.tsbabel.config.jscommon/eslint/base.mjscspell.jsonpackage.jsonpatches/@meawallet__react-native-mpp.patchsrc/assets/mea_configsrc/components/card/CardDetails.tsxsrc/components/card/WalletButtons.tsxsrc/components/card/WalletButtons.web.tsxsrc/components/card/useWalletProvisioning.tssrc/utils/server.ts
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Prevent Tests Dashboard |
42eb9ec to
235b158
Compare
b49e535 to
1cf381c
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 0ef42f30-9abb-400b-ba0a-92db897d922d
⛔ Files ignored due to path filters (2)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlsrc/assets/images/google-wallet-button.svgis excluded by!**/*.svg
📒 Files selected for processing (18)
.changeset/chilly-suns-dress.md.changeset/gentle-cases-fold.md.changeset/rich-months-double.md.npmrcapp.config.tscspell.jsonpackage.jsonpatches/@meawallet__react-native-mpp.patchserver/api/card.tsserver/test/api/card.test.tsserver/test/e2e.tsserver/utils/panda.tssrc/assets/mea_configsrc/components/card/CardDetails.tsxsrc/components/card/WalletButtons.tsxsrc/components/card/WalletButtons.web.tsxsrc/components/card/useWalletProvisioning.tssrc/utils/server.ts
| ((config) => | ||
| withDangerousMod(config, [ | ||
| "android", | ||
| (c) => { | ||
| const buildGradle = path.join(c.modRequest.projectRoot, "android/build.gradle"); | ||
| const meaRepo = ` maven { | ||
| url "https://nexus.ext.meawallet.com/repository/mpp-android-group/" | ||
| credentials { | ||
| username = "${env.MEAWALLET_ANDROID_USER}" | ||
| password = "${env.MEAWALLET_ANDROID_PASS}" | ||
| } | ||
| }`; | ||
| const contents = readFileSync(buildGradle, "utf8"); | ||
| if (!contents.includes("nexus.ext.meawallet.com")) { | ||
| const replaced = contents.replace(/(allprojects[\s\S]*?repositories\s*\{)/, `$1\n${meaRepo}`); // cspell:ignore allprojects | ||
| if (replaced === contents) | ||
| throw new Error("meawallet: failed to inject maven repo into android/build.gradle"); | ||
| writeFileSync(buildGradle, replaced); | ||
| } | ||
| return c; | ||
| }, | ||
| ])) satisfies ConfigPlugin, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if these env vars are documented anywhere
rg -i "MEAWALLET_ANDROID" --type=md --type=yamlRepository: exactly/exa
Length of output: 37
🏁 Script executed:
#!/bin/bash
# Search for MEAWALLET_ANDROID in all files (not just md/yaml)
echo "=== All references to MEAWALLET_ANDROID ==="
rg "MEAWALLET_ANDROID" --max-count=20
echo -e "\n=== Looking for .env files ==="
fd -e env -e example -e sample
echo -e "\n=== Check README and docs ==="
fd -i readme
fd -type f -path '*/docs/*' | head -20Repository: exactly/exa
Length of output: 491
🏁 Script executed:
#!/bin/bash
# Check README content
echo "=== README.md content ==="
cat README.md
echo -e "\n=== Looking for CI/CD config files ==="
fd -type f -path '*/.github/*'
fd -type f -name '*.yml' -o -name '*.yaml'
echo -e "\n=== Looking for setup/docs files ==="
find . -type f \( -name 'SETUP*' -o -name 'setup*' -o -name '.env*' \) | head -20Repository: exactly/exa
Length of output: 1728
🏁 Script executed:
#!/bin/bash
# Final check for CI workflows and any remaining setup docs
echo "=== Searching for workflow files ==="
find . -type f \( -name '*.workflow' -o -name '*.yml' -o -name '*.yaml' \) 2>/dev/null | grep -E '(workflow|ci|github|build)' || echo "No workflow files found"
echo -e "\n=== Check if env vars are referenced in package.json or scripts ==="
rg "MEAWALLET" --type json --type shRepository: exactly/exa
Length of output: 739
🏁 Script executed:
#!/bin/bash
echo "=== mobile-beta.yaml ==="
cat ./.github/workflows/mobile-beta.yaml
echo -e "\n=== mobile-expo.yaml ==="
cat ./.github/workflows/mobile-expo.yaml
echo -e "\n=== mobile-production.yaml ==="
cat ./.github/workflows/mobile-production.yamlRepository: exactly/exa
Length of output: 3859
Document MEAWALLET_ANDROID_USER and MEAWALLET_ANDROID_PASS in CI workflows and README.
These Maven credentials are injected into the Android build but are not documented in CI configuration or setup docs. Add these to the mobile workflow files (.github/workflows/mobile-*.yaml) and the README's development setup section to prevent build failures.
| "mainqueg", | ||
| "mateo-soso", | ||
| "mdpi", | ||
| "meawallet", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check how many times and in how many files "meawallet" appears.
# Expected: Should appear in multiple files across the codebase to justify global dictionary entry.
echo "=== Files containing 'meawallet' (case-insensitive) ==="
rg -i --files-with-matches 'meawallet'
echo -e "\n=== Total occurrences with context ==="
rg -i -C2 'meawallet'
echo -e "\n=== Summary ==="
echo "Total files: $(rg -i --files-with-matches 'meawallet' | wc -l)"
echo "Total occurrences: $(rg -i 'meawallet' | wc -l)"Repository: exactly/exa
Length of output: 6095
Remove "meawallet" from the dictionary and use inline cspell:ignore annotations instead.
The term appears only as package imports in 2 source files. Per the learning guidance, one-off or limited occurrences should use inline cspell:ignore annotations on the same line as the unknown word—not pollute the global dictionary. Place cspell:ignore on the two import lines in src/components/card/useWalletProvisioning.ts and src/components/card/WalletButtons.tsx, then remove "meawallet" from this file.
Closes #154
Summary by CodeRabbit
New Features
Chores