feat: Razorpay support#2037
Conversation
Greptile SummaryThis PR wires up Razorpay as a second payment path for paid plugins. On the native side it adds Confidence Score: 5/5Safe to merge; all remaining findings are P2 style/cleanup suggestions that do not affect correctness. The major issues flagged in previous review rounds (connection leak, filterState pagination not returned to JS, IAP failure swallowing Razorpay path, remotePlugin.owned not checked without an IAP product) are all addressed in this revision. The only new findings are a hardcoded temp filename (concurrent-install edge case) and inconsistent indentation — both P2 and non-blocking. src/lib/installPlugin.js (temp file race condition), src/pages/plugins/plugins.js (indentation inconsistency) Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[getOwned called] --> B[IAP path: iap.getPurchases]
B -->|success| C[Fetch each SKU from API]
B -->|failure| D[Log warning, continue]
C --> E[Add to owned list]
D --> F[Razorpay path: fetchPlugins owned=true]
E --> F
F -->|success| G[Merge with addedIds dedup]
F -->|failure| H[Log error]
G --> I[Render owned tab]
H --> I
J[installPlugin called] --> K{URL type?}
K -->|Acode registry or local| L[fsOperation.readFile directly]
K -->|Third-party URL| M[cordova.exec downloadPlugin]
M --> N[PluginRetriever writes ZIP to cache]
N --> O[fsOperation.readFile from cache file]
L --> P[JSZip.loadAsync]
O --> P
Reviews (7): Last reviewed commit: "fix: bug" | 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.