-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathAdyenNativeModules.tsx
More file actions
64 lines (58 loc) · 1.76 KB
/
AdyenNativeModules.tsx
File metadata and controls
64 lines (58 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import type { Configuration } from './configurations/Configuration';
import type {
PaymentAction,
PaymentMethod,
PaymentMethodsResponse,
} from './types';
/**
* Options for dismissing the payment component.
*/
export interface HideOption {
/** Alert message after dismiss. Used for Android DropIn and Components only */
message?: string;
}
/**
* Universal interface for an Adyen Native module.
*/
export interface AdyenComponent {
/**
* Dismiss the component from the screen.
* @param success - Indicates whether the component was dismissed successfully.
* @param option - Additional options for dismissing the component (optional).
*/
hide: (success: boolean, option?: HideOption) => void;
}
/**
* Universal interface for an Adyen Native payment component.
*/
export interface AdyenPaymentComponent extends AdyenComponent {
/**
* List of events supported by component
*/
events: string[];
/**
* Show the component above the current screen.
* @param paymentMethods - The available payment methods.
* @param configuration - The configuration for the component.
*/
open: (paymentMethods: PaymentMethodsResponse, configuration: any) => void;
}
/**
* Describes an Adyen Component capable of handling payment actions.
*/
export interface AdyenActionComponent extends AdyenPaymentComponent {
/**
* Handle a payment action received by the component.
* @param action - The payment action to be handled.
*/
handle: (action: PaymentAction) => void;
}
/**
* Describes an Adyen Component capable of handling payment action if specific conditions are met.
*/
export interface ConditionalPaymentComponent extends AdyenComponent {
isAvailable(
paymentMethods: PaymentMethod,
configuration: Configuration
): Promise<boolean>;
}