@starfish-codes/hellgate 1.0.0-alpha.7 → 2.0.0-beta.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 CHANGED
@@ -1,5 +1,8 @@
1
1
  # Hellgate 2.0 Headless Web SDK
2
2
 
3
+ [![CI](https://github.com/starfish-codes/hgate2-headless-web-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/starfish-codes/hgate2-headless-web-sdk/actions/workflows/ci.yml?query=branch%3Amain)
4
+ [![codecov](https://codecov.io/gh/starfish-codes/hgate2-headless-web-sdk/graph/badge.svg?token=bw5V0iIWHe)](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 '../../session';
1
+ import { HellgateSession } from '../session';
2
2
  export declare class Hellgate3DSHandler {
3
3
  private session;
4
- private domContainer;
5
4
  private iframeId;
5
+ private resultPollingTimer?;
6
+ private transactionId?;
7
+ private decoupledAuthHandlers;
6
8
  private disposers;
7
9
  private check3dsIframeDisposers;
10
+ private domContainer;
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<void>;
25
+ process: (additionalData?: PaymentAdditionalData) => Promise<import("../session").CompleteActionResult>;
26
26
  private hasFormElements;
27
27
  private disableFormElements;
28
28
  private extractAdditionalData;