@soltech/fluid-common 0.1.11 → 0.1.13

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
@@ -50,6 +50,17 @@ export interface PaymentMethod {
50
50
  maxAmount: number;
51
51
  info: string;
52
52
  paymentType: PaymentType;
53
+ inputFields: InputField[];
54
+ }
55
+ export interface ProviderTypeInput {
56
+ name: string;
57
+ providerType: string;
58
+ inputFields: InputField[];
59
+ }
60
+ export interface InputField {
61
+ paramName: string;
62
+ format: string;
63
+ localisedText: Map<string, string>;
53
64
  }
54
65
  export interface RecentMethod extends PaymentMethod {
55
66
  accountId: string;
@@ -102,8 +113,10 @@ export interface TransactionOptions {
102
113
  userAgent?: string;
103
114
  }
104
115
  export interface TransactionResult {
116
+ error?: ProviderTransactionError;
105
117
  redirectOutput?: RedirectOutput;
106
- status: string;
118
+ state: TransactionState;
119
+ statusCode: string;
107
120
  transactionId: string;
108
121
  }
109
122
  export interface RedirectOutput {
@@ -113,3 +126,19 @@ export interface RedirectOutput {
113
126
  width?: number;
114
127
  url: string;
115
128
  }
129
+ export declare enum TransactionState {
130
+ SUCCESS = "SUCCESS",
131
+ FAIL = "FAIL",
132
+ PROCESSING = "PROCESSING",
133
+ WAITING_INPUT = "WAITING_INPUT"
134
+ }
135
+ export interface ProviderTransactionError {
136
+ code: string;
137
+ text: string;
138
+ action: ErrorAction;
139
+ }
140
+ export declare enum ErrorAction {
141
+ RETURN_STEP1 = "RETURN_STEP1",
142
+ RETURN_STEP2 = "RETURN_STEP2",
143
+ BLOCK_DEPOSITS = "BLOCK_DEPOSITS"
144
+ }
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.13",
4
4
  "type": "module",
5
5
  "description": "Fluid frontend and API commons",
6
6
  "main": "lib/index.js",
package/src/index.ts CHANGED
@@ -59,6 +59,19 @@ export interface PaymentMethod {
59
59
  maxAmount: number;
60
60
  info: string;
61
61
  paymentType: PaymentType;
62
+ inputFields: InputField[];
63
+ }
64
+
65
+ export interface ProviderTypeInput {
66
+ name: string;
67
+ providerType: string;
68
+ inputFields: InputField[];
69
+ }
70
+
71
+ export interface InputField {
72
+ paramName: string;
73
+ format: string;
74
+ localisedText: Map<string, string>;
62
75
  }
63
76
 
64
77
  export interface RecentMethod extends PaymentMethod {
@@ -118,8 +131,10 @@ export interface TransactionOptions {
118
131
  }
119
132
 
120
133
  export interface TransactionResult {
134
+ error?: ProviderTransactionError;
121
135
  redirectOutput?: RedirectOutput;
122
- status: string;
136
+ state: TransactionState;
137
+ statusCode: string;
123
138
  transactionId: string;
124
139
  }
125
140
 
@@ -131,3 +146,22 @@ export interface RedirectOutput {
131
146
  url: string;
132
147
  }
133
148
 
149
+ export enum TransactionState {
150
+ SUCCESS = 'SUCCESS',
151
+ FAIL = 'FAIL',
152
+ PROCESSING = 'PROCESSING',
153
+ WAITING_INPUT = 'WAITING_INPUT'
154
+ }
155
+
156
+ export interface ProviderTransactionError {
157
+ code: string;
158
+ text: string;
159
+ action: ErrorAction;
160
+ }
161
+
162
+ export enum ErrorAction {
163
+ RETURN_STEP1 = 'RETURN_STEP1',
164
+ RETURN_STEP2 = 'RETURN_STEP2',
165
+ BLOCK_DEPOSITS = 'BLOCK_DEPOSITS'
166
+ }
167
+