feat: Razorpay support#2037
Conversation
Greptile SummaryThis PR adds Razorpay payment support by routing plugin downloads and ownership checks through a new native Android layer ( All findings are P2 quality issues: Confidence Score: 5/5Safe to merge; all findings are non-blocking P2 quality issues No P0 or P1 issues found. The core logic for Razorpay ownership, fallback IAP handling, and trusted-domain credential gating is correct. Remaining findings are dead code and a cosmetic loader concern. src/plugins/auth/src/android/PluginRetriever.java — dead code and unused import; src/pages/plugins/plugins.js — inconsistent fetch strategy between filtered and unfiltered views Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[JS: install plugin] --> B[cordova.exec downloadPlugin]
B --> C[Authenticator.java]
C --> D[PluginRetriever.downloadPlugin]
D --> E{Trusted domain?}
E -->|Yes| F[Add auth header]
E -->|No| G[No header added]
F --> H[HTTP GET zip]
G --> H
H --> I[Write to cache file]
I --> J[JS: fsOperation readFile]
J --> K[Unzip and install]
L[JS: get owned plugins] --> M[cordova.exec fetchPlugins]
M --> N[PluginRetriever.fetchJsonArray]
N --> O[GET /api/plugins?owned=true]
O --> P[Return array to JS]
P --> Q[Render owned list]
Reviews (10): Last reviewed commit: "fix: remove useless code" | Re-trigger Greptile |
Waiting for Acode-Foundation/acode.app#15 to be merged
API Expectations
1. Plugin Details / Ownership Check
GET ${constants.API_BASE}/plugin/${id}Should return plugin metadata along with an
owned: booleanfield.The
ownedfield is used to indicate that the plugin has already been purchased externally (outside the in-app purchase flow). This allows the client to mark the plugin as purchased even when no in-app purchase record exists.2. Owned Plugins Filter
GET ${constants.API_BASE}/plugins?owned=trueShould return only plugins that have been purchased externally by the current user.
This is used to fetch plugins the user already owns outside the in-app billing system.
3. Protected Plugin Download
GET ${constants.API_BASE}/plugin/download/{pluginId}Used to download plugin files after purchase.
When the download URL belongs to
acode.appor any subdomain ofacode.app, the client sends the authentication token in the request header:x-auth-token: <token>Expected Server Behavior
401,403,404, etc.) on failure.Notes
acode.appdomains.