-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathPartialPaymentConfiguration.ts
More file actions
59 lines (54 loc) · 2.23 KB
/
PartialPaymentConfiguration.ts
File metadata and controls
59 lines (54 loc) · 2.23 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
import type { AdyenComponent } from '../AdyenNativeModules';
import type { Balance, Order, PaymentMethodData } from '../types';
export interface PartialPaymentConfiguration {
/**
* Indicates whether to show the security code field. Defaults to true.
*/
pinRequired?: boolean;
/**
* Invoked when the payment component needs a balance check call to be performed. Call /balance API.
* @param paymentData The collection that contains the type of the payment method and its specific information.
* @param resolve Provide balance object.
* @param reject Reject with error.
*/
onBalanceCheck(
paymentData: PaymentMethodData,
resolve: (balance: Balance) => void,
reject: (error: Error) => void
): void;
/**
* Invoked when the payment component needs a partial payment order object. Call /orders API.
* @param resolve Provide order object.
* @param reject Reject with error.
*/
onOrderRequest(
resolve: (order: Order) => void,
reject: (error: Error) => void
): void;
/**
* Invoked when the payment component needs to cancel the order. Call orders/cancel API.
* The shouldUpdatePaymentMethods flag indicates the next step you should take after the API call is made:
* - true means that Drop-in is still showing and you might want to call / paymentMethods with the new payment amount. Update Drop-in with the new list of payment methods.
* - false means that Drop-in is being dismissed by the user so there is no need to make any further calls. Call `.hide(false)` to clear the UI.
* @param order The order request object that contains a pspReference that represents the order and the matching encrypted order data.
* @param shouldUpdatePaymentMethods The flag that indicates indicates the next step.
* @param component The native component that used for this payment.
*/
onOrderCancel(
order: Order,
shouldUpdatePaymentMethods: Boolean,
component: PartialPaymentComponent
): void;
}
export interface PartialPaymentComponent extends AdyenComponent {
provideBalance(
success: boolean,
balance: Balance | undefined,
error: Error | undefined
): void;
provideOrder(
success: boolean,
order: Order | undefined,
error: Error | undefined
): void;
}