@akinon/pz-haso 1.112.0-snapshot-ZERO-3859-20251125183557 → 1.114.0-snapshot-ZERO-3890-20251208193442
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
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# HASO Payment Gateway Extension
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.114.0-snapshot-ZERO-3890-20251208193442
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
7
|
- cbcfdf4: ZERO-3859: Haso payment gateway implmeneted
|
|
8
|
+
- 1880978: ZERO-3890: Implemented retry cache fallback and update user aggremenet
|
|
8
9
|
|
|
9
10
|
## 1.0.0
|
|
10
11
|
|
package/package.json
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { cookies } from 'next/headers';
|
|
3
2
|
import { FormComponentProps } from '../types';
|
|
4
3
|
|
|
5
4
|
const FormComponent = ({
|
|
6
5
|
extensionUrl,
|
|
7
6
|
sessionId,
|
|
8
7
|
context,
|
|
8
|
+
csrfToken = '',
|
|
9
9
|
renderer,
|
|
10
10
|
autoSubmit = true
|
|
11
11
|
}: FormComponentProps) => {
|
|
12
|
-
const nextCookies = cookies();
|
|
13
|
-
|
|
14
12
|
const extensionUrlWithoutSlash = `${extensionUrl}`.endsWith('/')
|
|
15
13
|
? extensionUrl.slice(0, -1)
|
|
16
14
|
: extensionUrl;
|
|
17
15
|
|
|
18
|
-
const csrfToken = nextCookies.get('csrftoken')?.value ?? '';
|
|
19
|
-
|
|
20
16
|
const DefaultForm = ({
|
|
21
17
|
extensionUrl,
|
|
22
18
|
sessionId,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import settings from 'settings';
|
|
3
|
-
import { cookies } from 'next/headers';
|
|
4
3
|
import FormComponent from '../components/FormComponent';
|
|
5
4
|
import { fetchData, generateHash, getRandomString } from '../utils';
|
|
6
5
|
import { HasoPaymentGatewayProps } from '../types';
|
|
@@ -11,20 +10,20 @@ export const HasoPaymentGateway = async ({
|
|
|
11
10
|
locale,
|
|
12
11
|
extensionUrl,
|
|
13
12
|
hashKey,
|
|
13
|
+
osessionid,
|
|
14
|
+
csrfToken,
|
|
14
15
|
renderer
|
|
15
16
|
}: HasoPaymentGatewayProps) => {
|
|
16
17
|
if (!sessionId || !currency || !locale) {
|
|
17
18
|
return <></>;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
const nextCookies = cookies();
|
|
21
|
-
|
|
22
21
|
const language = settings.localization.locales.find(
|
|
23
22
|
(item: { value: string; apiValue: string }) => item.value === locale
|
|
24
23
|
)?.apiValue;
|
|
25
24
|
|
|
26
25
|
const requestHeaders = {
|
|
27
|
-
Cookie: `osessionid=${
|
|
26
|
+
Cookie: osessionid ? `osessionid=${osessionid}` : '',
|
|
28
27
|
'Content-Type': 'application/json',
|
|
29
28
|
'X-Currency': currency,
|
|
30
29
|
'X-Requested-With': 'XMLHttpRequest',
|
|
@@ -70,6 +69,7 @@ export const HasoPaymentGateway = async ({
|
|
|
70
69
|
extensionUrl={extensionUrl}
|
|
71
70
|
sessionId={sessionId}
|
|
72
71
|
context={context}
|
|
72
|
+
csrfToken={csrfToken}
|
|
73
73
|
renderer={renderer?.formComponent}
|
|
74
74
|
/>
|
|
75
75
|
</RenderContainer>
|
package/src/types.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface FormComponentProps {
|
|
|
21
21
|
extensionUrl: string;
|
|
22
22
|
sessionId: string;
|
|
23
23
|
context: any;
|
|
24
|
+
csrfToken?: string;
|
|
24
25
|
renderer?: HasoRendererProps['formComponent'];
|
|
25
26
|
autoSubmit?: boolean;
|
|
26
27
|
}
|
|
@@ -31,5 +32,7 @@ export interface HasoPaymentGatewayProps {
|
|
|
31
32
|
locale: string;
|
|
32
33
|
extensionUrl: string;
|
|
33
34
|
hashKey: string;
|
|
35
|
+
osessionid?: string;
|
|
36
|
+
csrfToken?: string;
|
|
34
37
|
renderer?: HasoRendererProps;
|
|
35
38
|
}
|