@payconductor/react 1.0.1 → 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 +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,13 +11,13 @@ Minimum React version: **v16.8**.
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install @payconductor/react payconductor
|
|
14
|
+
npm install @payconductor/react @payconductor/sdk
|
|
15
15
|
# or
|
|
16
|
-
yarn add @payconductor/react payconductor
|
|
16
|
+
yarn add @payconductor/react @payconductor/sdk
|
|
17
17
|
# or
|
|
18
|
-
pnpm add @payconductor/react payconductor
|
|
18
|
+
pnpm add @payconductor/react @payconductor/sdk
|
|
19
19
|
# or
|
|
20
|
-
bun add @payconductor/react payconductor
|
|
20
|
+
bun add @payconductor/react @payconductor/sdk
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Quick Start
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
DocumentType,
|
|
38
38
|
OrderApi,
|
|
39
39
|
type OrderCreateRequest,
|
|
40
|
-
} from 'payconductor
|
|
40
|
+
} from '@payconductor/sdk';
|
|
41
41
|
|
|
42
42
|
const sdkConfig = new Configuration({
|
|
43
43
|
username: import.meta.env.VITE_PAYCONDUCTOR_CLIENT_ID || 'your_client_id',
|
|
@@ -58,7 +58,7 @@ function CheckoutForm() {
|
|
|
58
58
|
setErrorMessage(null);
|
|
59
59
|
|
|
60
60
|
try {
|
|
61
|
-
// 1. Create the Draft order via payconductor
|
|
61
|
+
// 1. Create the Draft order via @payconductor/sdk to get the orderId
|
|
62
62
|
const orderRequest: OrderCreateRequest = {
|
|
63
63
|
chargeAmount: 100.00,
|
|
64
64
|
clientIp: '0.0.0.0',
|
|
@@ -241,7 +241,7 @@ import type {
|
|
|
241
241
|
└─ getSelectedPaymentMethod() returns the chosen method
|
|
242
242
|
|
|
243
243
|
5. User clicks "Checkout" (your button, outside the iframe)
|
|
244
|
-
└─ payconductor
|
|
244
|
+
└─ @payconductor/sdk creates Draft order → returns orderId
|
|
245
245
|
└─ confirmPayment({ orderId })
|
|
246
246
|
└─ iframe collects form data → POST /orders/:id/confirm
|
|
247
247
|
|