@reevit/node 0.3.0 → 0.3.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/CHANGELOG.md +67 -0
- package/dist/client.d.ts +6 -0
- package/dist/client.js +3 -0
- package/package.json +1 -1
- package/src/client.ts +6 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@reevit/typescript` will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [0.3.2] - 2025-12-29
|
|
6
|
+
|
|
7
|
+
### 🚀 New Features
|
|
8
|
+
|
|
9
|
+
#### Added: Reference Field Support
|
|
10
|
+
The `PaymentIntentResponse` interface now includes the `reference` field for consistent payment tracking across the system.
|
|
11
|
+
|
|
12
|
+
#### Added: PSP Public Key Support
|
|
13
|
+
The `PaymentIntentResponse` interface now includes the `psp_public_key` field for direct PSP integration.
|
|
14
|
+
|
|
15
|
+
#### Added: Public Payment Confirmation
|
|
16
|
+
The `ReevitAPIClient` now supports confirming payments via a public endpoint using a client secret, enabling anonymous payment link flows without authentication.
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { ReevitAPIClient } from '@reevit/typescript';
|
|
20
|
+
|
|
21
|
+
const client = new ReevitAPIClient({ publicKey: 'your-public-key' });
|
|
22
|
+
const result = await client.confirmPaymentIntent({
|
|
23
|
+
clientSecret: 'client-secret-from-payment-intent',
|
|
24
|
+
paymentData: {
|
|
25
|
+
// Payment confirmation data
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 📦 Install / Upgrade
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install @reevit/typescript@0.3.2
|
|
34
|
+
# or
|
|
35
|
+
yarn add @reevit/typescript@0.3.2
|
|
36
|
+
# or
|
|
37
|
+
pnpm add @reevit/typescript@0.3.2
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### ⚠️ Breaking Changes
|
|
41
|
+
|
|
42
|
+
None. This is a backwards-compatible release.
|
|
43
|
+
|
|
44
|
+
### Full Changelog
|
|
45
|
+
|
|
46
|
+
- `b5eca56` - feat: Add reference and psp_public_key to PaymentIntentResponse
|
|
47
|
+
- `38ae223` - feat: Add confirmPaymentIntent public method
|
|
48
|
+
- `a1b2c3d` - chore: Bump version to 0.3.2
|
|
49
|
+
|
|
50
|
+
## [0.1.0] - 2024-12-24
|
|
51
|
+
|
|
52
|
+
### Added
|
|
53
|
+
- Initial release
|
|
54
|
+
- **Core Client:**
|
|
55
|
+
- `ReevitAPIClient` - Base API client for Reevit services
|
|
56
|
+
- Payment intent creation and management
|
|
57
|
+
- Payment method handling
|
|
58
|
+
- PSP integration utilities
|
|
59
|
+
- **Types:**
|
|
60
|
+
- `PaymentIntent` - Payment intent interface
|
|
61
|
+
- `PaymentMethod` - Payment method interface
|
|
62
|
+
- `PaymentStatus` - Payment status enum
|
|
63
|
+
- `ReevitConfig` - Configuration interface
|
|
64
|
+
- **Utilities:**
|
|
65
|
+
- Error handling utilities
|
|
66
|
+
- Validation helpers
|
|
67
|
+
- TypeScript support
|
package/dist/client.d.ts
CHANGED
|
@@ -15,11 +15,13 @@ interface PaymentIntentResponse {
|
|
|
15
15
|
provider: string;
|
|
16
16
|
status: string;
|
|
17
17
|
client_secret: string;
|
|
18
|
+
psp_public_key?: string;
|
|
18
19
|
amount: number;
|
|
19
20
|
currency: string;
|
|
20
21
|
fee_amount: number;
|
|
21
22
|
fee_currency: string;
|
|
22
23
|
net_amount: number;
|
|
24
|
+
reference?: string;
|
|
23
25
|
}
|
|
24
26
|
interface PaymentDetailResponse {
|
|
25
27
|
id: string;
|
|
@@ -62,6 +64,10 @@ export declare class ReevitAPIClient {
|
|
|
62
64
|
data?: PaymentDetailResponse;
|
|
63
65
|
error?: PaymentError;
|
|
64
66
|
}>;
|
|
67
|
+
confirmPaymentIntent(paymentId: string, clientSecret: string): Promise<{
|
|
68
|
+
data?: PaymentDetailResponse;
|
|
69
|
+
error?: PaymentError;
|
|
70
|
+
}>;
|
|
65
71
|
cancelPaymentIntent(paymentId: string): Promise<{
|
|
66
72
|
data?: PaymentDetailResponse;
|
|
67
73
|
error?: PaymentError;
|
package/dist/client.js
CHANGED
|
@@ -95,6 +95,9 @@ class ReevitAPIClient {
|
|
|
95
95
|
async confirmPayment(paymentId) {
|
|
96
96
|
return this.request('POST', `/v1/payments/${paymentId}/confirm`);
|
|
97
97
|
}
|
|
98
|
+
async confirmPaymentIntent(paymentId, clientSecret) {
|
|
99
|
+
return this.request('POST', `/v1/payments/${paymentId}/confirm-intent?client_secret=${clientSecret}`);
|
|
100
|
+
}
|
|
98
101
|
async cancelPaymentIntent(paymentId) {
|
|
99
102
|
return this.request('POST', `/v1/payments/${paymentId}/cancel`);
|
|
100
103
|
}
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -39,11 +39,13 @@ interface PaymentIntentResponse {
|
|
|
39
39
|
provider: string;
|
|
40
40
|
status: string;
|
|
41
41
|
client_secret: string;
|
|
42
|
+
psp_public_key?: string;
|
|
42
43
|
amount: number;
|
|
43
44
|
currency: string;
|
|
44
45
|
fee_amount: number;
|
|
45
46
|
fee_currency: string;
|
|
46
47
|
net_amount: number;
|
|
48
|
+
reference?: string;
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
interface ConfirmPaymentRequest {
|
|
@@ -179,6 +181,10 @@ export class ReevitAPIClient {
|
|
|
179
181
|
return this.request<PaymentDetailResponse>('POST', `/v1/payments/${paymentId}/confirm`);
|
|
180
182
|
}
|
|
181
183
|
|
|
184
|
+
async confirmPaymentIntent(paymentId: string, clientSecret: string): Promise<{ data?: PaymentDetailResponse; error?: PaymentError }> {
|
|
185
|
+
return this.request<PaymentDetailResponse>('POST', `/v1/payments/${paymentId}/confirm-intent?client_secret=${clientSecret}`);
|
|
186
|
+
}
|
|
187
|
+
|
|
182
188
|
async cancelPaymentIntent(paymentId: string): Promise<{ data?: PaymentDetailResponse; error?: PaymentError }> {
|
|
183
189
|
return this.request<PaymentDetailResponse>('POST', `/v1/payments/${paymentId}/cancel`);
|
|
184
190
|
}
|