@autofleet/element-pay 1.0.1-beta-166bc228.0 → 1.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.
- package/README.md +45 -0
- package/lib/index.cjs.map +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +2 -3
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Element Pay
|
|
2
|
+
|
|
3
|
+
GraphQL client for the Element Pay third-party payment provider.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @autofleet/element-pay
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { createElementPayClient } from '@autofleet/element-pay';
|
|
15
|
+
|
|
16
|
+
const client = createElementPayClient({
|
|
17
|
+
endpoint: 'https://api.car-iq.example.com/graphql',
|
|
18
|
+
apiKey: 'your-api-key',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// Create an organization
|
|
22
|
+
await client.organizationCreate({ input: { ... } });
|
|
23
|
+
|
|
24
|
+
// Create an entity
|
|
25
|
+
await client.entityCreate({ input: { ... } });
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## API
|
|
29
|
+
|
|
30
|
+
### `createElementPayClient(config)`
|
|
31
|
+
|
|
32
|
+
Returns a typed GraphQL SDK client for the Element Pay API.
|
|
33
|
+
|
|
34
|
+
| Option | Type | Description |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| `endpoint` | `string` | Element Pay GraphQL endpoint URL |
|
|
37
|
+
| `apiKey` | `string` | API key sent as `x-api-key` header |
|
|
38
|
+
|
|
39
|
+
## Code Generation
|
|
40
|
+
|
|
41
|
+
The SDK is generated from GraphQL schema definitions. To regenerate:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pnpm codegen --filter @autofleet/element-pay
|
|
45
|
+
```
|