@payconductor/react 1.0.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 +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# @payconductor
|
|
1
|
+
# @payconductor/react
|
|
2
2
|
|
|
3
3
|
React SDK for [PayConductor](https://payconductor.ai) payment integration.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/@payconductor/react)
|
|
6
6
|
|
|
7
7
|
## Requirements
|
|
8
8
|
|
|
@@ -11,13 +11,13 @@ Minimum React version: **v16.8**.
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install @payconductor
|
|
14
|
+
npm install @payconductor/react @payconductor/sdk
|
|
15
15
|
# or
|
|
16
|
-
yarn add @payconductor
|
|
16
|
+
yarn add @payconductor/react @payconductor/sdk
|
|
17
17
|
# or
|
|
18
|
-
pnpm add @payconductor
|
|
18
|
+
pnpm add @payconductor/react @payconductor/sdk
|
|
19
19
|
# or
|
|
20
|
-
bun add @payconductor
|
|
20
|
+
bun add @payconductor/react @payconductor/sdk
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Quick Start
|
|
@@ -30,14 +30,14 @@ import {
|
|
|
30
30
|
usePayconductorElement,
|
|
31
31
|
type PaymentMethod,
|
|
32
32
|
type PaymentResult,
|
|
33
|
-
} from '@payconductor
|
|
33
|
+
} from '@payconductor/react';
|
|
34
34
|
import {
|
|
35
35
|
AvailablePaymentMethods,
|
|
36
36
|
Configuration,
|
|
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',
|
|
@@ -221,7 +221,7 @@ import type {
|
|
|
221
221
|
PicPayPaymentData,
|
|
222
222
|
CardPaymentData,
|
|
223
223
|
BillingDetails,
|
|
224
|
-
} from '@payconductor
|
|
224
|
+
} from '@payconductor/react';
|
|
225
225
|
```
|
|
226
226
|
|
|
227
227
|
## Payment Flow
|
|
@@ -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
|
|