@mpgd/capacitor-play-billing 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -122,6 +122,27 @@ discarded. The plugin still never acknowledges or consumes;
122
122
  `isAcknowledged: false` on a purchased entry marks it unfinished for the
123
123
  backend finalizer.
124
124
 
125
+ ### Generated games
126
+
127
+ Games generated by `mpgd game create` (and the kit's private starter) ship
128
+ this wiring in `src/platform/buildGateways/capacitorAndroid.ts` (commerce v2
129
+ PR C3): the service provider is registered for every catalog product whose
130
+ `platformProductIds.android` names a Play SKU (subscriptions are skipped),
131
+ and `accountBinding` is the reference binding in
132
+ `src/platform/commerceAccountBinding.ts`, the 64-character hex SHA-256 of
133
+ `mpgd-commerce-account:<playerId>` for the authenticated player (a guest
134
+ session binds nothing, so the purchase is refused with
135
+ `ACCOUNT_BINDING_REQUIRED`). The backend's `resolveObfuscatedAccountId`
136
+ must derive the same value, or both are replaced together.
137
+
138
+ `mpgd target init capacitor --providers play-billing` installs this package
139
+ into the game-owned shell and the game at one exact version and lets
140
+ `cap add` or `cap sync` register its native module; on a game that still has
141
+ the unwired gateway of an earlier template it also writes the wiring above.
142
+ A build whose shell lacks the native module still runs: the plugin answers
143
+ Capacitor's `UNIMPLEMENTED`, which the SDK reports as
144
+ `configuration-required`, so no purchase UI opens.
145
+
125
146
  ### Migrating from the v1 provider
126
147
 
127
148
  `createCapacitorPlayBillingProvider` and `recoverOwnedPlayPurchases` are
package/dist/store-sdk.js CHANGED
@@ -42,6 +42,8 @@ const obfuscatedAccountIdPattern = /^[A-Za-z0-9._-]{1,64}$/u;
42
42
  const maximumProducts = 100;
43
43
  const maximumPurchaseTimeMillis = 8_640_000_000_000_000;
44
44
  const configurationErrorCodes = new Set([
45
+ // Capacitor's `UNIMPLEMENTED`: the native plugin is not installed in the shell.
46
+ 'UNIMPLEMENTED',
45
47
  'PLAY_BILLING_CONFIGURATION_ERROR',
46
48
  'PLAY_BILLING_PRODUCT_UNAVAILABLE',
47
49
  'PLAY_BILLING_OFFER_REQUIRED',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpgd/capacitor-play-billing",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Opt-in Android Google Play Billing purchase collector for mpgd Capacitor games.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "peerDependencies": {
40
40
  "@capacitor/core": "^8.5.1",
41
- "@mpgd/adapter-capacitor": "^0.9.2",
41
+ "@mpgd/adapter-capacitor": "^0.9.3",
42
42
  "@mpgd/bridge": "^0.12.3",
43
43
  "@mpgd/platform": "^0.22.0"
44
44
  },
@@ -48,10 +48,10 @@
48
48
  "ttsc": "0.30.4",
49
49
  "typescript": "7.0.2",
50
50
  "vitest": "^4.0.0",
51
- "@mpgd/adapter-capacitor": "0.9.2",
51
+ "@mpgd/adapter-capacitor": "0.9.3",
52
52
  "@mpgd/bridge": "0.12.3",
53
- "@mpgd/game-services": "0.22.0",
54
- "@mpgd/platform": "0.22.0"
53
+ "@mpgd/platform": "0.22.0",
54
+ "@mpgd/game-services": "0.23.0"
55
55
  },
56
56
  "main": "./dist/index.js",
57
57
  "types": "./dist/index.d.ts",