iap: per-release payment flavors (web=ZarinPal, bazaar, myket)
Payment provider is baked at build time via NEXT_PUBLIC_STORE and selected by storeBilling.getStore(). Add cross-env + flavor build scripts: npm run build:web | build:bazaar | build:myket # web bundle per flavor npm run cap:bazaar | cap:myket # build flavor + cap sync npm run aab:bazaar | aab:myket # signed AAB (bundleRelease) npm run apk:bazaar | apk:myket # release APK (assembleRelease) web → ZarinPal gateway, bazaar → Cafe Bazaar IAB (deep-link), myket → Myket IAB (native bridge). A plain native build with no flavor still falls back to bazaar. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Generated
+26
@@ -29,6 +29,7 @@
|
|||||||
"@types/node": "^20",
|
"@types/node": "^20",
|
||||||
"@types/react": "^19",
|
"@types/react": "^19",
|
||||||
"@types/react-dom": "^19",
|
"@types/react-dom": "^19",
|
||||||
|
"cross-env": "^10.1.0",
|
||||||
"eslint": "^9",
|
"eslint": "^9",
|
||||||
"eslint-config-next": "16.2.7",
|
"eslint-config-next": "16.2.7",
|
||||||
"playwright": "^1.60.0",
|
"playwright": "^1.60.0",
|
||||||
@@ -396,6 +397,13 @@
|
|||||||
"tslib": "^2.4.0"
|
"tslib": "^2.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@epic-web/invariant": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@epic-web/invariant/-/invariant-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/@eslint-community/eslint-utils": {
|
"node_modules/@eslint-community/eslint-utils": {
|
||||||
"version": "4.9.1",
|
"version": "4.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz",
|
||||||
@@ -3144,6 +3152,24 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/cross-env": {
|
||||||
|
"version": "10.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-10.1.0.tgz",
|
||||||
|
"integrity": "sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@epic-web/invariant": "^1.0.0",
|
||||||
|
"cross-spawn": "^7.0.6"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"cross-env": "dist/bin/cross-env.js",
|
||||||
|
"cross-env-shell": "dist/bin/cross-env-shell.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/cross-spawn": {
|
"node_modules/cross-spawn": {
|
||||||
"version": "7.0.6",
|
"version": "7.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||||
|
|||||||
+11
-1
@@ -7,9 +7,18 @@
|
|||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "eslint",
|
"lint": "eslint",
|
||||||
|
"build:web": "cross-env NEXT_PUBLIC_STORE=web next build",
|
||||||
|
"build:bazaar": "cross-env NEXT_PUBLIC_STORE=bazaar next build",
|
||||||
|
"build:myket": "cross-env NEXT_PUBLIC_STORE=myket next build",
|
||||||
"cap:sync": "next build && npx cap sync android",
|
"cap:sync": "next build && npx cap sync android",
|
||||||
|
"cap:bazaar": "npm run build:bazaar && npx cap sync android",
|
||||||
|
"cap:myket": "npm run build:myket && npx cap sync android",
|
||||||
"android:open": "npx cap open android",
|
"android:open": "npx cap open android",
|
||||||
"android:apk": "npm run cap:sync && cd android && gradlew.bat assembleDebug"
|
"android:apk": "npm run cap:sync && cd android && gradlew.bat assembleDebug",
|
||||||
|
"aab:bazaar": "npm run cap:bazaar && cd android && gradlew.bat bundleRelease",
|
||||||
|
"aab:myket": "npm run cap:myket && cd android && gradlew.bat bundleRelease",
|
||||||
|
"apk:bazaar": "npm run cap:bazaar && cd android && gradlew.bat assembleRelease",
|
||||||
|
"apk:myket": "npm run cap:myket && cd android && gradlew.bat assembleRelease"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@capacitor/app": "^8.1.0",
|
"@capacitor/app": "^8.1.0",
|
||||||
@@ -33,6 +42,7 @@
|
|||||||
"@types/node": "^20",
|
"@types/node": "^20",
|
||||||
"@types/react": "^19",
|
"@types/react": "^19",
|
||||||
"@types/react-dom": "^19",
|
"@types/react-dom": "^19",
|
||||||
|
"cross-env": "^10.1.0",
|
||||||
"eslint": "^9",
|
"eslint": "^9",
|
||||||
"eslint-config-next": "16.2.7",
|
"eslint-config-next": "16.2.7",
|
||||||
"playwright": "^1.60.0",
|
"playwright": "^1.60.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user