@soltech/fluid-common 0.1.2 → 0.1.4

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
@@ -8,12 +8,12 @@ export declare enum TraitType {
8
8
  TEXT = "TEXT"
9
9
  }
10
10
  export declare enum PaymentType {
11
- BANK_TRANSFER = 0,
12
- CREDIT_CARD = 1,
13
- CRYPTO = 2,
14
- DIGITAL_WALLET = 3,
15
- PREPAID_CARD = 4,
16
- VOUCHER = 5
11
+ BankTransfer = 0,
12
+ CreditCard = 1,
13
+ Crypto = 2,
14
+ DigitalWallet = 3,
15
+ PrepaidCard = 4,
16
+ Voucher = 5
17
17
  }
18
18
  export interface WalletRequestBody {
19
19
  payload?: object | string;
@@ -51,10 +51,11 @@ export interface PaymentMethod {
51
51
  info: string;
52
52
  paymentType: PaymentType;
53
53
  }
54
- export interface RecentMethod extends PaymentMethod {
54
+ export interface RecentMethod {
55
55
  accountId: string;
56
56
  maskedAccount: string;
57
57
  lastSuccess: string;
58
+ paymentMethod: PaymentMethod;
58
59
  }
59
60
  export interface TransactionParams {
60
61
  accountId?: string;
@@ -98,3 +99,13 @@ export interface RedirectOutput {
98
99
  width?: number;
99
100
  url: string;
100
101
  }
102
+ export interface ProviderTransactionError {
103
+ code: string;
104
+ text: string;
105
+ action: ErrorAction;
106
+ }
107
+ export declare enum ErrorAction {
108
+ RETURN_STEP1 = "ReturnStep1",
109
+ RETURN_STEP2 = "ReturnStep2",
110
+ BLOCK_DEPOSITS = "BlockDeposits"
111
+ }
package/lib/index.js CHANGED
@@ -11,10 +11,16 @@ export var TraitType;
11
11
  })(TraitType || (TraitType = {}));
12
12
  export var PaymentType;
13
13
  (function (PaymentType) {
14
- PaymentType[PaymentType["BANK_TRANSFER"] = 0] = "BANK_TRANSFER";
15
- PaymentType[PaymentType["CREDIT_CARD"] = 1] = "CREDIT_CARD";
16
- PaymentType[PaymentType["CRYPTO"] = 2] = "CRYPTO";
17
- PaymentType[PaymentType["DIGITAL_WALLET"] = 3] = "DIGITAL_WALLET";
18
- PaymentType[PaymentType["PREPAID_CARD"] = 4] = "PREPAID_CARD";
19
- PaymentType[PaymentType["VOUCHER"] = 5] = "VOUCHER";
14
+ PaymentType[PaymentType["BankTransfer"] = 0] = "BankTransfer";
15
+ PaymentType[PaymentType["CreditCard"] = 1] = "CreditCard";
16
+ PaymentType[PaymentType["Crypto"] = 2] = "Crypto";
17
+ PaymentType[PaymentType["DigitalWallet"] = 3] = "DigitalWallet";
18
+ PaymentType[PaymentType["PrepaidCard"] = 4] = "PrepaidCard";
19
+ PaymentType[PaymentType["Voucher"] = 5] = "Voucher";
20
20
  })(PaymentType || (PaymentType = {}));
21
+ export var ErrorAction;
22
+ (function (ErrorAction) {
23
+ ErrorAction["RETURN_STEP1"] = "ReturnStep1";
24
+ ErrorAction["RETURN_STEP2"] = "ReturnStep2";
25
+ ErrorAction["BLOCK_DEPOSITS"] = "BlockDeposits";
26
+ })(ErrorAction || (ErrorAction = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soltech/fluid-common",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "description": "Fluid frontend and API commons",
6
6
  "main": "lib/index.js",
package/src/index.ts CHANGED
@@ -11,12 +11,12 @@ export enum TraitType {
11
11
  }
12
12
 
13
13
  export enum PaymentType {
14
- BANK_TRANSFER,
15
- CREDIT_CARD,
16
- CRYPTO,
17
- DIGITAL_WALLET,
18
- PREPAID_CARD,
19
- VOUCHER
14
+ BankTransfer,
15
+ CreditCard,
16
+ Crypto,
17
+ DigitalWallet,
18
+ PrepaidCard,
19
+ Voucher
20
20
  }
21
21
 
22
22
  export interface WalletRequestBody {
@@ -61,10 +61,11 @@ export interface PaymentMethod {
61
61
  paymentType: PaymentType;
62
62
  }
63
63
 
64
- export interface RecentMethod extends PaymentMethod {
64
+ export interface RecentMethod {
65
65
  accountId: string;
66
66
  maskedAccount: string;
67
67
  lastSuccess: string;
68
+ paymentMethod: PaymentMethod; //TODO extend PaymentMethod instead
68
69
  }
69
70
 
70
71
  export interface TransactionParams {
@@ -116,3 +117,15 @@ export interface RedirectOutput {
116
117
  url: string;
117
118
  }
118
119
 
120
+ export interface ProviderTransactionError {
121
+ code: string;
122
+ text: string;
123
+ action: ErrorAction;
124
+ }
125
+
126
+ export enum ErrorAction {
127
+ RETURN_STEP1 = 'ReturnStep1',
128
+ RETURN_STEP2 = 'ReturnStep2',
129
+ BLOCK_DEPOSITS = 'BlockDeposits'
130
+ }
131
+