@starfish-codes/hellgate 1.0.0-alpha.7 → 2.0.0-beta.1
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 +5 -0
- package/dist/{card/3ds → 3ds}/3ds-handler.d.ts +7 -1
- package/dist/3ds/mocks/mocks.d.ts +6 -0
- package/dist/3ds/typings.d.ts +49 -0
- package/dist/card/card-handler.d.ts +1 -1
- package/dist/hellgate-sdk.mjs +1201 -1130
- package/dist/hellgate-sdk.umd.js +5 -3
- package/dist/hellgate.d.ts +8 -12
- package/dist/index.d.ts +1 -0
- package/dist/session/session.d.ts +1 -1
- package/dist/session/typings.d.ts +7 -4
- package/dist/untils.d.ts +1 -1
- package/package.json +3 -2
- package/dist/card/3ds/mocks/mocks.d.ts +0 -3
- package/dist/card/3ds/typings.d.ts +0 -32
- /package/dist/{card/3ds → 3ds}/index.d.ts +0 -0
- /package/dist/{card/3ds → 3ds}/mocks/index.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Hellgate 2.0 Headless Web SDK
|
|
2
2
|
|
|
3
|
+
[](https://github.com/starfish-codes/hgate2-headless-web-sdk/actions/workflows/ci.yml?query=branch%3Amain)
|
|
4
|
+
[](https://codecov.io/gh/starfish-codes/hgate2-headless-web-sdk)
|
|
5
|
+
|
|
3
6
|
## Documentation
|
|
4
7
|
|
|
5
8
|
https://developer.hellgate.io/docs/head-less-web-sdk-overview
|
|
@@ -14,6 +17,8 @@ yarn
|
|
|
14
17
|
|
|
15
18
|
### Start Demo App in dev mode
|
|
16
19
|
|
|
20
|
+
Create `demo/.env.dev` by copying `demo/.env.dev.example` and replace its variables with a real secrets
|
|
21
|
+
|
|
17
22
|
```
|
|
18
23
|
yarn start
|
|
19
24
|
```
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import { HellgateSession } from '
|
|
1
|
+
import { HellgateSession } from '../session';
|
|
2
2
|
export declare class Hellgate3DSHandler {
|
|
3
3
|
private session;
|
|
4
4
|
private domContainer;
|
|
5
5
|
private iframeId;
|
|
6
|
+
private resultPollingTimer?;
|
|
7
|
+
private transactionId?;
|
|
8
|
+
private decoupledAuthHandlers;
|
|
6
9
|
private disposers;
|
|
7
10
|
private check3dsIframeDisposers;
|
|
8
11
|
constructor(session: HellgateSession, domContainer?: HTMLElement);
|
|
9
12
|
dispose(): void;
|
|
13
|
+
onDecoupledAuth: (fn: (cardholderInfo: string) => void) => void;
|
|
10
14
|
private sessionStateHandle;
|
|
11
15
|
private initCheck3DSIframes;
|
|
12
16
|
private disposeCheck3DSIframe;
|
|
13
17
|
private startChallenge;
|
|
18
|
+
private startDecoupledAuth;
|
|
19
|
+
private startAuthResultPolling;
|
|
14
20
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Check3DSSessionStateDTO, Do3DSChallengeDecoupledSessionStateDTO, Do3DSChallengeSessionStateDTO, _3DSChallengeResult } from '../typings';
|
|
2
|
+
export declare const sessionCheck3DSActionStateDTOMock: Check3DSSessionStateDTO;
|
|
3
|
+
export declare const sessionDo3DSChallengeActionStateDTOMock: Do3DSChallengeSessionStateDTO;
|
|
4
|
+
export declare const sessionDo3DSChallengeDecoupledSessionStateDTOMock: Do3DSChallengeDecoupledSessionStateDTO;
|
|
5
|
+
export declare const authResultNotReadyDTOMock: _3DSChallengeResult<'AuthResultNotReady'>;
|
|
6
|
+
export declare const authResultReadyDTOMock: _3DSChallengeResult<'AuthResultReady'>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export type Check3DSSessionStateDTO = {
|
|
2
|
+
next_action: '3ds_check';
|
|
3
|
+
data: {
|
|
4
|
+
threeds_server_trans_id: string;
|
|
5
|
+
threeds_server_callback_url: string;
|
|
6
|
+
mon_url: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export type Check3DSActionDTO = {
|
|
10
|
+
action: '3ds_check';
|
|
11
|
+
result: {
|
|
12
|
+
requestor_trans_id: string;
|
|
13
|
+
event: string;
|
|
14
|
+
param: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type Do3DSChallengeSessionStateDTO = {
|
|
18
|
+
next_action: '3ds_challenge';
|
|
19
|
+
data: {
|
|
20
|
+
threeds_server_trans_id: string;
|
|
21
|
+
challenge_url: string;
|
|
22
|
+
result_mon_url: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export type Do3DSChallengeActionDTO = {
|
|
26
|
+
action: '3ds_challenge';
|
|
27
|
+
result: {
|
|
28
|
+
requestor_trans_id: string;
|
|
29
|
+
event: string;
|
|
30
|
+
param?: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export type Do3DSChallengeDecoupledSessionStateDTO = {
|
|
34
|
+
next_action: '3ds_challenge_decoupled';
|
|
35
|
+
data: {
|
|
36
|
+
transaction_id: string;
|
|
37
|
+
result_mon_url: string;
|
|
38
|
+
cardholder_info: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type Do3DSChallengeDecoupledActionDTO = {
|
|
42
|
+
action: '3ds_challenge_decoupled';
|
|
43
|
+
result: _3DSChallengeResult<'AuthResultReady'>;
|
|
44
|
+
};
|
|
45
|
+
export type _3DSChallengeResult<T extends 'AuthResultNotReady' | 'AuthResultReady' = 'AuthResultNotReady' | 'AuthResultReady'> = {
|
|
46
|
+
event: T;
|
|
47
|
+
threeDSRequestorTransID: string;
|
|
48
|
+
threeDSServerTransID: string;
|
|
49
|
+
};
|
|
@@ -22,7 +22,7 @@ export declare class HellgateCardHandler {
|
|
|
22
22
|
clear: () => void;
|
|
23
23
|
reset: () => void;
|
|
24
24
|
dispose: () => void;
|
|
25
|
-
process: (additionalData?: PaymentAdditionalData) => Promise<
|
|
25
|
+
process: (additionalData?: PaymentAdditionalData) => Promise<import("../session").CompleteActionResult>;
|
|
26
26
|
private hasFormElements;
|
|
27
27
|
private disableFormElements;
|
|
28
28
|
private extractAdditionalData;
|