@chipmobilesdk/rn-payment 0.5.0 → 0.7.0

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.
Files changed (317) hide show
  1. package/CHANGELOG.md +172 -0
  2. package/README.md +47 -16
  3. package/lib/commonjs/adapter/createStoreProvider.js +110 -0
  4. package/lib/commonjs/adapter/createStoreProvider.js.map +1 -0
  5. package/lib/commonjs/adapter/iap-adapter.js +393 -0
  6. package/lib/commonjs/adapter/iap-adapter.js.map +1 -0
  7. package/lib/commonjs/adapter/iapShapes.js +169 -0
  8. package/lib/commonjs/adapter/iapShapes.js.map +1 -0
  9. package/lib/commonjs/adapter/port.js +6 -0
  10. package/lib/commonjs/adapter/port.js.map +1 -0
  11. package/lib/commonjs/config/types.js +2 -0
  12. package/lib/commonjs/config/types.js.map +1 -0
  13. package/lib/commonjs/config/validate.js +181 -0
  14. package/lib/commonjs/config/validate.js.map +1 -0
  15. package/lib/commonjs/core/mutex.js +31 -0
  16. package/lib/commonjs/core/mutex.js.map +1 -0
  17. package/lib/commonjs/core/retry.js +37 -0
  18. package/lib/commonjs/core/retry.js.map +1 -0
  19. package/lib/commonjs/core/timers.js +207 -0
  20. package/lib/commonjs/core/timers.js.map +1 -0
  21. package/lib/commonjs/diagnostics/errors.js +83 -0
  22. package/lib/commonjs/diagnostics/errors.js.map +1 -0
  23. package/lib/commonjs/diagnostics/events.js +126 -0
  24. package/lib/commonjs/diagnostics/events.js.map +1 -0
  25. package/lib/commonjs/diagnostics/messageKeys.js +70 -0
  26. package/lib/commonjs/diagnostics/messageKeys.js.map +1 -0
  27. package/lib/commonjs/engine/connection.js +189 -0
  28. package/lib/commonjs/engine/connection.js.map +1 -0
  29. package/lib/commonjs/engine/engine.js +279 -0
  30. package/lib/commonjs/engine/engine.js.map +1 -0
  31. package/lib/commonjs/engine/finalize.js +325 -0
  32. package/lib/commonjs/engine/finalize.js.map +1 -0
  33. package/lib/commonjs/engine/foreground.js +26 -0
  34. package/lib/commonjs/engine/foreground.js.map +1 -0
  35. package/lib/commonjs/engine/internals.js +31 -0
  36. package/lib/commonjs/engine/internals.js.map +1 -0
  37. package/lib/commonjs/engine/pending.js +102 -0
  38. package/lib/commonjs/engine/pending.js.map +1 -0
  39. package/lib/commonjs/engine/products.js +198 -0
  40. package/lib/commonjs/engine/products.js.map +1 -0
  41. package/lib/commonjs/engine/purchase.js +395 -0
  42. package/lib/commonjs/engine/purchase.js.map +1 -0
  43. package/lib/commonjs/engine/purchaseFailure.js +77 -0
  44. package/lib/commonjs/engine/purchaseFailure.js.map +1 -0
  45. package/lib/commonjs/engine/receiptValidation.js +90 -0
  46. package/lib/commonjs/engine/receiptValidation.js.map +1 -0
  47. package/lib/commonjs/engine/state.js +201 -0
  48. package/lib/commonjs/engine/state.js.map +1 -0
  49. package/lib/commonjs/engine/subscriptions.js +122 -0
  50. package/lib/commonjs/engine/subscriptions.js.map +1 -0
  51. package/lib/commonjs/engine/sync.js +163 -0
  52. package/lib/commonjs/engine/sync.js.map +1 -0
  53. package/lib/commonjs/entitlements/aggregate.js +212 -0
  54. package/lib/commonjs/entitlements/aggregate.js.map +1 -0
  55. package/lib/commonjs/entitlements/mapping.js +41 -0
  56. package/lib/commonjs/entitlements/mapping.js.map +1 -0
  57. package/lib/commonjs/entitlements/policy.js +110 -0
  58. package/lib/commonjs/entitlements/policy.js.map +1 -0
  59. package/lib/commonjs/index.js +266 -0
  60. package/lib/commonjs/index.js.map +1 -0
  61. package/lib/commonjs/package.json +1 -0
  62. package/lib/commonjs/persistence/mmkv-store.js +149 -0
  63. package/lib/commonjs/persistence/mmkv-store.js.map +1 -0
  64. package/lib/commonjs/persistence/snapshot.js +229 -0
  65. package/lib/commonjs/persistence/snapshot.js.map +1 -0
  66. package/lib/commonjs/react/PaymentProvider.js +96 -0
  67. package/lib/commonjs/react/PaymentProvider.js.map +1 -0
  68. package/lib/commonjs/react/hooks.js +202 -0
  69. package/lib/commonjs/react/hooks.js.map +1 -0
  70. package/lib/commonjs/testing/conformance.js +136 -0
  71. package/lib/commonjs/testing/conformance.js.map +1 -0
  72. package/lib/commonjs/testing/fakeStore.js +281 -0
  73. package/lib/commonjs/testing/fakeStore.js.map +1 -0
  74. package/lib/commonjs/testing/index.js +45 -0
  75. package/lib/commonjs/testing/index.js.map +1 -0
  76. package/lib/module/adapter/createStoreProvider.js +106 -0
  77. package/lib/module/adapter/createStoreProvider.js.map +1 -0
  78. package/lib/module/adapter/iap-adapter.js +383 -0
  79. package/lib/module/adapter/iap-adapter.js.map +1 -0
  80. package/lib/module/adapter/iapShapes.js +160 -0
  81. package/lib/module/adapter/iapShapes.js.map +1 -0
  82. package/lib/module/adapter/port.js +4 -0
  83. package/lib/module/adapter/port.js.map +1 -0
  84. package/lib/module/config/types.js +2 -0
  85. package/lib/module/config/types.js.map +1 -0
  86. package/lib/module/config/validate.js +175 -0
  87. package/lib/module/config/validate.js.map +1 -0
  88. package/lib/module/core/mutex.js +22 -0
  89. package/lib/module/core/mutex.js.map +1 -0
  90. package/lib/module/core/retry.js +33 -0
  91. package/lib/module/core/retry.js.map +1 -0
  92. package/lib/module/core/timers.js +198 -0
  93. package/lib/module/core/timers.js.map +1 -0
  94. package/lib/module/diagnostics/errors.js +76 -0
  95. package/lib/module/diagnostics/errors.js.map +1 -0
  96. package/lib/module/diagnostics/events.js +117 -0
  97. package/lib/module/diagnostics/events.js.map +1 -0
  98. package/lib/module/diagnostics/messageKeys.js +64 -0
  99. package/lib/module/diagnostics/messageKeys.js.map +1 -0
  100. package/lib/module/engine/connection.js +185 -0
  101. package/lib/module/engine/connection.js.map +1 -0
  102. package/lib/module/engine/engine.js +274 -0
  103. package/lib/module/engine/engine.js.map +1 -0
  104. package/lib/module/engine/finalize.js +322 -0
  105. package/lib/module/engine/finalize.js.map +1 -0
  106. package/lib/module/engine/foreground.js +21 -0
  107. package/lib/module/engine/foreground.js.map +1 -0
  108. package/lib/module/engine/internals.js +26 -0
  109. package/lib/module/engine/internals.js.map +1 -0
  110. package/lib/module/engine/pending.js +95 -0
  111. package/lib/module/engine/pending.js.map +1 -0
  112. package/lib/module/engine/products.js +195 -0
  113. package/lib/module/engine/products.js.map +1 -0
  114. package/lib/module/engine/purchase.js +390 -0
  115. package/lib/module/engine/purchase.js.map +1 -0
  116. package/lib/module/engine/purchaseFailure.js +72 -0
  117. package/lib/module/engine/purchaseFailure.js.map +1 -0
  118. package/lib/module/engine/receiptValidation.js +87 -0
  119. package/lib/module/engine/receiptValidation.js.map +1 -0
  120. package/lib/module/engine/state.js +196 -0
  121. package/lib/module/engine/state.js.map +1 -0
  122. package/lib/module/engine/subscriptions.js +119 -0
  123. package/lib/module/engine/subscriptions.js.map +1 -0
  124. package/lib/module/engine/sync.js +158 -0
  125. package/lib/module/engine/sync.js.map +1 -0
  126. package/lib/module/entitlements/aggregate.js +204 -0
  127. package/lib/module/entitlements/aggregate.js.map +1 -0
  128. package/lib/module/entitlements/mapping.js +35 -0
  129. package/lib/module/entitlements/mapping.js.map +1 -0
  130. package/lib/module/entitlements/policy.js +104 -0
  131. package/lib/module/entitlements/policy.js.map +1 -0
  132. package/lib/module/index.js +59 -0
  133. package/lib/module/index.js.map +1 -0
  134. package/lib/module/package.json +1 -0
  135. package/lib/module/persistence/mmkv-store.js +144 -0
  136. package/lib/module/persistence/mmkv-store.js.map +1 -0
  137. package/lib/module/persistence/snapshot.js +221 -0
  138. package/lib/module/persistence/snapshot.js.map +1 -0
  139. package/lib/module/react/PaymentProvider.js +90 -0
  140. package/lib/module/react/PaymentProvider.js.map +1 -0
  141. package/lib/module/react/hooks.js +192 -0
  142. package/lib/module/react/hooks.js.map +1 -0
  143. package/lib/module/testing/conformance.js +130 -0
  144. package/lib/module/testing/conformance.js.map +1 -0
  145. package/lib/module/testing/fakeStore.js +276 -0
  146. package/lib/module/testing/fakeStore.js.map +1 -0
  147. package/lib/module/testing/index.js +13 -0
  148. package/lib/module/testing/index.js.map +1 -0
  149. package/lib/typescript/commonjs/adapter/createStoreProvider.d.ts +45 -0
  150. package/lib/typescript/commonjs/adapter/createStoreProvider.d.ts.map +1 -0
  151. package/lib/typescript/commonjs/adapter/iap-adapter.d.ts +80 -0
  152. package/lib/typescript/commonjs/adapter/iap-adapter.d.ts.map +1 -0
  153. package/lib/typescript/commonjs/adapter/iapShapes.d.ts +94 -0
  154. package/lib/typescript/commonjs/adapter/iapShapes.d.ts.map +1 -0
  155. package/lib/typescript/commonjs/adapter/port.d.ts +184 -0
  156. package/lib/typescript/commonjs/adapter/port.d.ts.map +1 -0
  157. package/lib/typescript/commonjs/config/types.d.ts +326 -0
  158. package/lib/typescript/commonjs/config/types.d.ts.map +1 -0
  159. package/lib/typescript/commonjs/config/validate.d.ts +63 -0
  160. package/lib/typescript/commonjs/config/validate.d.ts.map +1 -0
  161. package/lib/typescript/commonjs/core/mutex.d.ts +17 -0
  162. package/lib/typescript/commonjs/core/mutex.d.ts.map +1 -0
  163. package/lib/typescript/commonjs/core/retry.d.ts +19 -0
  164. package/lib/typescript/commonjs/core/retry.d.ts.map +1 -0
  165. package/lib/typescript/commonjs/core/timers.d.ts +142 -0
  166. package/lib/typescript/commonjs/core/timers.d.ts.map +1 -0
  167. package/lib/typescript/commonjs/diagnostics/errors.d.ts +55 -0
  168. package/lib/typescript/commonjs/diagnostics/errors.d.ts.map +1 -0
  169. package/lib/typescript/commonjs/diagnostics/events.d.ts +158 -0
  170. package/lib/typescript/commonjs/diagnostics/events.d.ts.map +1 -0
  171. package/lib/typescript/commonjs/diagnostics/messageKeys.d.ts +54 -0
  172. package/lib/typescript/commonjs/diagnostics/messageKeys.d.ts.map +1 -0
  173. package/lib/typescript/commonjs/engine/connection.d.ts +30 -0
  174. package/lib/typescript/commonjs/engine/connection.d.ts.map +1 -0
  175. package/lib/typescript/commonjs/engine/engine.d.ts +93 -0
  176. package/lib/typescript/commonjs/engine/engine.d.ts.map +1 -0
  177. package/lib/typescript/commonjs/engine/finalize.d.ts +53 -0
  178. package/lib/typescript/commonjs/engine/finalize.d.ts.map +1 -0
  179. package/lib/typescript/commonjs/engine/foreground.d.ts +15 -0
  180. package/lib/typescript/commonjs/engine/foreground.d.ts.map +1 -0
  181. package/lib/typescript/commonjs/engine/internals.d.ts +28 -0
  182. package/lib/typescript/commonjs/engine/internals.d.ts.map +1 -0
  183. package/lib/typescript/commonjs/engine/pending.d.ts +51 -0
  184. package/lib/typescript/commonjs/engine/pending.d.ts.map +1 -0
  185. package/lib/typescript/commonjs/engine/products.d.ts +82 -0
  186. package/lib/typescript/commonjs/engine/products.d.ts.map +1 -0
  187. package/lib/typescript/commonjs/engine/purchase.d.ts +61 -0
  188. package/lib/typescript/commonjs/engine/purchase.d.ts.map +1 -0
  189. package/lib/typescript/commonjs/engine/purchaseFailure.d.ts +15 -0
  190. package/lib/typescript/commonjs/engine/purchaseFailure.d.ts.map +1 -0
  191. package/lib/typescript/commonjs/engine/receiptValidation.d.ts +42 -0
  192. package/lib/typescript/commonjs/engine/receiptValidation.d.ts.map +1 -0
  193. package/lib/typescript/commonjs/engine/state.d.ts +46 -0
  194. package/lib/typescript/commonjs/engine/state.d.ts.map +1 -0
  195. package/lib/typescript/commonjs/engine/subscriptions.d.ts +61 -0
  196. package/lib/typescript/commonjs/engine/subscriptions.d.ts.map +1 -0
  197. package/lib/typescript/commonjs/engine/sync.d.ts +36 -0
  198. package/lib/typescript/commonjs/engine/sync.d.ts.map +1 -0
  199. package/lib/typescript/commonjs/entitlements/aggregate.d.ts +97 -0
  200. package/lib/typescript/commonjs/entitlements/aggregate.d.ts.map +1 -0
  201. package/lib/typescript/commonjs/entitlements/mapping.d.ts +27 -0
  202. package/lib/typescript/commonjs/entitlements/mapping.d.ts.map +1 -0
  203. package/lib/typescript/commonjs/entitlements/policy.d.ts +75 -0
  204. package/lib/typescript/commonjs/entitlements/policy.d.ts.map +1 -0
  205. package/lib/typescript/commonjs/index.d.ts +44 -0
  206. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  207. package/lib/typescript/commonjs/package.json +1 -0
  208. package/lib/typescript/commonjs/persistence/mmkv-store.d.ts +45 -0
  209. package/lib/typescript/commonjs/persistence/mmkv-store.d.ts.map +1 -0
  210. package/lib/typescript/commonjs/persistence/snapshot.d.ts +106 -0
  211. package/lib/typescript/commonjs/persistence/snapshot.d.ts.map +1 -0
  212. package/lib/typescript/commonjs/react/PaymentProvider.d.ts +57 -0
  213. package/lib/typescript/commonjs/react/PaymentProvider.d.ts.map +1 -0
  214. package/lib/typescript/commonjs/react/hooks.d.ts +80 -0
  215. package/lib/typescript/commonjs/react/hooks.d.ts.map +1 -0
  216. package/lib/typescript/commonjs/testing/conformance.d.ts +41 -0
  217. package/lib/typescript/commonjs/testing/conformance.d.ts.map +1 -0
  218. package/lib/typescript/commonjs/testing/fakeStore.d.ts +69 -0
  219. package/lib/typescript/commonjs/testing/fakeStore.d.ts.map +1 -0
  220. package/lib/typescript/commonjs/testing/index.d.ts +12 -0
  221. package/lib/typescript/commonjs/testing/index.d.ts.map +1 -0
  222. package/lib/typescript/module/adapter/createStoreProvider.d.ts +45 -0
  223. package/lib/typescript/module/adapter/createStoreProvider.d.ts.map +1 -0
  224. package/lib/typescript/module/adapter/iap-adapter.d.ts +80 -0
  225. package/lib/typescript/module/adapter/iap-adapter.d.ts.map +1 -0
  226. package/lib/typescript/module/adapter/iapShapes.d.ts +94 -0
  227. package/lib/typescript/module/adapter/iapShapes.d.ts.map +1 -0
  228. package/lib/typescript/module/adapter/port.d.ts +184 -0
  229. package/lib/typescript/module/adapter/port.d.ts.map +1 -0
  230. package/lib/typescript/module/config/types.d.ts +326 -0
  231. package/lib/typescript/module/config/types.d.ts.map +1 -0
  232. package/lib/typescript/module/config/validate.d.ts +63 -0
  233. package/lib/typescript/module/config/validate.d.ts.map +1 -0
  234. package/lib/typescript/module/core/mutex.d.ts +17 -0
  235. package/lib/typescript/module/core/mutex.d.ts.map +1 -0
  236. package/lib/typescript/module/core/retry.d.ts +19 -0
  237. package/lib/typescript/module/core/retry.d.ts.map +1 -0
  238. package/lib/typescript/module/core/timers.d.ts +142 -0
  239. package/lib/typescript/module/core/timers.d.ts.map +1 -0
  240. package/lib/typescript/module/diagnostics/errors.d.ts +55 -0
  241. package/lib/typescript/module/diagnostics/errors.d.ts.map +1 -0
  242. package/lib/typescript/module/diagnostics/events.d.ts +158 -0
  243. package/lib/typescript/module/diagnostics/events.d.ts.map +1 -0
  244. package/lib/typescript/module/diagnostics/messageKeys.d.ts +54 -0
  245. package/lib/typescript/module/diagnostics/messageKeys.d.ts.map +1 -0
  246. package/lib/typescript/module/engine/connection.d.ts +30 -0
  247. package/lib/typescript/module/engine/connection.d.ts.map +1 -0
  248. package/lib/typescript/module/engine/engine.d.ts +93 -0
  249. package/lib/typescript/module/engine/engine.d.ts.map +1 -0
  250. package/lib/typescript/module/engine/finalize.d.ts +53 -0
  251. package/lib/typescript/module/engine/finalize.d.ts.map +1 -0
  252. package/lib/typescript/module/engine/foreground.d.ts +15 -0
  253. package/lib/typescript/module/engine/foreground.d.ts.map +1 -0
  254. package/lib/typescript/module/engine/internals.d.ts +28 -0
  255. package/lib/typescript/module/engine/internals.d.ts.map +1 -0
  256. package/lib/typescript/module/engine/pending.d.ts +51 -0
  257. package/lib/typescript/module/engine/pending.d.ts.map +1 -0
  258. package/lib/typescript/module/engine/products.d.ts +82 -0
  259. package/lib/typescript/module/engine/products.d.ts.map +1 -0
  260. package/lib/typescript/module/engine/purchase.d.ts +61 -0
  261. package/lib/typescript/module/engine/purchase.d.ts.map +1 -0
  262. package/lib/typescript/module/engine/purchaseFailure.d.ts +15 -0
  263. package/lib/typescript/module/engine/purchaseFailure.d.ts.map +1 -0
  264. package/lib/typescript/module/engine/receiptValidation.d.ts +42 -0
  265. package/lib/typescript/module/engine/receiptValidation.d.ts.map +1 -0
  266. package/lib/typescript/module/engine/state.d.ts +46 -0
  267. package/lib/typescript/module/engine/state.d.ts.map +1 -0
  268. package/lib/typescript/module/engine/subscriptions.d.ts +61 -0
  269. package/lib/typescript/module/engine/subscriptions.d.ts.map +1 -0
  270. package/lib/typescript/module/engine/sync.d.ts +36 -0
  271. package/lib/typescript/module/engine/sync.d.ts.map +1 -0
  272. package/lib/typescript/module/entitlements/aggregate.d.ts +97 -0
  273. package/lib/typescript/module/entitlements/aggregate.d.ts.map +1 -0
  274. package/lib/typescript/module/entitlements/mapping.d.ts +27 -0
  275. package/lib/typescript/module/entitlements/mapping.d.ts.map +1 -0
  276. package/lib/typescript/module/entitlements/policy.d.ts +75 -0
  277. package/lib/typescript/module/entitlements/policy.d.ts.map +1 -0
  278. package/lib/typescript/module/index.d.ts +44 -0
  279. package/lib/typescript/module/index.d.ts.map +1 -0
  280. package/lib/typescript/module/package.json +1 -0
  281. package/lib/typescript/module/persistence/mmkv-store.d.ts +45 -0
  282. package/lib/typescript/module/persistence/mmkv-store.d.ts.map +1 -0
  283. package/lib/typescript/module/persistence/snapshot.d.ts +106 -0
  284. package/lib/typescript/module/persistence/snapshot.d.ts.map +1 -0
  285. package/lib/typescript/module/react/PaymentProvider.d.ts +57 -0
  286. package/lib/typescript/module/react/PaymentProvider.d.ts.map +1 -0
  287. package/lib/typescript/module/react/hooks.d.ts +80 -0
  288. package/lib/typescript/module/react/hooks.d.ts.map +1 -0
  289. package/lib/typescript/module/testing/conformance.d.ts +41 -0
  290. package/lib/typescript/module/testing/conformance.d.ts.map +1 -0
  291. package/lib/typescript/module/testing/fakeStore.d.ts +69 -0
  292. package/lib/typescript/module/testing/fakeStore.d.ts.map +1 -0
  293. package/lib/typescript/module/testing/index.d.ts +12 -0
  294. package/lib/typescript/module/testing/index.d.ts.map +1 -0
  295. package/package.json +49 -13
  296. package/skills/sdk-rn-payment/SKILL.md +4 -4
  297. package/src/adapter/iap-adapter.ts +12 -216
  298. package/src/adapter/iapShapes.ts +232 -0
  299. package/src/config/types.ts +8 -0
  300. package/src/config/validate.ts +19 -4
  301. package/src/core/retry.ts +1 -58
  302. package/src/diagnostics/events.ts +1 -1
  303. package/src/engine/connection.ts +194 -0
  304. package/src/engine/engine.ts +140 -700
  305. package/src/engine/internals.ts +40 -0
  306. package/src/engine/products.ts +39 -17
  307. package/src/engine/purchase.ts +22 -130
  308. package/src/engine/purchaseFailure.ts +48 -0
  309. package/src/engine/receiptValidation.ts +101 -0
  310. package/src/engine/state.ts +253 -0
  311. package/src/engine/sync.ts +161 -0
  312. package/src/entitlements/aggregate.ts +3 -5
  313. package/src/entitlements/mapping.ts +0 -22
  314. package/src/persistence/mmkv-store.ts +10 -3
  315. package/src/persistence/snapshot.ts +102 -27
  316. package/src/react/PaymentProvider.tsx +73 -24
  317. package/src/react/hooks.ts +13 -3
