edfapay-softpos-sdk-rn 1.0.2 → 1.0.3
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/android/build.gradle +5 -1
- package/package.json +4 -3
- package/src/EdfaPayPlugin.ts +0 -551
- package/src/NativeEdfapaySoftposSdkRn.ts +0 -7
- package/src/bridge.ts +0 -106
- package/src/enums/Env.ts +0 -7
- package/src/enums/FlowType.ts +0 -5
- package/src/enums/FunctionCode.ts +0 -8
- package/src/enums/PaymentMethod.ts +0 -4
- package/src/enums/Presentation.ts +0 -12
- package/src/enums/PurchaseSecondaryAction.ts +0 -5
- package/src/enums/TransactionType.ts +0 -11
- package/src/globals.d.ts +0 -1
- package/src/index.tsx +0 -52
- package/src/models/BnplResponse.ts +0 -31
- package/src/models/EdfaPayCredentials.ts +0 -36
- package/src/models/InvoiceRequest.ts +0 -93
- package/src/models/Location.ts +0 -14
- package/src/models/Pagination.ts +0 -29
- package/src/models/PresentationConfig.ts +0 -105
- package/src/models/SdkTheme.ts +0 -64
- package/src/models/Terminal.ts +0 -41
- package/src/models/TerminalBindingTask.ts +0 -32
- package/src/models/Transaction.ts +0 -39
- package/src/models/TxnParams.ts +0 -26
- package/src/models/UserInfo.ts +0 -50
- package/src/multiply.native.tsx +0 -5
- package/src/multiply.tsx +0 -5
- package/src/namespaces/Extension.ts +0 -194
- package/src/namespaces/RemoteChannel.ts +0 -43
- package/src/namespaces/Utils.ts +0 -91
- package/src/types.ts +0 -30
package/android/build.gradle
CHANGED
|
@@ -26,6 +26,9 @@ buildscript {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
plugins {
|
|
30
|
+
id("com.edfapay.softpos.build") version "2.0.1"
|
|
31
|
+
}
|
|
29
32
|
|
|
30
33
|
apply plugin: "com.android.library"
|
|
31
34
|
apply plugin: "kotlin-android"
|
|
@@ -65,7 +68,8 @@ android {
|
|
|
65
68
|
dependencies {
|
|
66
69
|
implementation "com.facebook.react:react-android"
|
|
67
70
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:${getExtOrDefault('kotlinVersion')}"
|
|
68
|
-
implementation
|
|
71
|
+
implementation "com.edfapay:sa-edfapay-revamp:1.0.6.4"
|
|
72
|
+
// implementation project(":native-sdk")
|
|
69
73
|
}
|
|
70
74
|
|
|
71
75
|
configurations.configureEach {
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edfapay-softpos-sdk-rn",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Edfapay SoftPOS SDK helps developer to easily integrate Edfapay SoftPOS to their mobile application",
|
|
5
|
+
"scope": "edfapay/edfapay-softpos-sdk-rn",
|
|
5
6
|
"main": "./lib/module/index.js",
|
|
6
7
|
"types": "./lib/typescript/src/index.d.ts",
|
|
7
8
|
"exports": {
|
|
@@ -13,7 +14,6 @@
|
|
|
13
14
|
"./package.json": "./package.json"
|
|
14
15
|
},
|
|
15
16
|
"files": [
|
|
16
|
-
"src",
|
|
17
17
|
"lib",
|
|
18
18
|
"android",
|
|
19
19
|
"ios",
|
|
@@ -136,7 +136,8 @@
|
|
|
136
136
|
"release-it": {
|
|
137
137
|
"git": {
|
|
138
138
|
"commitMessage": "chore: release ${version}",
|
|
139
|
-
"tagName": "v${version}"
|
|
139
|
+
"tagName": "v${version}",
|
|
140
|
+
"branch": "main"
|
|
140
141
|
},
|
|
141
142
|
"npm": {
|
|
142
143
|
"publish": true
|
package/src/EdfaPayPlugin.ts
DELETED
|
@@ -1,551 +0,0 @@
|
|
|
1
|
-
// ignore-file: non-constant-identifier-names
|
|
2
|
-
import { EdfaPayBridge } from './bridge';
|
|
3
|
-
import { FlowType } from './enums/FlowType';
|
|
4
|
-
import { EdfaPayCredentials } from './models/EdfaPayCredentials';
|
|
5
|
-
import { TxnParams } from './models/TxnParams';
|
|
6
|
-
import { Transaction } from './models/Transaction';
|
|
7
|
-
import { SdkTheme } from './models/SdkTheme';
|
|
8
|
-
import { Pagination } from './models/Pagination';
|
|
9
|
-
import { InvoiceRequest } from './models/InvoiceRequest';
|
|
10
|
-
import { BnplResponse } from './models/BnplResponse';
|
|
11
|
-
import { PluginExtension } from './namespaces/Extension';
|
|
12
|
-
import { PluginUtils } from './namespaces/Utils';
|
|
13
|
-
import { RemoteAccess } from './namespaces/RemoteChannel';
|
|
14
|
-
import type {
|
|
15
|
-
ProcessCompleteCallback,
|
|
16
|
-
OnProcessComplete,
|
|
17
|
-
TimeOutCallback,
|
|
18
|
-
CancelByUserCallback,
|
|
19
|
-
OnErrorCallback,
|
|
20
|
-
OnSuccessCallback,
|
|
21
|
-
OnTerminalBindingTask,
|
|
22
|
-
} from './types';
|
|
23
|
-
|
|
24
|
-
export type {
|
|
25
|
-
ProcessCompleteCallback,
|
|
26
|
-
OnProcessComplete,
|
|
27
|
-
TimeOutCallback,
|
|
28
|
-
CancelByUserCallback,
|
|
29
|
-
OnErrorCallback,
|
|
30
|
-
OnSuccessCallback,
|
|
31
|
-
OnTerminalBindingTask,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/// Main EdfaPay SDK entry point.
|
|
35
|
-
///
|
|
36
|
-
/// Mirrors the native Kotlin API exactly:
|
|
37
|
-
/// EdfaPayPlugin.initiate(...)
|
|
38
|
-
/// EdfaPayPlugin.purchase(...)
|
|
39
|
-
/// EdfaPayPlugin.Extension.loginWithToken(...)
|
|
40
|
-
/// EdfaPayPlugin.Utils.getDeviceId()
|
|
41
|
-
/// EdfaPayPlugin.RemoteChannel.LocalNetwork({port:8080, timeout:30}).open()
|
|
42
|
-
export class EdfaPayPlugin {
|
|
43
|
-
private constructor() {}
|
|
44
|
-
|
|
45
|
-
// ── Sub-namespaces ────────────────────────────────────────────────────────
|
|
46
|
-
|
|
47
|
-
static readonly Extension: PluginExtension = PluginExtension.create();
|
|
48
|
-
static readonly Utils: PluginUtils = PluginUtils.create();
|
|
49
|
-
static readonly RemoteChannel: RemoteAccess = RemoteAccess.create();
|
|
50
|
-
|
|
51
|
-
// ── Theme ─────────────────────────────────────────────────────────────────
|
|
52
|
-
|
|
53
|
-
/// Returns a chainable SdkTheme builder.
|
|
54
|
-
/// Usage: EdfaPayPlugin.theme().setPrimaryColor('#00cc66')
|
|
55
|
-
static theme(): SdkTheme {
|
|
56
|
-
return SdkTheme.create();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/// Set global animation speed multiplier.
|
|
60
|
-
static setAnimationSpeedX(speed: number): void {
|
|
61
|
-
EdfaPayBridge.invoke('setAnimationSpeedX', { speed });
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// ── Initialization ────────────────────────────────────────────────────────
|
|
65
|
-
|
|
66
|
-
/// Set encrypted partner configuration before calling initiate().
|
|
67
|
-
static setPartnerConfig(config: string): void {
|
|
68
|
-
EdfaPayBridge.invoke('setPartnerConfig', { partnerConfig: config });
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/// Enable or disable debug logging.
|
|
72
|
-
static enableLogs(enable: boolean): void {
|
|
73
|
-
EdfaPayBridge.invoke('setEnableLogs', { enable });
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/// Initialize the SDK with credentials.
|
|
77
|
-
///
|
|
78
|
-
/// When terminal binding is required, [onTerminalBindingTask] will be called
|
|
79
|
-
/// with a [TerminalBindingTask] that contains available terminals.
|
|
80
|
-
/// Use `task.bind()` to show native UI or `task.bind(terminal)` to bind
|
|
81
|
-
/// programmatically. After binding completes, [onSuccess] or [onError]
|
|
82
|
-
/// will be called automatically.
|
|
83
|
-
static initiate(params: {
|
|
84
|
-
credentials: EdfaPayCredentials;
|
|
85
|
-
onSuccess: (sessionId: string | null) => void;
|
|
86
|
-
onTerminalBindingTask: OnTerminalBindingTask;
|
|
87
|
-
onError: OnErrorCallback;
|
|
88
|
-
}): void {
|
|
89
|
-
EdfaPayBridge.invoke(
|
|
90
|
-
'initiate',
|
|
91
|
-
{ credentials: params.credentials.toJSON() },
|
|
92
|
-
{
|
|
93
|
-
onTerminalBindingTask: params.onTerminalBindingTask,
|
|
94
|
-
onSuccess: params.onSuccess,
|
|
95
|
-
onError: params.onError,
|
|
96
|
-
}
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// ── Payment Operations ────────────────────────────────────────────────────
|
|
101
|
-
|
|
102
|
-
static purchase(params: {
|
|
103
|
-
txnParams: TxnParams;
|
|
104
|
-
flowType?: FlowType;
|
|
105
|
-
onPaymentProcessComplete: ProcessCompleteCallback;
|
|
106
|
-
onRequestTimerEnd: TimeOutCallback;
|
|
107
|
-
onCardScanTimerEnd: TimeOutCallback;
|
|
108
|
-
onCancelByUser: CancelByUserCallback;
|
|
109
|
-
onError: OnErrorCallback;
|
|
110
|
-
}): void {
|
|
111
|
-
EdfaPayBridge.invoke(
|
|
112
|
-
'purchase',
|
|
113
|
-
{
|
|
114
|
-
txnParams: params.txnParams.toJSON(),
|
|
115
|
-
flowType: params.flowType ?? FlowType.DETAIL,
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
onPaymentProcessComplete: params.onPaymentProcessComplete,
|
|
119
|
-
onRequestTimerEnd: params.onRequestTimerEnd,
|
|
120
|
-
onCardScanTimerEnd: params.onCardScanTimerEnd,
|
|
121
|
-
onCancelByUser: params.onCancelByUser,
|
|
122
|
-
onError: params.onError,
|
|
123
|
-
}
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
static authorize(params: {
|
|
128
|
-
txnParams: TxnParams;
|
|
129
|
-
flowType?: FlowType;
|
|
130
|
-
onPaymentProcessComplete: ProcessCompleteCallback;
|
|
131
|
-
onRequestTimerEnd: TimeOutCallback;
|
|
132
|
-
onCardScanTimerEnd: TimeOutCallback;
|
|
133
|
-
onCancelByUser: CancelByUserCallback;
|
|
134
|
-
onError: OnErrorCallback;
|
|
135
|
-
}): void {
|
|
136
|
-
EdfaPayBridge.invoke(
|
|
137
|
-
'authorize',
|
|
138
|
-
{
|
|
139
|
-
txnParams: params.txnParams.toJSON(),
|
|
140
|
-
flowType: params.flowType ?? FlowType.DETAIL,
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
onPaymentProcessComplete: params.onPaymentProcessComplete,
|
|
144
|
-
onRequestTimerEnd: params.onRequestTimerEnd,
|
|
145
|
-
onCardScanTimerEnd: params.onCardScanTimerEnd,
|
|
146
|
-
onCancelByUser: params.onCancelByUser,
|
|
147
|
-
onError: params.onError,
|
|
148
|
-
}
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
static capture(params: {
|
|
153
|
-
txnParams: TxnParams;
|
|
154
|
-
flowType?: FlowType;
|
|
155
|
-
onPaymentProcessComplete: ProcessCompleteCallback;
|
|
156
|
-
onRequestTimerEnd: TimeOutCallback;
|
|
157
|
-
onCardScanTimerEnd: TimeOutCallback;
|
|
158
|
-
onCancelByUser: CancelByUserCallback;
|
|
159
|
-
onError: OnErrorCallback;
|
|
160
|
-
}): void {
|
|
161
|
-
EdfaPayBridge.invoke(
|
|
162
|
-
'capture',
|
|
163
|
-
{
|
|
164
|
-
txnParams: params.txnParams.toJSON(),
|
|
165
|
-
flowType: params.flowType ?? FlowType.DETAIL,
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
onPaymentProcessComplete: params.onPaymentProcessComplete,
|
|
169
|
-
onRequestTimerEnd: params.onRequestTimerEnd,
|
|
170
|
-
onCardScanTimerEnd: params.onCardScanTimerEnd,
|
|
171
|
-
onCancelByUser: params.onCancelByUser,
|
|
172
|
-
onError: params.onError,
|
|
173
|
-
}
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
static refund(params: {
|
|
178
|
-
txnParams: TxnParams;
|
|
179
|
-
flowType?: FlowType;
|
|
180
|
-
onPaymentProcessComplete: ProcessCompleteCallback;
|
|
181
|
-
onRequestTimerEnd: TimeOutCallback;
|
|
182
|
-
onCardScanTimerEnd: TimeOutCallback;
|
|
183
|
-
onCancelByUser: CancelByUserCallback;
|
|
184
|
-
onError: OnErrorCallback;
|
|
185
|
-
}): void {
|
|
186
|
-
EdfaPayBridge.invoke(
|
|
187
|
-
'refund',
|
|
188
|
-
{
|
|
189
|
-
txnParams: params.txnParams.toJSON(),
|
|
190
|
-
flowType: params.flowType ?? FlowType.DETAIL,
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
onPaymentProcessComplete: params.onPaymentProcessComplete,
|
|
194
|
-
onRequestTimerEnd: params.onRequestTimerEnd,
|
|
195
|
-
onCardScanTimerEnd: params.onCardScanTimerEnd,
|
|
196
|
-
onCancelByUser: params.onCancelByUser,
|
|
197
|
-
onError: params.onError,
|
|
198
|
-
}
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
static changePin(params: {
|
|
203
|
-
parameters: string[];
|
|
204
|
-
flowType?: FlowType;
|
|
205
|
-
onProcessComplete: OnProcessComplete;
|
|
206
|
-
onRequestTimerEnd: TimeOutCallback;
|
|
207
|
-
onCardScanTimerEnd: TimeOutCallback;
|
|
208
|
-
onCancelByUser: CancelByUserCallback;
|
|
209
|
-
onError: OnErrorCallback;
|
|
210
|
-
}): void {
|
|
211
|
-
EdfaPayBridge.invoke(
|
|
212
|
-
'changePin',
|
|
213
|
-
{
|
|
214
|
-
parameters: params.parameters,
|
|
215
|
-
flowType: params.flowType ?? FlowType.DETAIL,
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
onProcessComplete: params.onProcessComplete,
|
|
219
|
-
onRequestTimerEnd: params.onRequestTimerEnd,
|
|
220
|
-
onCardScanTimerEnd: params.onCardScanTimerEnd,
|
|
221
|
-
onCancelByUser: params.onCancelByUser,
|
|
222
|
-
onError: params.onError,
|
|
223
|
-
}
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
static activateCard(params: {
|
|
228
|
-
parameters: string[];
|
|
229
|
-
flowType?: FlowType;
|
|
230
|
-
onProcessComplete: OnProcessComplete;
|
|
231
|
-
onRequestTimerEnd: TimeOutCallback;
|
|
232
|
-
onCardScanTimerEnd: TimeOutCallback;
|
|
233
|
-
onCancelByUser: CancelByUserCallback;
|
|
234
|
-
onError: OnErrorCallback;
|
|
235
|
-
}): void {
|
|
236
|
-
EdfaPayBridge.invoke(
|
|
237
|
-
'activateCard',
|
|
238
|
-
{
|
|
239
|
-
parameters: params.parameters,
|
|
240
|
-
flowType: params.flowType ?? FlowType.DETAIL,
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
onProcessComplete: params.onProcessComplete,
|
|
244
|
-
onRequestTimerEnd: params.onRequestTimerEnd,
|
|
245
|
-
onCardScanTimerEnd: params.onCardScanTimerEnd,
|
|
246
|
-
onCancelByUser: params.onCancelByUser,
|
|
247
|
-
onError: params.onError,
|
|
248
|
-
}
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
static void$(params: {
|
|
253
|
-
transaction: Transaction;
|
|
254
|
-
onSuccess: (response: Record<string, any>) => void;
|
|
255
|
-
onError: OnErrorCallback;
|
|
256
|
-
}): void {
|
|
257
|
-
EdfaPayBridge.invoke(
|
|
258
|
-
'void',
|
|
259
|
-
{ transaction: params.transaction.toJSON() },
|
|
260
|
-
{
|
|
261
|
-
onSuccess: params.onSuccess,
|
|
262
|
-
onError: params.onError,
|
|
263
|
-
}
|
|
264
|
-
);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
static reverse(params: {
|
|
268
|
-
transaction: Transaction;
|
|
269
|
-
onSuccess: (response: Record<string, any>) => void;
|
|
270
|
-
onError: OnErrorCallback;
|
|
271
|
-
}): void {
|
|
272
|
-
EdfaPayBridge.invoke(
|
|
273
|
-
'reverse',
|
|
274
|
-
{ transaction: params.transaction.toJSON() },
|
|
275
|
-
{
|
|
276
|
-
onSuccess: params.onSuccess,
|
|
277
|
-
onError: params.onError,
|
|
278
|
-
}
|
|
279
|
-
);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
static reverseLastTransaction(params: {
|
|
283
|
-
onSuccess: (response: Record<string, any>) => void;
|
|
284
|
-
onError: OnErrorCallback;
|
|
285
|
-
}): void {
|
|
286
|
-
EdfaPayBridge.invoke(
|
|
287
|
-
'reverseLastTransaction',
|
|
288
|
-
{},
|
|
289
|
-
{
|
|
290
|
-
onSuccess: params.onSuccess,
|
|
291
|
-
onError: params.onError,
|
|
292
|
-
}
|
|
293
|
-
);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
// ── BNPL (Buy Now Pay Later) ──────────────────────────────────────────────
|
|
297
|
-
|
|
298
|
-
/// Initiate BNPL checkout with Tamara or Tabby.
|
|
299
|
-
///
|
|
300
|
-
/// [request] contains provider, merchant info, customer details, and invoice.
|
|
301
|
-
/// [onSuccess] returns a BnplResponse with checkout deeplink URL.
|
|
302
|
-
/// [onError] called on failure with error details.
|
|
303
|
-
static buyNowPayLater(params: {
|
|
304
|
-
request: InvoiceRequest;
|
|
305
|
-
onSuccess: (response: BnplResponse) => void;
|
|
306
|
-
onError: OnErrorCallback;
|
|
307
|
-
}): void {
|
|
308
|
-
EdfaPayBridge.invoke(
|
|
309
|
-
'buyNowPayLater',
|
|
310
|
-
{ request: params.request.toJSON() },
|
|
311
|
-
{
|
|
312
|
-
onSuccess: (result: Record<string, any>) =>
|
|
313
|
-
params.onSuccess(BnplResponse.fromJSON(result)),
|
|
314
|
-
onError: params.onError,
|
|
315
|
-
}
|
|
316
|
-
);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
/// Initiate checkout link generation (invoice-based payment link).
|
|
320
|
-
///
|
|
321
|
-
/// [request] contains provider, merchant info, customer details, and invoice.
|
|
322
|
-
/// [onSuccess] returns a BnplResponse with checkout deeplink URL.
|
|
323
|
-
/// [onError] called on failure with error details.
|
|
324
|
-
static checkoutLinkApi(params: {
|
|
325
|
-
request: InvoiceRequest;
|
|
326
|
-
onSuccess: (response: BnplResponse) => void;
|
|
327
|
-
onError: OnErrorCallback;
|
|
328
|
-
}): void {
|
|
329
|
-
EdfaPayBridge.invoke(
|
|
330
|
-
'checkoutLinkApi',
|
|
331
|
-
{ request: params.request.toJSON() },
|
|
332
|
-
{
|
|
333
|
-
onSuccess: (result: Record<string, any>) =>
|
|
334
|
-
params.onSuccess(BnplResponse.fromJSON(result)),
|
|
335
|
-
onError: params.onError,
|
|
336
|
-
}
|
|
337
|
-
);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
// ── Transaction History ───────────────────────────────────────────────────
|
|
341
|
-
|
|
342
|
-
static txnHistory(params: {
|
|
343
|
-
pagination?: Pagination;
|
|
344
|
-
onSuccess: (transactions: Record<string, any>) => void;
|
|
345
|
-
onError: OnErrorCallback;
|
|
346
|
-
}): void {
|
|
347
|
-
EdfaPayBridge.invoke(
|
|
348
|
-
'txnHistory',
|
|
349
|
-
{ pagination: params.pagination?.toJSON() },
|
|
350
|
-
{
|
|
351
|
-
onSuccess: params.onSuccess,
|
|
352
|
-
onError: params.onError,
|
|
353
|
-
}
|
|
354
|
-
);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
static txnDetail(params: {
|
|
358
|
-
txnId: string;
|
|
359
|
-
onSuccess: (transaction: Record<string, any>) => void;
|
|
360
|
-
onError: OnErrorCallback;
|
|
361
|
-
}): void {
|
|
362
|
-
EdfaPayBridge.invoke(
|
|
363
|
-
'txnDetail',
|
|
364
|
-
{ txnId: params.txnId },
|
|
365
|
-
{
|
|
366
|
-
onSuccess: params.onSuccess,
|
|
367
|
-
onError: params.onError,
|
|
368
|
-
}
|
|
369
|
-
);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
static txnDetailApi(params: {
|
|
373
|
-
txnId: string;
|
|
374
|
-
onSuccess: (transaction: Record<string, any>) => void;
|
|
375
|
-
onError: OnErrorCallback;
|
|
376
|
-
}): void {
|
|
377
|
-
EdfaPayBridge.invoke(
|
|
378
|
-
'txnDetailApi',
|
|
379
|
-
{ txnId: params.txnId },
|
|
380
|
-
{
|
|
381
|
-
onSuccess: params.onSuccess,
|
|
382
|
-
onError: params.onError,
|
|
383
|
-
}
|
|
384
|
-
);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
// ── Reconciliation ────────────────────────────────────────────────────────
|
|
388
|
-
|
|
389
|
-
static reconcile(params: {
|
|
390
|
-
onSuccess: (response: Record<string, any>) => void;
|
|
391
|
-
onError: OnErrorCallback;
|
|
392
|
-
}): void {
|
|
393
|
-
EdfaPayBridge.invoke(
|
|
394
|
-
'reconcile',
|
|
395
|
-
{},
|
|
396
|
-
{
|
|
397
|
-
onSuccess: params.onSuccess,
|
|
398
|
-
onError: params.onError,
|
|
399
|
-
}
|
|
400
|
-
);
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
static reconciliationHistory(params: {
|
|
404
|
-
onSuccess: (response: Record<string, any>) => void;
|
|
405
|
-
onError: OnErrorCallback;
|
|
406
|
-
}): void {
|
|
407
|
-
EdfaPayBridge.invoke(
|
|
408
|
-
'reconciliationHistory',
|
|
409
|
-
{},
|
|
410
|
-
{
|
|
411
|
-
onSuccess: params.onSuccess,
|
|
412
|
-
onError: params.onError,
|
|
413
|
-
}
|
|
414
|
-
);
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
static reconciliationDetail(params: {
|
|
418
|
-
id: string;
|
|
419
|
-
onSuccess: (response: Record<string, any>) => void;
|
|
420
|
-
onError: OnErrorCallback;
|
|
421
|
-
}): void {
|
|
422
|
-
EdfaPayBridge.invoke(
|
|
423
|
-
'reconciliationDetail',
|
|
424
|
-
{ id: params.id },
|
|
425
|
-
{
|
|
426
|
-
onSuccess: params.onSuccess,
|
|
427
|
-
onError: params.onError,
|
|
428
|
-
}
|
|
429
|
-
);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
static reconciliationReceipt(params: {
|
|
433
|
-
id: string;
|
|
434
|
-
onSuccess: (response: Record<string, any>) => void;
|
|
435
|
-
onError: OnErrorCallback;
|
|
436
|
-
}): void {
|
|
437
|
-
EdfaPayBridge.invoke(
|
|
438
|
-
'reconciliationReceipt',
|
|
439
|
-
{ id: params.id },
|
|
440
|
-
{
|
|
441
|
-
onSuccess: params.onSuccess,
|
|
442
|
-
onError: params.onError,
|
|
443
|
-
}
|
|
444
|
-
);
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
// ── Terminal Management ───────────────────────────────────────────────────
|
|
448
|
-
|
|
449
|
-
static terminalInfo(params: {
|
|
450
|
-
onSuccess: (terminalInfo: Record<string, any>) => void;
|
|
451
|
-
onError?: OnErrorCallback;
|
|
452
|
-
}): void {
|
|
453
|
-
const callbacks: Record<string, Function> = {
|
|
454
|
-
onSuccess: params.onSuccess,
|
|
455
|
-
};
|
|
456
|
-
if (params.onError) {
|
|
457
|
-
callbacks.onError = params.onError;
|
|
458
|
-
}
|
|
459
|
-
EdfaPayBridge.invoke('terminalInfo', {}, callbacks);
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
static activateTerminal(params: {
|
|
463
|
-
password?: string;
|
|
464
|
-
onSuccess: () => void;
|
|
465
|
-
onError: OnErrorCallback;
|
|
466
|
-
}): void {
|
|
467
|
-
EdfaPayBridge.invoke(
|
|
468
|
-
'activateTerminal',
|
|
469
|
-
{ password: params.password },
|
|
470
|
-
{
|
|
471
|
-
onSuccess: (_: any) => params.onSuccess(),
|
|
472
|
-
onError: params.onError,
|
|
473
|
-
}
|
|
474
|
-
);
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
static deActivateTerminal(params: {
|
|
478
|
-
password?: string;
|
|
479
|
-
onSuccess: () => void;
|
|
480
|
-
onError: OnErrorCallback;
|
|
481
|
-
}): void {
|
|
482
|
-
EdfaPayBridge.invoke(
|
|
483
|
-
'deActivateTerminal',
|
|
484
|
-
{ password: params.password },
|
|
485
|
-
{
|
|
486
|
-
onSuccess: (_: any) => params.onSuccess(),
|
|
487
|
-
onError: params.onError,
|
|
488
|
-
}
|
|
489
|
-
);
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
static syncTerminal(params: {
|
|
493
|
-
onSuccess: () => void;
|
|
494
|
-
onError: OnErrorCallback;
|
|
495
|
-
}): void {
|
|
496
|
-
EdfaPayBridge.invoke(
|
|
497
|
-
'syncTerminal',
|
|
498
|
-
{},
|
|
499
|
-
{
|
|
500
|
-
onSuccess: (_: any) => params.onSuccess(),
|
|
501
|
-
onError: params.onError,
|
|
502
|
-
}
|
|
503
|
-
);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
// ── Session Management ────────────────────────────────────────────────────
|
|
507
|
-
|
|
508
|
-
static async getSessionId(): Promise<string | null> {
|
|
509
|
-
const result = await EdfaPayBridge.invokeAsync('getSessionId');
|
|
510
|
-
return result as string | null;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
static async getSessionDetail(): Promise<Record<string, any> | null> {
|
|
514
|
-
const result = await EdfaPayBridge.invokeAsync('getSessionDetail');
|
|
515
|
-
return result == null ? null : (result as Record<string, any>);
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
static async getSessionList(): Promise<Record<string, any>[]> {
|
|
519
|
-
const result = await EdfaPayBridge.invokeAsync('getSessionList');
|
|
520
|
-
return ((result as any[]) ?? []) as Record<string, any>[];
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
static logoutCurrentSession(params: {
|
|
524
|
-
onSuccess: () => void;
|
|
525
|
-
onError: OnErrorCallback;
|
|
526
|
-
}): void {
|
|
527
|
-
EdfaPayBridge.invoke(
|
|
528
|
-
'logoutCurrentSession',
|
|
529
|
-
{},
|
|
530
|
-
{
|
|
531
|
-
onSuccess: (_: any) => params.onSuccess(),
|
|
532
|
-
onError: params.onError,
|
|
533
|
-
}
|
|
534
|
-
);
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
static logoutSession(params: {
|
|
538
|
-
sessionId: string;
|
|
539
|
-
onSuccess: () => void;
|
|
540
|
-
onError: OnErrorCallback;
|
|
541
|
-
}): void {
|
|
542
|
-
EdfaPayBridge.invoke(
|
|
543
|
-
'logoutSession',
|
|
544
|
-
{ sessionId: params.sessionId },
|
|
545
|
-
{
|
|
546
|
-
onSuccess: (_: any) => params.onSuccess(),
|
|
547
|
-
onError: params.onError,
|
|
548
|
-
}
|
|
549
|
-
);
|
|
550
|
-
}
|
|
551
|
-
}
|