@tagadapay/plugin-sdk 2.0.2 → 2.1.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.
- package/README.md +24 -17
- package/dist/index.d.ts +8 -25
- package/dist/index.js +9 -29
- package/package.json +13 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TagadaPay Plugin SDK
|
|
2
2
|
|
|
3
|
-
A comprehensive SDK for building
|
|
3
|
+
A comprehensive React SDK for building plugins on the TagadaPay platform. Create custom checkout experiences, landing pages, and interactive components with automatic configuration injection and advanced routing capabilities.pnpm
|
|
4
4
|
|
|
5
5
|
## 📚 Documentation
|
|
6
6
|
|
|
@@ -181,33 +181,40 @@ const { storeId, accountId, basePath, config } = usePluginConfig();
|
|
|
181
181
|
|
|
182
182
|
## 🎯 Key Features
|
|
183
183
|
|
|
184
|
-
###
|
|
184
|
+
### 🔧 **Plugin Configuration System**
|
|
185
|
+
|
|
186
|
+
- **Automatic Context Injection** - Store ID, Account ID, and custom config
|
|
187
|
+
- **Development & Production** - Seamless environment switching
|
|
188
|
+
- **Generic Configuration** - Support for any JSON structure
|
|
189
|
+
- **React Hooks** - Clean, type-safe configuration access
|
|
190
|
+
|
|
191
|
+
### 💳 **Payment Processing**
|
|
185
192
|
|
|
186
193
|
- Secure tokenized payments
|
|
187
194
|
- Multiple payment method support
|
|
188
195
|
- Real-time validation
|
|
189
196
|
- PCI compliance
|
|
190
197
|
|
|
191
|
-
###
|
|
198
|
+
### 🌍 **Address & Location**
|
|
192
199
|
|
|
193
|
-
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
-
|
|
200
|
+
- **Google Places Autocomplete** - Automatic API loading and address parsing
|
|
201
|
+
- **ISO Country/Region Data** - Complete ISO 3166-1/3166-2 database
|
|
202
|
+
- **Address Validation** - Structured component extraction
|
|
203
|
+
- **Multi-language Support** - 11+ languages for international users
|
|
197
204
|
|
|
198
|
-
###
|
|
205
|
+
### 🛒 **E-commerce Features**
|
|
199
206
|
|
|
200
|
-
- Dynamic pricing
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
207
|
+
- Dynamic pricing and promotional offers
|
|
208
|
+
- Cart management and tax calculations
|
|
209
|
+
- Currency conversion and formatting
|
|
210
|
+
- Customer profile management
|
|
204
211
|
|
|
205
|
-
### UI
|
|
212
|
+
### 🎨 **UI & Development**
|
|
206
213
|
|
|
207
|
-
- Pre-built
|
|
208
|
-
- Customizable themes
|
|
209
|
-
- Mobile-optimized
|
|
210
|
-
-
|
|
214
|
+
- Pre-built React components
|
|
215
|
+
- Customizable themes with configuration
|
|
216
|
+
- Mobile-optimized and accessible
|
|
217
|
+
- TypeScript support throughout
|
|
211
218
|
|
|
212
219
|
## 📖 API Reference
|
|
213
220
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,33 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tagada Pay Plugin SDK
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Core SDK for building Tagada Pay plugins
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* For React-specific functionality, use:
|
|
7
7
|
* ```tsx
|
|
8
8
|
* import { TagadaProvider, useCustomer } from '@tagadapay/plugin-sdk/react';
|
|
9
|
-
*
|
|
10
|
-
* function App() {
|
|
11
|
-
* return (
|
|
12
|
-
* <TagadaProvider>
|
|
13
|
-
* <MyPlugin />
|
|
14
|
-
* </TagadaProvider>
|
|
15
|
-
* );
|
|
16
|
-
* }
|
|
17
|
-
*
|
|
18
|
-
* function MyPlugin() {
|
|
19
|
-
* const { customer, isAuthenticated } = useCustomer();
|
|
20
|
-
*
|
|
21
|
-
* return (
|
|
22
|
-
* <div>
|
|
23
|
-
* {isAuthenticated ? (
|
|
24
|
-
* <p>Welcome back, {customer.firstName}!</p>
|
|
25
|
-
* ) : (
|
|
26
|
-
* <p>Welcome, guest!</p>
|
|
27
|
-
* )}
|
|
28
|
-
* </div>
|
|
29
|
-
* );
|
|
30
|
-
* }
|
|
31
9
|
* ```
|
|
10
|
+
*
|
|
11
|
+
* This main export contains non-React utilities and types.
|
|
32
12
|
*/
|
|
33
|
-
export
|
|
13
|
+
export type { Currency, Customer, Environment, EnvironmentConfig, Locale, Order, OrderAddress, OrderItem, OrderSummary, PickupPoint, Session, Store, } from './react/types';
|
|
14
|
+
export { convertCurrency, formatMoney, formatMoneyWithoutSymbol, formatSimpleMoney, getCurrencyInfo, minorUnitsToMajorUnits, moneyStringOrNumberToMinorUnits, } from './react/utils/money';
|
|
15
|
+
export * from './data/countries';
|
|
16
|
+
export * from './data/iso3166';
|
package/dist/index.js
CHANGED
|
@@ -1,37 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tagada Pay Plugin SDK
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Core SDK for building Tagada Pay plugins
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* For React-specific functionality, use:
|
|
7
7
|
* ```tsx
|
|
8
8
|
* import { TagadaProvider, useCustomer } from '@tagadapay/plugin-sdk/react';
|
|
9
|
-
*
|
|
10
|
-
* function App() {
|
|
11
|
-
* return (
|
|
12
|
-
* <TagadaProvider>
|
|
13
|
-
* <MyPlugin />
|
|
14
|
-
* </TagadaProvider>
|
|
15
|
-
* );
|
|
16
|
-
* }
|
|
17
|
-
*
|
|
18
|
-
* function MyPlugin() {
|
|
19
|
-
* const { customer, isAuthenticated } = useCustomer();
|
|
20
|
-
*
|
|
21
|
-
* return (
|
|
22
|
-
* <div>
|
|
23
|
-
* {isAuthenticated ? (
|
|
24
|
-
* <p>Welcome back, {customer.firstName}!</p>
|
|
25
|
-
* ) : (
|
|
26
|
-
* <p>Welcome, guest!</p>
|
|
27
|
-
* )}
|
|
28
|
-
* </div>
|
|
29
|
-
* );
|
|
30
|
-
* }
|
|
31
9
|
* ```
|
|
10
|
+
*
|
|
11
|
+
* This main export contains non-React utilities and types.
|
|
32
12
|
*/
|
|
33
|
-
// Export
|
|
34
|
-
export
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
|
|
13
|
+
// Export utility functions that don't depend on React
|
|
14
|
+
export { convertCurrency, formatMoney, formatMoneyWithoutSymbol, formatSimpleMoney, getCurrencyInfo, minorUnitsToMajorUnits, moneyStringOrNumberToMinorUnits, } from './react/utils/money';
|
|
15
|
+
// Export data utilities
|
|
16
|
+
export * from './data/countries';
|
|
17
|
+
export * from './data/iso3166';
|
package/package.json
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tagadapay/plugin-sdk",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Modern React SDK for building Tagada Pay plugins",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./react": {
|
|
14
|
+
"types": "./dist/react/index.d.ts",
|
|
15
|
+
"import": "./dist/react/index.js",
|
|
16
|
+
"require": "./dist/react/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
7
19
|
"scripts": {
|
|
8
20
|
"build": "tsc",
|
|
9
21
|
"clean": "rm -rf dist",
|