@dicty/payment 2.0.1 → 2.0.2

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 (2) hide show
  1. package/README.md +36 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,14 +1,46 @@
1
- # @dicty/stripe
1
+ # @dicty/payment
2
2
 
3
- Dicty Stripe plugin
3
+ Dicty Payment Plugin for Capacitor apps
4
4
 
5
- ## Install
5
+ ## Overview
6
+
7
+ `@dicty/payment` bridges Capacitor projects to native Apple in-app purchases and Google Pay flows. It ships with TypeScript definitions, a React context provider, and native shims for iOS, Android, and the web fallback.
8
+
9
+ ## Installation
6
10
 
7
11
  ```bash
8
- npm install @dicty/stripe
12
+ npm install @dicty/payment
9
13
  npx cap sync
10
14
  ```
11
15
 
16
+ After syncing, open Android Studio/Xcode to let Gradle/CocoaPods refresh native dependencies.
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import { Payment } from '@dicty/payment';
22
+
23
+ const available = await Payment.isAppleInAppPurchaseAvailable();
24
+ if (available) {
25
+ const { products } = await Payment.getAppleInAppPurchaseProducts({ id: ['premium_monthly'] });
26
+ await Payment.buyAppleInAppPurchase({ id: products[0].id });
27
+ }
28
+ ```
29
+
30
+ For React apps, wrap your tree with the provider:
31
+
32
+ ```tsx
33
+ import { PaymentPluginProvider } from '@dicty/payment/react';
34
+
35
+ <PaymentPluginProvider>{children}</PaymentPluginProvider>;
36
+ ```
37
+
38
+ ## Development
39
+
40
+ - `npm run build` cleans, regenerates docs, compiles TypeScript, and bundles output via Rollup.
41
+ - `npm run verify` runs iOS, Android, and web checks; execute before publishing changes.
42
+ - `npm run fmt` formats TypeScript, Java, and Swift sources; `npm run lint` performs the read-only equivalent.
43
+
12
44
  ## API
13
45
 
14
46
  <docgen-index>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dicty/payment",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Dicty Payment plugin",
5
5
  "type": "module",
6
6
  "main": "dist/plugin.cjs.js",