@soltech/fluid-common 0.1.11 → 0.1.12

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/lib/index.d.ts CHANGED
@@ -102,8 +102,10 @@ export interface TransactionOptions {
102
102
  userAgent?: string;
103
103
  }
104
104
  export interface TransactionResult {
105
+ error?: ProviderTransactionError;
105
106
  redirectOutput?: RedirectOutput;
106
- status: string;
107
+ state: TransactionState;
108
+ statusCode: string;
107
109
  transactionId: string;
108
110
  }
109
111
  export interface RedirectOutput {
@@ -113,3 +115,19 @@ export interface RedirectOutput {
113
115
  width?: number;
114
116
  url: string;
115
117
  }
118
+ export declare enum TransactionState {
119
+ SUCCESS = "SUCCESS",
120
+ FAIL = "FAIL",
121
+ PROCESSING = "PROCESSING",
122
+ WAITING_INPUT = "WAITING_INPUT"
123
+ }
124
+ export interface ProviderTransactionError {
125
+ code: string;
126
+ text: string;
127
+ action: ErrorAction;
128
+ }
129
+ export declare enum ErrorAction {
130
+ RETURN_STEP1 = "RETURN_STEP1",
131
+ RETURN_STEP2 = "RETURN_STEP2",
132
+ BLOCK_DEPOSITS = "BLOCK_DEPOSITS"
133
+ }
package/lib/index.js CHANGED
@@ -18,3 +18,16 @@ export var PaymentType;
18
18
  PaymentType["PREPAID_CARD"] = "PrepaidCard";
19
19
  PaymentType["VOUCHER"] = "Voucher";
20
20
  })(PaymentType || (PaymentType = {}));
21
+ export var TransactionState;
22
+ (function (TransactionState) {
23
+ TransactionState["SUCCESS"] = "SUCCESS";
24
+ TransactionState["FAIL"] = "FAIL";
25
+ TransactionState["PROCESSING"] = "PROCESSING";
26
+ TransactionState["WAITING_INPUT"] = "WAITING_INPUT";
27
+ })(TransactionState || (TransactionState = {}));
28
+ export var ErrorAction;
29
+ (function (ErrorAction) {
30
+ ErrorAction["RETURN_STEP1"] = "RETURN_STEP1";
31
+ ErrorAction["RETURN_STEP2"] = "RETURN_STEP2";
32
+ ErrorAction["BLOCK_DEPOSITS"] = "BLOCK_DEPOSITS";
33
+ })(ErrorAction || (ErrorAction = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soltech/fluid-common",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "type": "module",
5
5
  "description": "Fluid frontend and API commons",
6
6
  "main": "lib/index.js",
package/src/index.ts CHANGED
@@ -118,8 +118,10 @@ export interface TransactionOptions {
118
118
  }
119
119
 
120
120
  export interface TransactionResult {
121
+ error?: ProviderTransactionError;
121
122
  redirectOutput?: RedirectOutput;
122
- status: string;
123
+ state: TransactionState;
124
+ statusCode: string;
123
125
  transactionId: string;
124
126
  }
125
127
 
@@ -131,3 +133,22 @@ export interface RedirectOutput {
131
133
  url: string;
132
134
  }
133
135
 
136
+ export enum TransactionState {
137
+ SUCCESS = 'SUCCESS',
138
+ FAIL = 'FAIL',
139
+ PROCESSING = 'PROCESSING',
140
+ WAITING_INPUT = 'WAITING_INPUT'
141
+ }
142
+
143
+ export interface ProviderTransactionError {
144
+ code: string;
145
+ text: string;
146
+ action: ErrorAction;
147
+ }
148
+
149
+ export enum ErrorAction {
150
+ RETURN_STEP1 = 'RETURN_STEP1',
151
+ RETURN_STEP2 = 'RETURN_STEP2',
152
+ BLOCK_DEPOSITS = 'BLOCK_DEPOSITS'
153
+ }
154
+