@@ -0,0 +1,393 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createIapAdapter = createIapAdapter;
7
+ Object.defineProperty(exports, "toProviderPurchaseState", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _iapShapes.toProviderPurchaseState;
11
+ }
12
+ });
13
+ exports.toRequestProps = toRequestProps;
14
+ var _rnCore = require("@chipmobilesdk/rn-core");
15
+ var _iapShapes = require("./iapShapes.js");
16
+ var _errors = require("../diagnostics/errors.js");
17
+ /**
18
+ * Android adapter over `react-native-iap` (Play Billing).
19
+ *
20
+ * **The only file in this package that touches the billing library.** Everything
21
+ * above it talks to `ProviderPort`, which is what keeps the binding replaceable
22
+ * and lets an iOS adapter be added without changing a consumer call (FR-002,
23
+ * FR-007). ESLint enforces that boundary.
24
+ *
25
+ * ## Verified against react-native-iap 16.7.3
26
+ *
27
+ * 0.3.0 was written before the binding was installed, from its documentation, and
28
+ * no purchase could complete on a device. Checked against the installed 16.7.3
29
+ * source for 0.3.1, two facts shape the purchase path:
30
+ *
31
+ * - The request is keyed by store: `google` / `apple`. 0.3.0 sent `android`, which
32
+ * the binding rejects (`empty-sku-list`) before Play opens. The request type is
33
+ * now the binding's own `RequestPurchaseProps`, so a renamed key fails to
34
+ * typecheck here instead of failing on a user's device.
35
+ * - On Android `requestPurchase` resolves with an **empty list** once the flow
36
+ * ends, whatever happened. The outcome (bought, pending, cancelled, failed)
37
+ * arrives only through `purchaseUpdatedListener` / `purchaseErrorListener`, so
38
+ * `launchPurchase` waits for those events.
39
+ *
40
+ * The module is still required lazily, and `IapModule` still names exactly the
41
+ * surface used. `__tests__/iap-adapter.test.ts` drives this file through a fake
42
+ * binding that behaves as 16.7.3 does; the rest of the suite uses the fake store.
43
+ *
44
+ * ## Known upstream defect this guards against
45
+ *
46
+ * openiap#408: the Android bridge did not clear its internal `isInitialized` flag
47
+ * on disconnect, so `connected` stayed true, later calls failed with
48
+ * `E_NOT_PREPARED`, and `reconnect()` reported success without rebuilding
49
+ * anything. This adapter therefore (a) tracks connection state itself rather than
50
+ * trusting the binding's flag, and (b) always performs a full
51
+ * `endConnection` + `initConnection` cycle instead of calling any reconnect
52
+ * shortcut.
53
+ */
54
+
55
+ // Translation lives in `iapShapes`; it is published from here, where every
56
+ // consumer has always imported it from.
57
+
58
+ /**
59
+ * Exactly what this adapter needs from the binding.
60
+ *
61
+ * Declared narrowly on purpose: it documents the coupling, and it means a binding
62
+ * upgrade that changes one of these shapes fails to typecheck here instead of
63
+ * failing silently at runtime on a user's device.
64
+ */
65
+
66
+ /**
67
+ * How long to wait for the outcome event after `requestPurchase` has resolved.
68
+ * The binding emits the event before or as it resolves, so this only bounds the
69
+ * case where none ever comes; it never runs while the user is in Play's UI.
70
+ */
71
+ const RESULT_EVENT_GRACE_MS = 2_000;
72
+
73
+ /** Play's replacement modes, by the codes the engine passes (`engine/subscriptions.ts`). */
74
+ const REPLACEMENT_MODES = {
75
+ WITH_TIME_PRORATION: 'with-time-proration',
76
+ CHARGE_FULL_PRICE: 'charge-full-price',
77
+ CHARGE_PRORATED_PRICE: 'charge-prorated-price',
78
+ DEFERRED: 'deferred'
79
+ };
80
+
81
+ /** The request in the binding's 16.7 shape: keyed `google`, not `android`. */
82
+ function toRequestProps(request) {
83
+ const google = {
84
+ skus: [request.storeProductId],
85
+ ...(request.obfuscatedAccountId ? {
86
+ obfuscatedAccountId: request.obfuscatedAccountId
87
+ } : {})
88
+ };
89
+ if (request.productType !== 'subscription') {
90
+ return {
91
+ request: {
92
+ google
93
+ },
94
+ type: 'in-app'
95
+ };
96
+ }
97
+ const replacementMode = request.prorationMode ? REPLACEMENT_MODES[request.prorationMode] : undefined;
98
+ return {
99
+ request: {
100
+ google: {
101
+ ...google,
102
+ ...(request.offerKey ? {
103
+ subscriptionOffers: [{
104
+ sku: request.storeProductId,
105
+ offerToken: request.offerKey
106
+ }]
107
+ } : {}),
108
+ // A plan change: the token of the purchase being replaced, and — for
109
+ // the replacement mode to apply — its product id (Billing 8.1+).
110
+ ...(request.replacePurchaseToken ? {
111
+ purchaseToken: request.replacePurchaseToken
112
+ } : {}),
113
+ ...(request.replacePurchaseToken && request.replaceStoreProductId && replacementMode ? {
114
+ subscriptionProductReplacementParams: {
115
+ oldProductId: request.replaceStoreProductId,
116
+ replacementMode
117
+ }
118
+ } : {})
119
+ }
120
+ },
121
+ type: 'subs'
122
+ };
123
+ }
124
+ const iapPeer = (0, _rnCore.lazyPeer)('react-native-iap', () => {
125
+ // Inside `try`, so Metro bundles an app that leaves this optional peer out.
126
+ try {
127
+ return require('react-native-iap');
128
+ } catch (cause) {
129
+ throw cause;
130
+ }
131
+ });
132
+ function loadModule() {
133
+ return iapPeer.require((peer, cause) => new _errors.PaymentError({
134
+ code: 'PAYMENT_UNAVAILABLE',
135
+ message: `${peer} is not installed or its native module is not linked`,
136
+ operation: 'initialize',
137
+ cause: (0, _errors.redact)(cause)
138
+ }));
139
+ }
140
+ const ANDROID_CAPABILITIES = {
141
+ supportsSubscriptions: true,
142
+ supportsPlanChange: true,
143
+ supportsPriceChangeConfirmation: false,
144
+ /**
145
+ * False, and this is a platform fact rather than a gap in this adapter.
146
+ *
147
+ * Client-side Play Billing cannot separate grace period from account hold: a
148
+ * grace-period subscription is still returned as active, and one in account
149
+ * hold stops being returned at all — indistinguishable from expired, cancelled,
150
+ * or refunded. The entitlement layer reads this flag and reports
151
+ * `indeterminate` rather than inventing a distinction (research.md R5).
152
+ */
153
+ reportsGraceAndHoldDistinctly: false,
154
+ supportsExternalTransactions: false,
155
+ /** This one really does move money, which is what arms the environment guard. */
156
+ createsRealTransactions: true,
157
+ /** The outcome event comes only when the user leaves Play's purchase UI. */
158
+ purchaseOutcomeIncludesStoreTime: true
159
+ };
160
+ function createIapAdapter(options = {}) {
161
+ let iap = options.module;
162
+
163
+ /** Tracked here, never read from the binding — see the openiap#408 note above. */
164
+ let connected = false;
165
+ const connectionListeners = (0, _rnCore.createListenerSet)();
166
+ const purchaseListeners = (0, _rnCore.createListenerSet)();
167
+ /** Only an in-flight `launchPurchase` listens here; see there. */
168
+ const purchaseErrorListeners = (0, _rnCore.createListenerSet)();
169
+ let updateSub;
170
+ let errorSub;
171
+ const module = () => {
172
+ if (!iap) {
173
+ iap = loadModule();
174
+ }
175
+ return iap;
176
+ };
177
+ const notifyConnection = (next, reason) => {
178
+ if (connected === next) {
179
+ return;
180
+ }
181
+ connected = next;
182
+ connectionListeners.notify(next, reason);
183
+ };
184
+ const attachListeners = () => {
185
+ // Every connect attaches, so whatever an earlier connect left must go first.
186
+ // Overwriting the handles orphaned the old native listeners, which kept
187
+ // firing — every purchase update reached the engine once per connect.
188
+ detachListeners();
189
+ const mod = module();
190
+ updateSub = mod.purchaseUpdatedListener(raw => {
191
+ purchaseListeners.notify((0, _iapShapes.normalizePurchase)(raw));
192
+ });
193
+ errorSub = mod.purchaseErrorListener(error => {
194
+ // A `not-prepared` error is the one signal the binding gives that the
195
+ // service went away underneath us, so it is treated as a disconnect
196
+ // rather than as a purchase failure.
197
+ if ((0, _iapShapes.mapErrorCode)(error.code) === 'not_ready') {
198
+ notifyConnection(false, 'not_prepared');
199
+ }
200
+ purchaseErrorListeners.notify(error);
201
+ });
202
+ };
203
+ const detachListeners = () => {
204
+ updateSub?.remove();
205
+ updateSub = undefined;
206
+ errorSub?.remove();
207
+ errorSub = undefined;
208
+ };
209
+ return {
210
+ async connect() {
211
+ try {
212
+ const mod = module();
213
+ // Always a full cycle. The binding's own reconnect has reported success
214
+ // without rebuilding anything, so we never rely on it (openiap#408).
215
+ if (connected) {
216
+ await mod.endConnection().catch(() => undefined);
217
+ connected = false;
218
+ }
219
+ const ok = await mod.initConnection();
220
+ if (!ok) {
221
+ return {
222
+ ok: false,
223
+ reason: 'no_billing_service',
224
+ retryable: true
225
+ };
226
+ }
227
+ attachListeners();
228
+ notifyConnection(true);
229
+ return {
230
+ ok: true
231
+ };
232
+ } catch (error) {
233
+ const code = error.code;
234
+ // A missing or too-old Play Services install is not the same as a
235
+ // transient error, and the app shows different things for each (FR-021).
236
+ if (code === 'E_IAP_NOT_AVAILABLE' || code === 'iap-not-available') {
237
+ return {
238
+ ok: false,
239
+ reason: 'no_billing_service',
240
+ retryable: false
241
+ };
242
+ }
243
+ if (code === 'E_SERVICE_ERROR') {
244
+ return {
245
+ ok: false,
246
+ reason: 'billing_service_outdated',
247
+ retryable: true
248
+ };
249
+ }
250
+ return {
251
+ ok: false,
252
+ reason: 'store_error',
253
+ retryable: true
254
+ };
255
+ }
256
+ },
257
+ async disconnect() {
258
+ detachListeners();
259
+ try {
260
+ await module().endConnection();
261
+ } catch {
262
+ // Already down; nothing to tear down.
263
+ }
264
+ notifyConnection(false, 'disconnect');
265
+ },
266
+ observeConnection(listener) {
267
+ return connectionListeners.add(listener);
268
+ },
269
+ async queryProducts(storeProductIds, productType) {
270
+ const raw = await module().fetchProducts({
271
+ skus: storeProductIds,
272
+ type: productType === 'subscription' ? 'subs' : 'in-app'
273
+ });
274
+ return raw.map(product => (0, _iapShapes.normalizeProduct)(product, productType));
275
+ },
276
+ async queryOwned() {
277
+ const raw = await module().getAvailablePurchases();
278
+ // Pending purchases are mapped through, flagged rather than filtered: the
279
+ // engine needs to see them to raise the pending signal (FR-038).
280
+ return raw.map(_iapShapes.normalizePurchase);
281
+ },
282
+ /**
283
+ * Settles on the first outcome event for this product: a purchase update
284
+ * (bought or pending) or a purchase error (cancelled, already owned, …).
285
+ *
286
+ * The binding's promise is not the outcome: on Android it resolves with an
287
+ * empty list when the flow ends, whatever happened. Its listeners also feed
288
+ * `observePurchases`, so the engine sees a bought purchase twice — here and
289
+ * as a store update — and grants it once (FR-044).
290
+ */
291
+ launchPurchase(request) {
292
+ const sku = request.storeProductId;
293
+ return new Promise(resolve => {
294
+ let settled = false;
295
+ let grace;
296
+ const onPurchase = purchase => {
297
+ if (purchase.storeProductId === sku) {
298
+ finish({
299
+ ok: true,
300
+ purchase
301
+ });
302
+ }
303
+ };
304
+ const onError = error => {
305
+ if (error.productId && error.productId !== sku) {
306
+ return;
307
+ }
308
+ finish({
309
+ ok: false,
310
+ reason: (0, _iapShapes.mapErrorCode)(error.code),
311
+ detail: error.code
312
+ });
313
+ };
314
+ const fail = error => {
315
+ const code = error?.code;
316
+ finish({
317
+ ok: false,
318
+ reason: (0, _iapShapes.mapErrorCode)(code),
319
+ detail: code
320
+ });
321
+ };
322
+ function finish(outcome) {
323
+ if (settled) {
324
+ return;
325
+ }
326
+ settled = true;
327
+ clearTimeout(grace);
328
+ stopPurchase();
329
+ stopError();
330
+ resolve(outcome);
331
+ }
332
+ const stopPurchase = purchaseListeners.add(onPurchase);
333
+ const stopError = purchaseErrorListeners.add(onError);
334
+ try {
335
+ module().requestPurchase(toRequestProps(request)).then(() => {
336
+ if (!settled) {
337
+ grace = setTimeout(() => finish({
338
+ ok: false,
339
+ reason: 'store_error',
340
+ detail: 'no purchase event'
341
+ }), RESULT_EVENT_GRACE_MS);
342
+ }
343
+ }, fail);
344
+ } catch (error) {
345
+ fail(error);
346
+ }
347
+ });
348
+ },
349
+ observePurchases(listener) {
350
+ return purchaseListeners.add(listener);
351
+ },
352
+ async acknowledge(token) {
353
+ // Idempotent at the store: acknowledging an already-acknowledged purchase
354
+ // is accepted, which is what FR-044 relies on.
355
+ await module().finishTransaction({
356
+ purchase: {
357
+ purchaseToken: token
358
+ },
359
+ isConsumable: false
360
+ });
361
+ },
362
+ async consume(token) {
363
+ await module().finishTransaction({
364
+ purchase: {
365
+ purchaseToken: token
366
+ },
367
+ isConsumable: true
368
+ });
369
+ },
370
+ async openSubscriptionManagement(storeProductId) {
371
+ // The store's own screen. Platforms forbid a self-built cancellation
372
+ // screen, so there is deliberately no alternative path here (FR-066).
373
+ const mod = module();
374
+ if (!mod.deepLinkToSubscriptions) {
375
+ return;
376
+ }
377
+ await mod.deepLinkToSubscriptions({
378
+ skuAndroid: storeProductId
379
+ });
380
+ },
381
+ async confirmPriceChange() {
382
+ // Play has no client-side price-change confirmation flow; it notifies the
383
+ // user itself. Reported as unsupported rather than faked, matching
384
+ // `supportsPriceChangeConfirmation: false` (FR-067).
385
+ return {
386
+ ok: false,
387
+ reason: 'store_error'
388
+ };
389
+ },
390
+ capabilities: () => ANDROID_CAPABILITIES
391
+ };
392
+ }
393
+ //# sourceMappingURL=iap-adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_rnCore","require","_iapShapes","_errors","RESULT_EVENT_GRACE_MS","REPLACEMENT_MODES","WITH_TIME_PRORATION","CHARGE_FULL_PRICE","CHARGE_PRORATED_PRICE","DEFERRED","toRequestProps","request","google","skus","storeProductId","obfuscatedAccountId","productType","type","replacementMode","prorationMode","undefined","offerKey","subscriptionOffers","sku","offerToken","replacePurchaseToken","purchaseToken","replaceStoreProductId","subscriptionProductReplacementParams","oldProductId","iapPeer","lazyPeer","cause","loadModule","peer","PaymentError","code","message","operation","redact","ANDROID_CAPABILITIES","supportsSubscriptions","supportsPlanChange","supportsPriceChangeConfirmation","reportsGraceAndHoldDistinctly","supportsExternalTransactions","createsRealTransactions","purchaseOutcomeIncludesStoreTime","createIapAdapter","options","iap","module","connected","connectionListeners","createListenerSet","purchaseListeners","purchaseErrorListeners","updateSub","errorSub","notifyConnection","next","reason","notify","attachListeners","detachListeners","mod","purchaseUpdatedListener","raw","normalizePurchase","purchaseErrorListener","error","mapErrorCode","remove","connect","endConnection","catch","ok","initConnection","retryable","disconnect","observeConnection","listener","add","queryProducts","storeProductIds","fetchProducts","map","product","normalizeProduct","queryOwned","getAvailablePurchases","launchPurchase","Promise","resolve","settled","grace","onPurchase","purchase","finish","onError","productId","detail","fail","outcome","clearTimeout","stopPurchase","stopError","requestPurchase","then","setTimeout","observePurchases","acknowledge","token","finishTransaction","isConsumable","consume","openSubscriptionManagement","deepLinkToSubscriptions","skuAndroid","confirmPriceChange","capabilities"],"sourceRoot":"../../../src","sources":["adapter/iap-adapter.ts"],"mappings":";;;;;;;;;;;;;AAsCA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AAQA,IAAAE,OAAA,GAAAF,OAAA;AAnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA6BA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;AACA,MAAMG,qBAAqB,GAAG,KAAK;;AAEnC;AACA,MAAMC,iBAAqE,GAAG;EAC7EC,mBAAmB,EAAE,qBAAqB;EAC1CC,iBAAiB,EAAE,mBAAmB;EACtCC,qBAAqB,EAAE,uBAAuB;EAC9CC,QAAQ,EAAE;AACX,CAAC;;AAED;AACO,SAASC,cAAcA,CAACC,OAAgC,EAAwB;EACtF,MAAMC,MAAM,GAAG;IACdC,IAAI,EAAE,CAACF,OAAO,CAACG,cAAc,CAAC;IAC9B,IAAIH,OAAO,CAACI,mBAAmB,GAAG;MAAEA,mBAAmB,EAAEJ,OAAO,CAACI;IAAoB,CAAC,GAAG,CAAC,CAAC;EAC5F,CAAC;EACD,IAAIJ,OAAO,CAACK,WAAW,KAAK,cAAc,EAAE;IAC3C,OAAO;MAAEL,OAAO,EAAE;QAA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AEC,UAAU,EAAExG;MAAe,CAAC,CAAC;IAClE,CAAC;IAED,MAAMyG,kBAAkBA,CAAA,EAAwC;MAC/D;MACA;MACA;MACA,OAAO;QAAE3C,EAAE,EAAE,KAAK;QAAEf,MAAM,EAAE;MAAc,CAAC;IAC5C,CAAC;IAED2D,YAAY,EAAEA,CAAA,KAAMhF;EACrB,CAAC;AACF","ignoreList":[]}
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.mapErrorCode = mapErrorCode;
7
+ exports.normalizeOffer = normalizeOffer;
8
+ exports.normalizeProduct = normalizeProduct;
9
+ exports.normalizePurchase = normalizePurchase;
10
+ exports.toMicros = toMicros;
11
+ exports.toProviderPurchaseState = toProviderPurchaseState;
12
+ /**
13
+ * The binding's shapes, and their translation into the port's vocabulary
14
+ * (PAY-12).
15
+ *
16
+ * The binding speaks Google Play: prices as micros in strings, offer tokens,
17
+ * numeric purchase states, store error codes. The port speaks this package's
18
+ * own. Keeping the translation here, with no I/O, no listeners and no module
19
+ * loading, is what makes it checkable against recorded payloads — and leaves
20
+ * the adapter next door about the calls it actually makes.
21
+ *
22
+ * The raw types are declared narrowly on purpose: they document the coupling,
23
+ * and a binding upgrade that changes one of these shapes fails to typecheck
24
+ * here rather than failing silently on a user's device.
25
+ */
26
+
27
+ /** What `purchaseErrorListener` delivers. */
28
+
29
+ /** Play's `PurchaseState`: 0 unspecified, 1 purchased, 2 pending. */
30
+ const PLAY_STATE_PURCHASED = 1;
31
+ const PLAY_STATE_PENDING = 2;
32
+
33
+ // Required lazily (rn-core's lazy peer) so importing the package does not require
34
+ // the native module.
35
+
36
+ function toMicros(value) {
37
+ if (typeof value === 'number') {
38
+ return value;
39
+ }
40
+ if (typeof value === 'string') {
41
+ const parsed = Number.parseInt(value, 10);
42
+ return Number.isFinite(parsed) ? parsed : 0;
43
+ }
44
+ return 0;
45
+ }
46
+ function normalizeProduct(raw, productType) {
47
+ const oneTime = raw.oneTimePurchaseOfferDetails;
48
+ const currencyCode = oneTime?.priceCurrencyCode ?? raw.currencyCode ?? raw.currency ?? '';
49
+ return {
50
+ storeProductId: raw.id ?? raw.productId ?? '',
51
+ productType,
52
+ title: raw.title ?? raw.name ?? '',
53
+ description: raw.description ?? '',
54
+ // Store-formatted, never built here: only the store knows the right currency
55
+ // symbol, separator, and placement for the user's locale (FR-028).
56
+ formattedPrice: oneTime?.formattedPrice ?? raw.displayPrice ?? raw.localizedPrice ?? '',
57
+ currencyCode,
58
+ priceAmountMicros: toMicros(oneTime?.priceAmountMicros ?? raw.price),
59
+ offers: (raw.subscriptionOfferDetails ?? []).map(offer => normalizeOffer(offer, currencyCode))
60
+ };
61
+ }
62
+ function normalizeOffer(offer, fallbackCurrency) {
63
+ const phases = offer.pricingPhases?.pricingPhaseList ?? [];
64
+ // The last phase is the recurring price; earlier ones are trial or
65
+ // introductory. Play orders them that way.
66
+ const recurring = phases[phases.length - 1];
67
+ const intro = phases.length > 1 ? phases[0] : undefined;
68
+ const isFreeTrial = intro !== undefined && toMicros(intro.priceAmountMicros) === 0;
69
+ return {
70
+ offerKey: offer.offerToken ?? offer.offerId ?? offer.basePlanId ?? '',
71
+ billingPeriod: recurring?.billingPeriod ?? '',
72
+ formattedPrice: recurring?.formattedPrice ?? '',
73
+ priceAmountMicros: toMicros(recurring?.priceAmountMicros),
74
+ currencyCode: recurring?.priceCurrencyCode ?? fallbackCurrency,
75
+ trialPeriod: isFreeTrial ? intro?.billingPeriod : undefined,
76
+ introductoryPrice: intro && !isFreeTrial ? {
77
+ formattedPrice: intro.formattedPrice ?? '',
78
+ period: intro.billingPeriod ?? '',
79
+ cycles: intro.billingCycleCount ?? 1
80
+ } : undefined,
81
+ // Play decides eligibility by only returning offers the user qualifies for,
82
+ // so forwarding `true` reports the store's determination rather than
83
+ // computing our own (FR-026).
84
+ isEligible: true
85
+ };
86
+ }
87
+
88
+ /**
89
+ * Reads the purchase state from whichever field the binding filled.
90
+ *
91
+ * Pending is preserved, never flattened to purchased: that distinction is what
92
+ * stops an entitlement being granted for money that has not arrived (FR-037).
93
+ * And an unrecognized or missing state is `unspecified`, never `purchased`.
94
+ *
95
+ * 0.1.0 read only Play's numeric state and treated anything else as purchased.
96
+ * The 16.x binding hands JavaScript the *string* state and does not carry the
97
+ * numeric one across, so on a device every pending purchase arrived as a string,
98
+ * fell through to the default, and was granted. Unit tests could not see it: they
99
+ * drive the fake store, which never passes through here.
100
+ */
101
+ function toProviderPurchaseState(raw) {
102
+ let numeric;
103
+ if (typeof raw.purchaseStateAndroid === 'number') {
104
+ numeric = raw.purchaseStateAndroid;
105
+ } else if (typeof raw.purchaseState === 'number') {
106
+ numeric = raw.purchaseState;
107
+ }
108
+ if (numeric !== undefined) {
109
+ if (numeric === PLAY_STATE_PENDING) {
110
+ return 'pending';
111
+ }
112
+ return numeric === PLAY_STATE_PURCHASED ? 'purchased' : 'unspecified';
113
+ }
114
+ switch (typeof raw.purchaseState === 'string' ? raw.purchaseState.toLowerCase() : '') {
115
+ case 'purchased':
116
+ case 'restored':
117
+ return 'purchased';
118
+ case 'pending':
119
+ case 'deferred':
120
+ return 'pending';
121
+ default:
122
+ return 'unspecified';
123
+ }
124
+ }
125
+ function normalizePurchase(raw) {
126
+ return {
127
+ storeProductId: raw.productId ?? raw.ids?.[0] ?? '',
128
+ transactionId: raw.id ?? raw.transactionId ?? raw.purchaseToken ?? '',
129
+ token: raw.purchaseToken ?? '',
130
+ state: toProviderPurchaseState(raw),
131
+ purchasedAt: raw.transactionDate ?? Date.now(),
132
+ isAcknowledged: raw.isAcknowledgedAndroid ?? raw.isAcknowledged ?? false,
133
+ expiresAt: raw.expirationDateAndroid,
134
+ willAutoRenew: raw.autoRenewingAndroid ?? raw.isAutoRenewing,
135
+ // Opaque material for the app's backend. Carried here and handed to the
136
+ // validation hook only — never logged or put in an event (FR-074).
137
+ verificationPayload: raw.transactionReceipt ?? raw.dataAndroid
138
+ };
139
+ }
140
+
141
+ /** Maps a binding error code onto the port's vocabulary, so no store code escapes. */
142
+ function mapErrorCode(code) {
143
+ switch (code) {
144
+ case 'E_USER_CANCELLED':
145
+ case 'user-cancelled':
146
+ return 'user_cancelled';
147
+ case 'E_ALREADY_OWNED':
148
+ case 'already-owned':
149
+ case 'item-already-owned':
150
+ return 'already_owned';
151
+ case 'E_ITEM_UNAVAILABLE':
152
+ case 'item-unavailable':
153
+ case 'sku-not-found':
154
+ return 'unknown_product';
155
+ case 'E_NOT_PREPARED':
156
+ case 'not-prepared':
157
+ return 'not_ready';
158
+ case 'E_NETWORK_ERROR':
159
+ case 'network-error':
160
+ return 'network_error';
161
+ case 'E_DEFERRED_PAYMENT':
162
+ // Not a failure — a pending purchase. The caller resolves it from the
163
+ // purchase update rather than from this error.
164
+ return 'store_error';
165
+ default:
166
+ return 'store_error';
167
+ }
168
+ }
169
+ //# sourceMappingURL=iapShapes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PLAY_STATE_PURCHASED","PLAY_STATE_PENDING","toMicros","value","parsed","Number","parseInt","isFinite","normalizeProduct","raw","productType","oneTime","oneTimePurchaseOfferDetails","currencyCode","priceCurrencyCode","currency","storeProductId","id","productId","title","name","description","formattedPrice","displayPrice","localizedPrice","priceAmountMicros","price","offers","subscriptionOfferDetails","map","offer","normalizeOffer","fallbackCurrency","phases","pricingPhases","pricingPhaseList","recurring","length","intro","undefined","isFreeTrial","offerKey","offerToken","offerId","basePlanId","billingPeriod","trialPeriod","introductoryPrice","period","cycles","billingCycleCount","isEligible","toProviderPurchaseState","numeric","purchaseStateAndroid","purchaseState","toLowerCase","normalizePurchase","ids","transactionId","purchaseToken","token","state","purchasedAt","transactionDate","Date","now","isAcknowledged","isAcknowledgedAndroid","expiresAt","expirationDateAndroid","willAutoRenew","autoRenewingAndroid","isAutoRenewing","verificationPayload","transactionReceipt","dataAndroid","mapErrorCode","code"],"sourceRoot":"../../../src","sources":["adapter/iapShapes.ts"],"mappings":";;;;;;;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AAC2D,qBAAqB,IAAI3D,GAAG,CAAC0D,cAAc,IAAI,KAAK;IACxEE,SAAS,EAAE5D,GAAG,CAAC6D,qBAAqB;IACpCC,aAAa,EAAE9D,GAAG,CAAC+D,mBAAmB,IAAI/D,GAAG,CAACgE,cAAc;IAC5D;IACA;IACAC,mBAAmB,EAAEjE,GAAG,CAACkE,kBAAkB,IAAIlE,GAAG,CAACmE;EACpD,CAAC;AACF;;AAEA;AACO,SAASC,YAAYA,CAACC,IAAwB,EAAyB;EAC7E,QAAQA,IAAI;IACX,KAAK,kBAAkB;IACvB,KAAK,gBAAgB;MACpB,OAAO,gBAAgB;IACxB,KAAK,iBAAiB;IACtB,KAAK,eAAe;IACpB,KAAK,oBAAoB;MACxB,OAAO,eAAe;IACvB,KAAK,oBAAoB;IACzB,KAAK,kBAAkB;IACvB,KAAK,eAAe;MACnB,OAAO,iBAAiB;IACzB,KAAK,gBAAgB;IACrB,KAAK,cAAc;MAClB,OAAO,WAAW;IACnB,KAAK,iBAAiB;IACtB,KAAK,eAAe;MACnB,OAAO,eAAe;IACvB,KAAK,oBAAoB;MACxB;MACA;MACA,OAAO,aAAa;IACrB;MACC,OAAO,aAAa;EACtB;AACD","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=port.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["adapter/port.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["config/types.ts"],"mappings":"","ignoreList":[]}