@brissoto/pay-react-native 0.0.0-stage → 1.4.5
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/LICENSE +21 -0
- package/README.md +180 -2
- package/assets/brand/paypal-wordmark.png +0 -0
- package/assets/fonts/Figtree-Bold.ttf +0 -0
- package/assets/fonts/Figtree-ExtraBold.ttf +0 -0
- package/assets/fonts/Figtree-Medium.ttf +0 -0
- package/assets/fonts/Figtree-Regular.ttf +0 -0
- package/assets/fonts/Figtree-SemiBold.ttf +0 -0
- package/assets/fonts/OFL.txt +93 -0
- package/assets/logos/airtel.png +0 -0
- package/assets/logos/app-store.png +0 -0
- package/assets/logos/apple-pay.png +0 -0
- package/assets/logos/at.png +0 -0
- package/assets/logos/bancontact.png +0 -0
- package/assets/logos/card.png +0 -0
- package/assets/logos/cb.png +0 -0
- package/assets/logos/celtiis.png +0 -0
- package/assets/logos/eps.png +0 -0
- package/assets/logos/feexpay.png +0 -0
- package/assets/logos/google-pay.png +0 -0
- package/assets/logos/google-play.png +0 -0
- package/assets/logos/iapkit.png +0 -0
- package/assets/logos/ideal.png +0 -0
- package/assets/logos/mastercard.png +0 -0
- package/assets/logos/mixx.png +0 -0
- package/assets/logos/moov.png +0 -0
- package/assets/logos/mtn.png +0 -0
- package/assets/logos/mybank.png +0 -0
- package/assets/logos/nexus.png +0 -0
- package/assets/logos/orange.png +0 -0
- package/assets/logos/pawapay.png +0 -0
- package/assets/logos/paypal.png +0 -0
- package/assets/logos/telecel.png +0 -0
- package/assets/logos/tnm.png +0 -0
- package/assets/logos/visa.png +0 -0
- package/assets/logos/vodacom.png +0 -0
- package/assets/logos/wave.png +0 -0
- package/dist/checkout-core/hooks/use-checkout-controller.d.ts +9 -0
- package/dist/checkout-core/hooks/use-checkout-controller.js +563 -0
- package/dist/checkout-core/hooks/use-checkout-payment.d.ts +9 -0
- package/dist/checkout-core/hooks/use-checkout-payment.js +136 -0
- package/dist/checkout-core/hooks/use-checkout-timers.d.ts +15 -0
- package/dist/checkout-core/hooks/use-checkout-timers.js +44 -0
- package/dist/checkout-core/hooks/use-phone-number.d.ts +7 -0
- package/dist/checkout-core/hooks/use-phone-number.js +82 -0
- package/dist/checkout-core/messages/en.d.ts +297 -0
- package/dist/checkout-core/messages/en.js +296 -0
- package/dist/checkout-core/messages/fr.d.ts +4 -0
- package/dist/checkout-core/messages/fr.js +297 -0
- package/dist/checkout-core/models/checkout.card.utils.d.ts +7 -0
- package/dist/checkout-core/models/checkout.card.utils.js +25 -0
- package/dist/checkout-core/models/checkout.constants.d.ts +101 -0
- package/dist/checkout-core/models/checkout.constants.js +339 -0
- package/dist/checkout-core/models/checkout.country.utils.d.ts +17 -0
- package/dist/checkout-core/models/checkout.country.utils.js +45 -0
- package/dist/checkout-core/models/checkout.enum.d.ts +230 -0
- package/dist/checkout-core/models/checkout.enum.js +256 -0
- package/dist/checkout-core/models/checkout.fetch.utils.d.ts +6 -0
- package/dist/checkout-core/models/checkout.fetch.utils.js +22 -0
- package/dist/checkout-core/models/checkout.interface.d.ts +696 -0
- package/dist/checkout-core/models/checkout.interface.js +1 -0
- package/dist/checkout-core/models/checkout.money.utils.d.ts +7 -0
- package/dist/checkout-core/models/checkout.money.utils.js +21 -0
- package/dist/checkout-core/models/checkout.phone.utils.d.ts +33 -0
- package/dist/checkout-core/models/checkout.phone.utils.js +159 -0
- package/dist/checkout-core/models/checkout.view.utils.d.ts +77 -0
- package/dist/checkout-core/models/checkout.view.utils.js +328 -0
- package/dist/checkout-core/models/domain.enum.d.ts +106 -0
- package/dist/checkout-core/models/domain.enum.js +113 -0
- package/dist/components/BrissotoPayProvider.d.ts +8 -0
- package/dist/components/BrissotoPayProvider.js +39 -0
- package/dist/components/PaymentSheetModal.d.ts +9 -0
- package/dist/components/PaymentSheetModal.js +106 -0
- package/dist/components/SheetBone.d.ts +3 -0
- package/dist/components/SheetBone.js +12 -0
- package/dist/components/SheetButton.d.ts +7 -0
- package/dist/components/SheetButton.js +47 -0
- package/dist/components/SheetCardFields.d.ts +10 -0
- package/dist/components/SheetCardFields.js +86 -0
- package/dist/components/SheetChosenMethod.d.ts +3 -0
- package/dist/components/SheetChosenMethod.js +60 -0
- package/dist/components/SheetCodeField.d.ts +8 -0
- package/dist/components/SheetCodeField.js +98 -0
- package/dist/components/SheetContent.d.ts +3 -0
- package/dist/components/SheetContent.js +132 -0
- package/dist/components/SheetDial.d.ts +7 -0
- package/dist/components/SheetDial.js +36 -0
- package/dist/components/SheetFailed.d.ts +3 -0
- package/dist/components/SheetFailed.js +44 -0
- package/dist/components/SheetForm.d.ts +8 -0
- package/dist/components/SheetForm.js +139 -0
- package/dist/components/SheetGrabber.d.ts +2 -0
- package/dist/components/SheetGrabber.js +17 -0
- package/dist/components/SheetHeader.d.ts +7 -0
- package/dist/components/SheetHeader.js +83 -0
- package/dist/components/SheetIcon.d.ts +3 -0
- package/dist/components/SheetIcon.js +78 -0
- package/dist/components/SheetLayout.d.ts +11 -0
- package/dist/components/SheetLayout.js +63 -0
- package/dist/components/SheetLogo.d.ts +3 -0
- package/dist/components/SheetLogo.js +20 -0
- package/dist/components/SheetMessage.d.ts +3 -0
- package/dist/components/SheetMessage.js +15 -0
- package/dist/components/SheetMethodCard.d.ts +3 -0
- package/dist/components/SheetMethodCard.js +71 -0
- package/dist/components/SheetNameField.d.ts +7 -0
- package/dist/components/SheetNameField.js +48 -0
- package/dist/components/SheetPaypalButton.d.ts +3 -0
- package/dist/components/SheetPaypalButton.js +23 -0
- package/dist/components/SheetPhoneField.d.ts +3 -0
- package/dist/components/SheetPhoneField.js +59 -0
- package/dist/components/SheetPillSelect.d.ts +7 -0
- package/dist/components/SheetPillSelect.js +134 -0
- package/dist/components/SheetRow.d.ts +3 -0
- package/dist/components/SheetRow.js +28 -0
- package/dist/components/SheetSimulator.d.ts +6 -0
- package/dist/components/SheetSimulator.js +40 -0
- package/dist/components/SheetSkeleton.d.ts +5 -0
- package/dist/components/SheetSkeleton.js +23 -0
- package/dist/components/SheetStep.d.ts +6 -0
- package/dist/components/SheetStep.js +21 -0
- package/dist/components/SheetStoreTab.d.ts +7 -0
- package/dist/components/SheetStoreTab.js +27 -0
- package/dist/components/SheetSuccess.d.ts +3 -0
- package/dist/components/SheetSuccess.js +51 -0
- package/dist/components/SheetSummary.d.ts +3 -0
- package/dist/components/SheetSummary.js +32 -0
- package/dist/components/SheetTerminal.d.ts +3 -0
- package/dist/components/SheetTerminal.js +21 -0
- package/dist/components/SheetText.d.ts +5 -0
- package/dist/components/SheetText.js +27 -0
- package/dist/components/SheetToast.d.ts +7 -0
- package/dist/components/SheetToast.js +71 -0
- package/dist/components/SheetWaiting.d.ts +7 -0
- package/dist/components/SheetWaiting.js +88 -0
- package/dist/hooks/use-native-platform.d.ts +10 -0
- package/dist/hooks/use-native-platform.js +71 -0
- package/dist/hooks/use-payment-sheet.d.ts +4 -0
- package/dist/hooks/use-payment-sheet.js +10 -0
- package/dist/hooks/use-shake.d.ts +3 -0
- package/dist/hooks/use-shake.js +18 -0
- package/dist/hooks/use-sheet-motion.d.ts +7 -0
- package/dist/hooks/use-sheet-motion.js +62 -0
- package/dist/hooks/use-sheet-resize.d.ts +6 -0
- package/dist/hooks/use-sheet-resize.js +15 -0
- package/dist/hooks/use-sheet-room.d.ts +4 -0
- package/dist/hooks/use-sheet-room.js +8 -0
- package/dist/hooks/use-sheet-theme.d.ts +4 -0
- package/dist/hooks/use-sheet-theme.js +12 -0
- package/dist/hooks/use-step-slide.d.ts +16 -0
- package/dist/hooks/use-step-slide.js +50 -0
- package/dist/hooks/use-store-recovery.d.ts +9 -0
- package/dist/hooks/use-store-recovery.js +50 -0
- package/dist/hooks/use-store-tab.d.ts +11 -0
- package/dist/hooks/use-store-tab.js +112 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/models/sheet.constants.d.ts +125 -0
- package/dist/models/sheet.constants.js +204 -0
- package/dist/models/sheet.enum.d.ts +46 -0
- package/dist/models/sheet.enum.js +53 -0
- package/dist/models/sheet.interface.d.ts +423 -0
- package/dist/models/sheet.interface.js +1 -0
- package/dist/models/sheet.utils.d.ts +68 -0
- package/dist/models/sheet.utils.js +211 -0
- package/dist/services/checkout.service.d.ts +15 -0
- package/dist/services/checkout.service.js +96 -0
- package/dist/services/provider-window.service.d.ts +13 -0
- package/dist/services/provider-window.service.js +53 -0
- package/dist/services/store.service.d.ts +36 -0
- package/dist/services/store.service.js +107 -0
- package/package.json +73 -4
|
@@ -0,0 +1,696 @@
|
|
|
1
|
+
import type { BankWindowMessageEnum, CardFieldsMessageEnum, CheckoutPaymentStatusEnum, CheckoutToastToneEnum, CheckoutScreenEnum, CheckoutStepEnum, CheckoutTabEnum, CheckoutThemeEnum, FlowAskEnum, MethodBrandEnum, MethodFlowEnum, MethodKindEnum, MethodLineEnum, PayRouteEnum, MethodStateEnum, PayRefusalEnum, PhoneErrorEnum, PhoneStoreEnum, StoreSheetOutcomeEnum, SimulatorOutcomeEnum, SupportChannelEnum, ProviderWindowEndEnum } from './checkout.enum.js';
|
|
2
|
+
import type { AttemptStatusEnum, CountryEnum, CurrencyEnum, FailureReasonEnum, LangEnum, PriceGroupEnum, ProviderLogoEnum } from './domain.enum.js';
|
|
3
|
+
export interface CheckoutApp {
|
|
4
|
+
name: string;
|
|
5
|
+
color: string;
|
|
6
|
+
logoUrl: string | null;
|
|
7
|
+
termsUrl: string | null;
|
|
8
|
+
privacyUrl: string | null;
|
|
9
|
+
supportEmail: string | null;
|
|
10
|
+
/** E.164. */
|
|
11
|
+
supportWhatsapp: string | null;
|
|
12
|
+
}
|
|
13
|
+
/** An order line: what is bought, never an amount (the total depends on the method, ADR 0012). */
|
|
14
|
+
export interface CheckoutItem {
|
|
15
|
+
name: string;
|
|
16
|
+
quantity: number;
|
|
17
|
+
}
|
|
18
|
+
/** A payment method this payment can be paid with, in the admin's order. */
|
|
19
|
+
export interface CheckoutMethod {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
kind: MethodKindEnum;
|
|
23
|
+
country: CountryEnum;
|
|
24
|
+
/** The network that runs it ("Orange Cameroun"). */
|
|
25
|
+
network: string;
|
|
26
|
+
flow: MethodFlowEnum;
|
|
27
|
+
/** The code a payer dials to see payments waiting for approval. */
|
|
28
|
+
pendingCode: string | null;
|
|
29
|
+
/** OTP methods: what the payer dials to get a payment code for this amount. */
|
|
30
|
+
otpCode: string | null;
|
|
31
|
+
/** Card methods: the provider's page hosting its card fields, shown in an iframe. */
|
|
32
|
+
cardFieldsPath: string | null;
|
|
33
|
+
logos: Array<ProviderLogoEnum>;
|
|
34
|
+
state: MethodStateEnum;
|
|
35
|
+
/** Why it is in maintenance, for the payer. */
|
|
36
|
+
note: string | null;
|
|
37
|
+
/** GLOSSARY: Price. What the payer pays with it (ADR 0012). */
|
|
38
|
+
price: Price;
|
|
39
|
+
}
|
|
40
|
+
/** An amount in minor units of a currency (GLOSSARY: Price). */
|
|
41
|
+
export interface Price {
|
|
42
|
+
amount: number;
|
|
43
|
+
currency: CurrencyEnum;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A paid card as its provider reported it: never more than the last 4
|
|
47
|
+
* digits. The brand is the provider's own word, whatever the network.
|
|
48
|
+
*/
|
|
49
|
+
export interface CardSummary {
|
|
50
|
+
brand: string;
|
|
51
|
+
last4: string;
|
|
52
|
+
}
|
|
53
|
+
/** How to approve by dialling, as the provider said it, in both languages. */
|
|
54
|
+
export interface AttemptDial {
|
|
55
|
+
title: {
|
|
56
|
+
en: string;
|
|
57
|
+
fr: string;
|
|
58
|
+
};
|
|
59
|
+
/** The whole code, to dial in one tap. */
|
|
60
|
+
quickLink: string | null;
|
|
61
|
+
steps: {
|
|
62
|
+
en: Array<string>;
|
|
63
|
+
fr: Array<string>;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export interface CheckoutAttempt {
|
|
67
|
+
reference: string;
|
|
68
|
+
method: string;
|
|
69
|
+
/** As the payer read it when paying. */
|
|
70
|
+
methodName: string;
|
|
71
|
+
logos: Array<ProviderLogoEnum>;
|
|
72
|
+
flow: MethodFlowEnum;
|
|
73
|
+
pendingCode: string | null;
|
|
74
|
+
status: AttemptStatusEnum;
|
|
75
|
+
failureReason: FailureReasonEnum | null;
|
|
76
|
+
/** GLOSSARY: Price. What it asks the payer for (ADR 0012). */
|
|
77
|
+
price: Price;
|
|
78
|
+
/** E.164; a card has none. */
|
|
79
|
+
phone: string | null;
|
|
80
|
+
/** A paid card: its brand and last 4 digits. */
|
|
81
|
+
card: CardSummary | null;
|
|
82
|
+
startedAt: number;
|
|
83
|
+
/** A test attempt the Simulator took: the tester picks its outcome. */
|
|
84
|
+
simulated: boolean;
|
|
85
|
+
/** When the latest request went out: "Didn't get it?" counts from it. */
|
|
86
|
+
lastSentAt: number;
|
|
87
|
+
/** New requests the payer can still ask for. */
|
|
88
|
+
sendsLeft: number;
|
|
89
|
+
/** The network's prompt never shows by itself: the payer dials at once. */
|
|
90
|
+
manual: boolean;
|
|
91
|
+
dial: Array<AttemptDial>;
|
|
92
|
+
/** A store purchase someone must approve first (Ask to Buy, cash at a shop). */
|
|
93
|
+
pendingAtStore: boolean;
|
|
94
|
+
/** Approved in PayPal's window, not paid yet: the window can close. */
|
|
95
|
+
payerApproved: boolean;
|
|
96
|
+
}
|
|
97
|
+
/** A store the payment sheet may sell the payment's product through. */
|
|
98
|
+
export interface CheckoutStore {
|
|
99
|
+
store: PhoneStoreEnum;
|
|
100
|
+
productId: string;
|
|
101
|
+
}
|
|
102
|
+
/** One way to approve by dialling, in the payer's language. */
|
|
103
|
+
export interface DialChannel {
|
|
104
|
+
title: string;
|
|
105
|
+
quickLink: string | null;
|
|
106
|
+
steps: Array<string>;
|
|
107
|
+
}
|
|
108
|
+
/** What the waiting screen offers a payer with no prompt, once it is time to. */
|
|
109
|
+
export interface DialHelp {
|
|
110
|
+
/** USSD steps: after the last new request, or at once for a `manual` network. */
|
|
111
|
+
channels: Array<DialChannel>;
|
|
112
|
+
/** The method's own code to see pending payments, when there are no steps. */
|
|
113
|
+
pendingCode: string | null;
|
|
114
|
+
}
|
|
115
|
+
export interface CheckoutPayer {
|
|
116
|
+
name: string | null;
|
|
117
|
+
phone: string | null;
|
|
118
|
+
email: string | null;
|
|
119
|
+
}
|
|
120
|
+
/** One payment as the checkout shows it (`checkout.queries.get`). */
|
|
121
|
+
export interface CheckoutView {
|
|
122
|
+
id: string;
|
|
123
|
+
status: CheckoutPaymentStatusEnum;
|
|
124
|
+
test: boolean;
|
|
125
|
+
/** Minor units. */
|
|
126
|
+
amount: number;
|
|
127
|
+
currency: CurrencyEnum;
|
|
128
|
+
orderRef: string | null;
|
|
129
|
+
items: Array<CheckoutItem>;
|
|
130
|
+
returnUrl: string;
|
|
131
|
+
expiresAt: number;
|
|
132
|
+
paidAt: number | null;
|
|
133
|
+
payer: CheckoutPayer;
|
|
134
|
+
/** The payer country the app sent: any ISO 3166-1 alpha-2 code, lowercase (`be`). */
|
|
135
|
+
country: string | null;
|
|
136
|
+
language: LangEnum | null;
|
|
137
|
+
theme: CheckoutThemeEnum | null;
|
|
138
|
+
preferredMethod: string | null;
|
|
139
|
+
preferredTab: CheckoutTabEnum | null;
|
|
140
|
+
app: CheckoutApp;
|
|
141
|
+
methods: Array<CheckoutMethod>;
|
|
142
|
+
/**
|
|
143
|
+
* False for a store product's payment until the payment sheet first
|
|
144
|
+
* opens it: its currency and amount are not set yet.
|
|
145
|
+
*/
|
|
146
|
+
priced: boolean;
|
|
147
|
+
/** The stores of its product: the payment sheet shows its own phone's one. */
|
|
148
|
+
stores: Array<CheckoutStore>;
|
|
149
|
+
/** Payer-caused failures it still takes before it locks, out of `maxAttempts`. */
|
|
150
|
+
attemptsLeft: number;
|
|
151
|
+
maxAttempts: number;
|
|
152
|
+
attempt: CheckoutAttempt | null;
|
|
153
|
+
/**
|
|
154
|
+
* Where the checkout is served, without a trailing slash: the payment
|
|
155
|
+
* sheet loads card fields pages (`cardFieldsPath`) from it.
|
|
156
|
+
*/
|
|
157
|
+
siteUrl: string;
|
|
158
|
+
}
|
|
159
|
+
/** Where the request came from, for picking the payer's country. */
|
|
160
|
+
export interface CountryClues {
|
|
161
|
+
/** From the proxy's country header, when it sends one. */
|
|
162
|
+
ipCountry: string | null;
|
|
163
|
+
/** Browser languages in preference order (`fr-CM`). */
|
|
164
|
+
languages: Array<string>;
|
|
165
|
+
}
|
|
166
|
+
export interface OperatorDetection {
|
|
167
|
+
/** The operator the number belongs to, once enough digits say so. */
|
|
168
|
+
operator: MethodBrandEnum | null;
|
|
169
|
+
/** Enough digits were typed and no known operator matches. */
|
|
170
|
+
unrecognized: boolean;
|
|
171
|
+
}
|
|
172
|
+
export interface PhoneInputs {
|
|
173
|
+
country: CountryEnum;
|
|
174
|
+
/** Digits of the national number, no dial code and no spaces. */
|
|
175
|
+
digits: string;
|
|
176
|
+
/** A full international number of a country the payment is not offered in. */
|
|
177
|
+
foreign: boolean;
|
|
178
|
+
touched: boolean;
|
|
179
|
+
focused: boolean;
|
|
180
|
+
submitTried: boolean;
|
|
181
|
+
}
|
|
182
|
+
export interface PhoneStatus {
|
|
183
|
+
error: PhoneErrorEnum | null;
|
|
184
|
+
valid: boolean;
|
|
185
|
+
operator: MethodBrandEnum | null;
|
|
186
|
+
}
|
|
187
|
+
/** What the payer typed, read: its country and national digits. */
|
|
188
|
+
export interface TypedNumber {
|
|
189
|
+
country: CountryEnum;
|
|
190
|
+
digits: string;
|
|
191
|
+
/** A `+…` number kept as typed while its country is unknown or not offered. */
|
|
192
|
+
pending: string | null;
|
|
193
|
+
}
|
|
194
|
+
export interface PhoneNumberOptions {
|
|
195
|
+
country: CountryEnum;
|
|
196
|
+
/** Countries of this payment's Mobile Money methods. */
|
|
197
|
+
countries: Array<CountryEnum>;
|
|
198
|
+
/** The payer typed or pasted a full number of another offered country. */
|
|
199
|
+
onCountryChange: (country: CountryEnum) => void;
|
|
200
|
+
}
|
|
201
|
+
/** The Mobile Money number without its field: each platform draws and wires its own input. */
|
|
202
|
+
export interface PhoneNumber {
|
|
203
|
+
/** What the field shows: the number grouped the country's way. */
|
|
204
|
+
value: string;
|
|
205
|
+
/**
|
|
206
|
+
* The field's new text and where its caret was; answers where the caret
|
|
207
|
+
* goes in the grouped number, or null to leave it (an international number).
|
|
208
|
+
*/
|
|
209
|
+
type: (text: string, caret: number) => number | null;
|
|
210
|
+
/** E.164, empty until the number is complete. */
|
|
211
|
+
e164: string;
|
|
212
|
+
dial: string;
|
|
213
|
+
placeholder: string;
|
|
214
|
+
status: PhoneStatus;
|
|
215
|
+
focused: boolean;
|
|
216
|
+
onFocus: () => void;
|
|
217
|
+
onBlur: () => void;
|
|
218
|
+
/** Marks the field as submitted, so its error shows. */
|
|
219
|
+
reject: () => void;
|
|
220
|
+
/** The app's number for the payer, when it is of the page's country. */
|
|
221
|
+
fill: (e164: string) => void;
|
|
222
|
+
}
|
|
223
|
+
/** What the payer did on this page; the payment itself comes from the gateway. */
|
|
224
|
+
export interface CheckoutUi {
|
|
225
|
+
tab: CheckoutTabEnum;
|
|
226
|
+
country: CountryEnum;
|
|
227
|
+
/** The Mobile Money method picked, if any. */
|
|
228
|
+
method: string | null;
|
|
229
|
+
/** The payment code typed for an OTP method; cleared when the method changes. */
|
|
230
|
+
code: string;
|
|
231
|
+
/** A card method's fields say the card is complete. */
|
|
232
|
+
cardComplete: boolean;
|
|
233
|
+
/** Pay went to the card fields page: the form stays until it says how it went. */
|
|
234
|
+
cardPaying: boolean;
|
|
235
|
+
/** The step the payer asked for; the details show only once a usable method is picked. */
|
|
236
|
+
step: CheckoutStepEnum;
|
|
237
|
+
summaryOpen: boolean;
|
|
238
|
+
submitting: boolean;
|
|
239
|
+
/** An attempt the payer walked away from: the form shows again. */
|
|
240
|
+
dismissed: string | null;
|
|
241
|
+
redirecting: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* Continue pressed with no method picked, counted: the list turns red and
|
|
244
|
+
* shakes once per press. Back to 0 once a method is picked.
|
|
245
|
+
*/
|
|
246
|
+
methodMissing: number;
|
|
247
|
+
/** The payer country (GLOSSARY), lowercase (`be`), with Mobile Money or not; null when nothing names one. */
|
|
248
|
+
payerCountry: string | null;
|
|
249
|
+
/** The app sent it; else it was guessed, and the payer may be elsewhere. */
|
|
250
|
+
countrySent: boolean;
|
|
251
|
+
/** A bank redirect's account holder, as typed: the app's `payer.name` at first. Trimmed on Pay. */
|
|
252
|
+
payerName: string;
|
|
253
|
+
/** Pay pressed without a first and a last name, counted: the field says so, once per press. */
|
|
254
|
+
nameMissing: number;
|
|
255
|
+
/** "Paying from another country?" was opened: the other countries' bank redirects show. */
|
|
256
|
+
otherBanksOpen: boolean;
|
|
257
|
+
}
|
|
258
|
+
/** Everything the screens show that follows from the payment and the page, worked out once. */
|
|
259
|
+
export interface CheckoutDerived {
|
|
260
|
+
screen: CheckoutScreenEnum;
|
|
261
|
+
/** Countries with Mobile Money methods, in the admin's order. */
|
|
262
|
+
countries: Array<CountryEnum>;
|
|
263
|
+
wallets: Array<CheckoutMethod>;
|
|
264
|
+
cards: Array<CheckoutMethod>;
|
|
265
|
+
/** The step shown: the details only while a usable method is picked. */
|
|
266
|
+
step: CheckoutStepEnum;
|
|
267
|
+
/**
|
|
268
|
+
* The other countries' bank redirects, under "Paying from another
|
|
269
|
+
* country?": none when the app sent the payer country.
|
|
270
|
+
*/
|
|
271
|
+
otherBanks: Array<CheckoutMethod>;
|
|
272
|
+
/** They show: opened, or one of them is picked. */
|
|
273
|
+
otherBanksOpen: boolean;
|
|
274
|
+
/** Pay was pressed on a bank redirect without a first and a last name, still not typed: the name field says so. */
|
|
275
|
+
nameError: boolean;
|
|
276
|
+
/** The picked method, while it can still be used. */
|
|
277
|
+
selected: CheckoutMethod | null;
|
|
278
|
+
canPay: boolean;
|
|
279
|
+
/** The available method of the country the typed number belongs to. */
|
|
280
|
+
detected: CheckoutMethod | null;
|
|
281
|
+
/** The number belongs to another method of the country than the one picked. */
|
|
282
|
+
mismatch: CheckoutMethod | null;
|
|
283
|
+
/** After a failure: another method of the same country the payer can use now. */
|
|
284
|
+
suggestion: CheckoutMethod | null;
|
|
285
|
+
/** What the payer pays: the picked method's price, else the last attempt's, else the payment's amount (ADR 0012). */
|
|
286
|
+
total: Price;
|
|
287
|
+
}
|
|
288
|
+
export interface CheckoutCoreActions {
|
|
289
|
+
/**
|
|
290
|
+
* The store tab's button: an attempt for the store's sheet, or null when
|
|
291
|
+
* refused (said in a toast) or with no store calls (the web, the preview).
|
|
292
|
+
* `refundConsent`: the tab showed the refund consent line (ADR 0008).
|
|
293
|
+
*/
|
|
294
|
+
payWithStore: (store: PhoneStoreEnum, refundConsent: boolean) => Promise<StoreAttemptResult | null>;
|
|
295
|
+
toggleSummary: () => void;
|
|
296
|
+
setTab: (tab: CheckoutTabEnum) => void;
|
|
297
|
+
setCountry: (country: CountryEnum) => void;
|
|
298
|
+
selectMethod: (method: CheckoutMethod) => void;
|
|
299
|
+
/** A greyed wallet no provider offers yet was tapped. */
|
|
300
|
+
comingSoon: (name: string) => void;
|
|
301
|
+
/** On to the details of the method picked; with none, the list says so. */
|
|
302
|
+
continueToDetails: () => void;
|
|
303
|
+
/** Back to the methods, the number kept, the payment code and card cleared; not while Pay is on its way. */
|
|
304
|
+
backToMethods: () => void;
|
|
305
|
+
switchToDetected: () => void;
|
|
306
|
+
pay: () => void;
|
|
307
|
+
/** The failed attempt again: same method, same number. An OTP method asks for a new code first. */
|
|
308
|
+
retry: () => void;
|
|
309
|
+
setCode: (code: string) => void;
|
|
310
|
+
/** The phone could not open its dialler on the OTP method's code: dial it by hand. */
|
|
311
|
+
cannotDial: () => void;
|
|
312
|
+
/** Leaves the failure screen for the suggested method, or the list. */
|
|
313
|
+
useAnother: () => void;
|
|
314
|
+
/** The phone could not open its dialler on a waiting attempt's code: dial it by hand. */
|
|
315
|
+
cannotDialCode: (code: string) => void;
|
|
316
|
+
/** The bank redirect's Full name field, as typed. */
|
|
317
|
+
setPayerName: (name: string) => void;
|
|
318
|
+
/** "Paying from another country?": the other countries' bank redirects. */
|
|
319
|
+
showOtherBanks: () => void;
|
|
320
|
+
/** The payer did not finish on the bank's page whose window was lost: the gateway hears it closed. */
|
|
321
|
+
notFinished: () => void;
|
|
322
|
+
/** "Didn't get it?": a new request. */
|
|
323
|
+
sendAgain: () => void;
|
|
324
|
+
cancel: () => void;
|
|
325
|
+
returnNow: () => void;
|
|
326
|
+
openHelp: () => void;
|
|
327
|
+
closeHelp: () => void;
|
|
328
|
+
copyReference: () => void;
|
|
329
|
+
simulate: (outcome: SimulatorOutcomeEnum) => void;
|
|
330
|
+
}
|
|
331
|
+
/** The checkout's state and actions, the same on the web page and in the payment sheet. */
|
|
332
|
+
/** One short message over the page. */
|
|
333
|
+
export interface CheckoutToast {
|
|
334
|
+
message: string;
|
|
335
|
+
tone: CheckoutToastToneEnum;
|
|
336
|
+
/** The method it is about, shown in place of the tone's icon. */
|
|
337
|
+
logo: ProviderLogoEnum | null;
|
|
338
|
+
}
|
|
339
|
+
export interface CheckoutCore {
|
|
340
|
+
/** Null for a link that matches no payment. */
|
|
341
|
+
view: CheckoutView | null;
|
|
342
|
+
ui: CheckoutUi;
|
|
343
|
+
derived: CheckoutDerived;
|
|
344
|
+
phone: PhoneNumber;
|
|
345
|
+
/** Seconds left on the waiting screen's clock. */
|
|
346
|
+
waitLeft: number;
|
|
347
|
+
/** Steps and codes the waiting screen offers now. */
|
|
348
|
+
dialHelp: DialHelp;
|
|
349
|
+
/** Seconds before the success screen sends the payer back. */
|
|
350
|
+
returnLeft: number;
|
|
351
|
+
helpOpen: boolean;
|
|
352
|
+
toast: CheckoutToast | null;
|
|
353
|
+
copied: boolean;
|
|
354
|
+
/** The Branding tab's preview: nothing can be paid. */
|
|
355
|
+
preview: boolean;
|
|
356
|
+
/** The card fields' content height, as their page last said; null until it loaded. */
|
|
357
|
+
cardHeight: number | null;
|
|
358
|
+
/** A bank's 3D Secure page shows in the card fields' page: it takes the room it needs, brought into view. */
|
|
359
|
+
cardBankPage: boolean;
|
|
360
|
+
/**
|
|
361
|
+
* The waiting bank redirect's window reads shut, with no word from our
|
|
362
|
+
* return page, and the bank has not approved: the payer may still be
|
|
363
|
+
* paying there (ADR 0014), or may say they did not finish (`notFinished`).
|
|
364
|
+
*/
|
|
365
|
+
bankWindowLost: boolean;
|
|
366
|
+
actions: CheckoutCoreActions;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* What only the platform can do, handed to the controller. Pass one stable
|
|
370
|
+
* object: a new one each render subscribes again.
|
|
371
|
+
*/
|
|
372
|
+
export interface CheckoutPlatform {
|
|
373
|
+
/** Calls `listener` each time the payer comes back to the page or the app; answers how to stop. */
|
|
374
|
+
onReturn: (listener: () => void) => () => void;
|
|
375
|
+
/** Calls `listener` each time the payer leaves the page or the app; answers how to stop. */
|
|
376
|
+
onLeave: (listener: () => void) => () => void;
|
|
377
|
+
/** The payer is away from the page or the app right now. */
|
|
378
|
+
isAway: () => boolean;
|
|
379
|
+
copyText: (text: string) => void;
|
|
380
|
+
/** Leaves for the app's return URL. */
|
|
381
|
+
openUrl: (url: string) => void;
|
|
382
|
+
/** Calls `listener` with each message the card fields page sends; answers how to stop. */
|
|
383
|
+
onCardMessage: (listener: (message: CardFieldsMessage) => void) => () => void;
|
|
384
|
+
/** Tells the card fields page that Pay was pressed. */
|
|
385
|
+
submitCard: () => void;
|
|
386
|
+
/**
|
|
387
|
+
* Opens PayPal's window at once (a browser blocks one opened later) on
|
|
388
|
+
* the order `started` resolves to; a failed start (null, not ok) closes
|
|
389
|
+
* it. Answers how it ended, or null when no window could open.
|
|
390
|
+
*/
|
|
391
|
+
openPaypal: (started: Promise<PaypalStartResult | null>) => Promise<ProviderWindowEndEnum> | null;
|
|
392
|
+
/** Closes PayPal's window or the bank's once the payer approved, or the attempt settled; PayPal's SDK closes its own. */
|
|
393
|
+
closeProviderWindow: () => void;
|
|
394
|
+
/**
|
|
395
|
+
* Opens a window for the bank at once (a browser blocks one opened later),
|
|
396
|
+
* and sends it to the bank's link `started` resolves to; a failed start
|
|
397
|
+
* closes it. Answers how it ended. The payment sheet opens its in-app
|
|
398
|
+
* browser once the link is known.
|
|
399
|
+
*/
|
|
400
|
+
openBankRedirect: (started: Promise<WindowStartResult | null>) => Promise<ProviderWindowEndEnum>;
|
|
401
|
+
/** Pay found the number wrong: draw the payer's eye to the field. */
|
|
402
|
+
onPhoneRejected: () => void;
|
|
403
|
+
/** The phone's store and its country, which price a product payment; null without one (the web, Expo Go). */
|
|
404
|
+
phoneStore: () => Promise<PhoneStore | null>;
|
|
405
|
+
/** Tells the platform's error reporter about a call that failed, `about` naming it ('pay', 'open'); none on the sheet. */
|
|
406
|
+
report?: (error: unknown, about: string) => void;
|
|
407
|
+
}
|
|
408
|
+
/** The store on the payer's phone, as the payment sheet reads it. */
|
|
409
|
+
export interface PhoneStore {
|
|
410
|
+
/** As the store says it: `CI` on Google Play, `CIV` on the App Store. */
|
|
411
|
+
storeCountry: string;
|
|
412
|
+
store: PhoneStoreEnum;
|
|
413
|
+
}
|
|
414
|
+
/** What the page says when the payer opens the link. */
|
|
415
|
+
export interface OpenArgs extends Partial<PhoneStore> {
|
|
416
|
+
paymentId: string;
|
|
417
|
+
}
|
|
418
|
+
export interface CheckoutControllerOptions {
|
|
419
|
+
clues: CountryClues;
|
|
420
|
+
/** Null on the Branding tab's preview: nothing is paid there. */
|
|
421
|
+
calls: CheckoutCalls | null;
|
|
422
|
+
platform: CheckoutPlatform;
|
|
423
|
+
}
|
|
424
|
+
/** What a checkout asks of the gateway about its payment, from `useCheckoutPayment`. */
|
|
425
|
+
export interface CheckoutCalls {
|
|
426
|
+
/** Each call that changes the payment reads it again before it answers. */
|
|
427
|
+
mutations: CheckoutMutations;
|
|
428
|
+
/** Opens or closes the live connection: open only while the payer is on the waiting screen. */
|
|
429
|
+
follow: (on: boolean) => void;
|
|
430
|
+
/** Reads the payment again: the card fields page started an attempt the checkout did not. */
|
|
431
|
+
refresh: () => void;
|
|
432
|
+
/** Says the payment could not load: open failed for good on a payment still waiting for its price. */
|
|
433
|
+
fail: () => void;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* How a checkout reaches the gateway (ADR 0006): plain calls, and a live
|
|
437
|
+
* connection to one payment only while the payer waits on it.
|
|
438
|
+
*/
|
|
439
|
+
export interface CheckoutConnection {
|
|
440
|
+
/** The payment's checkout view, read once; null: no payment has this id. */
|
|
441
|
+
load: (paymentId: string) => Promise<CheckoutView | null>;
|
|
442
|
+
/**
|
|
443
|
+
* Opens a live connection to one payment: `onView` with each answer,
|
|
444
|
+
* `onError` when it cannot load. Answers how to close it.
|
|
445
|
+
*/
|
|
446
|
+
follow: (paymentId: string, onView: (view: CheckoutView | null) => void, onError: () => void) => () => void;
|
|
447
|
+
mutations: CheckoutMutations;
|
|
448
|
+
}
|
|
449
|
+
/** What a checkout last heard of its payment. */
|
|
450
|
+
export interface HeldPayment {
|
|
451
|
+
/** `undefined` while loading, null for a link that matches none. */
|
|
452
|
+
view: CheckoutView | null | undefined;
|
|
453
|
+
/** The last read failed. */
|
|
454
|
+
failed: boolean;
|
|
455
|
+
}
|
|
456
|
+
/** One payment as a checkout holds it, from `useCheckoutPayment`. */
|
|
457
|
+
export interface CheckoutPayment extends HeldPayment {
|
|
458
|
+
calls: CheckoutCalls;
|
|
459
|
+
}
|
|
460
|
+
/** What Pay answers: refused with a reason, or an attempt started. */
|
|
461
|
+
export interface PayResult {
|
|
462
|
+
ok: boolean;
|
|
463
|
+
reason?: PayRefusalEnum;
|
|
464
|
+
}
|
|
465
|
+
/** What starting a payment in a window of PayPal's answers (ADR 0010, 0014). */
|
|
466
|
+
export interface WindowStartResult extends PayResult {
|
|
467
|
+
reference?: string;
|
|
468
|
+
/** Where the payer approves: PayPal's window, the bank's page; null when the start failed. */
|
|
469
|
+
approvalUrl?: string | null;
|
|
470
|
+
/** PayPal cannot take this method now: the payer picks another (bank redirects). */
|
|
471
|
+
unavailable?: boolean;
|
|
472
|
+
}
|
|
473
|
+
export interface PaypalStartResult extends WindowStartResult {
|
|
474
|
+
/** The order PayPal's v6 SDK opens (web). */
|
|
475
|
+
orderId?: string | null;
|
|
476
|
+
}
|
|
477
|
+
/** The gateway calls the page makes; none on the Branding tab's preview. */
|
|
478
|
+
export interface CheckoutMutations {
|
|
479
|
+
pay: (args: {
|
|
480
|
+
paymentId: string;
|
|
481
|
+
method: string;
|
|
482
|
+
phone: string;
|
|
483
|
+
}) => Promise<PayResult>;
|
|
484
|
+
/** OTP methods: Pay with the payment code, which the server never stores. */
|
|
485
|
+
payWithCode: (args: {
|
|
486
|
+
paymentId: string;
|
|
487
|
+
method: string;
|
|
488
|
+
phone: string;
|
|
489
|
+
otp: string;
|
|
490
|
+
}) => Promise<PayResult>;
|
|
491
|
+
checkNow: (args: {
|
|
492
|
+
paymentId: string;
|
|
493
|
+
}) => Promise<null>;
|
|
494
|
+
/** PayPal: our attempt and PayPal's order, and the window to approve it in. */
|
|
495
|
+
startPaypal: (args: {
|
|
496
|
+
paymentId: string;
|
|
497
|
+
method: string;
|
|
498
|
+
}) => Promise<PaypalStartResult>;
|
|
499
|
+
/**
|
|
500
|
+
* PayPal's window or the bank's closed: not approved by then, the attempt
|
|
501
|
+
* fails as cancelled; `errorCode` is the cancel page's (`processing_error`: the bank refused).
|
|
502
|
+
*/
|
|
503
|
+
paypalClosed: (args: {
|
|
504
|
+
reference: string;
|
|
505
|
+
errorCode?: string;
|
|
506
|
+
}) => Promise<null>;
|
|
507
|
+
/** The payer approved in PayPal's window: a status check now, which captures. */
|
|
508
|
+
paypalReturned: (args: {
|
|
509
|
+
reference: string;
|
|
510
|
+
}) => Promise<null>;
|
|
511
|
+
/** A bank redirect (ADR 0014): our attempt and PayPal's order, in the account holder's name, and the bank's link. */
|
|
512
|
+
startBankRedirect: (args: {
|
|
513
|
+
paymentId: string;
|
|
514
|
+
method: string;
|
|
515
|
+
payerName: string;
|
|
516
|
+
}) => Promise<WindowStartResult>;
|
|
517
|
+
/** The payer opened the link; the funnel counts the first time only, and it prices a product payment. */
|
|
518
|
+
open: (args: OpenArgs) => Promise<null>;
|
|
519
|
+
cancel: (args: {
|
|
520
|
+
paymentId: string;
|
|
521
|
+
}) => Promise<null>;
|
|
522
|
+
resend: (args: {
|
|
523
|
+
paymentId: string;
|
|
524
|
+
}) => Promise<{
|
|
525
|
+
ok: boolean;
|
|
526
|
+
}>;
|
|
527
|
+
simulate: (args: {
|
|
528
|
+
paymentId: string;
|
|
529
|
+
outcome: SimulatorOutcomeEnum;
|
|
530
|
+
}) => Promise<null>;
|
|
531
|
+
/** The payment sheet's store tab; the web has none. */
|
|
532
|
+
store?: StoreMutations;
|
|
533
|
+
}
|
|
534
|
+
/** The payment sheet's calls for its store tab (ADR 0007). */
|
|
535
|
+
export interface StoreMutations {
|
|
536
|
+
/** An attempt, with the token the store's purchase carries. */
|
|
537
|
+
payWithStore: (args: {
|
|
538
|
+
paymentId: string;
|
|
539
|
+
store: PhoneStoreEnum;
|
|
540
|
+
/** The sheet showed the refund consent line: only then is it kept. */
|
|
541
|
+
refundConsent: boolean;
|
|
542
|
+
}) => Promise<StoreAttemptResult>;
|
|
543
|
+
/** What the store gave for the attempt: IAPKit's verify decides. */
|
|
544
|
+
sendStorePurchase: (args: {
|
|
545
|
+
paymentId: string;
|
|
546
|
+
reference: string;
|
|
547
|
+
purchase: string;
|
|
548
|
+
}) => Promise<{
|
|
549
|
+
ok: boolean;
|
|
550
|
+
}>;
|
|
551
|
+
/** How the store's sheet ended with no purchase. */
|
|
552
|
+
storeSheet: (args: {
|
|
553
|
+
paymentId: string;
|
|
554
|
+
reference: string;
|
|
555
|
+
outcome: StoreSheetOutcomeEnum;
|
|
556
|
+
}) => Promise<null>;
|
|
557
|
+
}
|
|
558
|
+
/** What the store button answers: an attempt for the store's sheet, or why not. */
|
|
559
|
+
export interface StoreAttemptResult extends PayResult {
|
|
560
|
+
reference?: string;
|
|
561
|
+
/** A UUID: `appAccountToken` on iOS, `obfuscatedAccountId` on Android. */
|
|
562
|
+
token?: string;
|
|
563
|
+
productId?: string;
|
|
564
|
+
}
|
|
565
|
+
/** A card fields page's address: the payment, its method, and the look of the checkout that shows it. */
|
|
566
|
+
export interface CardFieldsSearch {
|
|
567
|
+
payment?: string;
|
|
568
|
+
method?: string;
|
|
569
|
+
/** The app colour, a hex code. */
|
|
570
|
+
color?: string;
|
|
571
|
+
theme?: CheckoutThemeEnum.DARK;
|
|
572
|
+
}
|
|
573
|
+
/** A card fields page's payment, method and look, from its address. */
|
|
574
|
+
export interface CardFieldsPageProps {
|
|
575
|
+
/** Null when the page is opened on its own: nothing can be paid. */
|
|
576
|
+
paymentId: string | null;
|
|
577
|
+
method: string | null;
|
|
578
|
+
/** The app colour, a hex code. */
|
|
579
|
+
color: string | null;
|
|
580
|
+
dark: boolean;
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* A brand by its tile and its name: a card network taken (its tile also the
|
|
584
|
+
* name card fields give it, `visa`, and ours, `Visa`), or a bank redirect.
|
|
585
|
+
*/
|
|
586
|
+
export interface BrandTile {
|
|
587
|
+
logo: ProviderLogoEnum;
|
|
588
|
+
name: string;
|
|
589
|
+
}
|
|
590
|
+
/** GLOSSARY: Bank redirect. Its tile's logo is also its method id (ADR 0014). */
|
|
591
|
+
export interface BankRedirect extends BrandTile {
|
|
592
|
+
/** The country whose bank scheme it is: the payer country it shows for. */
|
|
593
|
+
country: CountryEnum;
|
|
594
|
+
/** The least PayPal takes, in euro cents, when it sets one. */
|
|
595
|
+
minAmount?: number;
|
|
596
|
+
}
|
|
597
|
+
/** What a card fields page and the checkout send each other (`CardFieldsMessageEnum`). */
|
|
598
|
+
export interface CardFieldsMessage {
|
|
599
|
+
type: CardFieldsMessageEnum;
|
|
600
|
+
complete?: boolean;
|
|
601
|
+
height?: number;
|
|
602
|
+
reason?: PayRefusalEnum;
|
|
603
|
+
showing?: boolean;
|
|
604
|
+
}
|
|
605
|
+
/** What the return page and the checkout that opened the bank's window send each other (`BankWindowMessageEnum`). */
|
|
606
|
+
export interface BankWindowMessage {
|
|
607
|
+
type: BankWindowMessageEnum;
|
|
608
|
+
reference?: string;
|
|
609
|
+
}
|
|
610
|
+
/** How a Pay goes: the number, and the payment code of an OTP method. */
|
|
611
|
+
export interface PayVia {
|
|
612
|
+
phone: string;
|
|
613
|
+
otp?: string;
|
|
614
|
+
}
|
|
615
|
+
/** What each way of approving changes on the screens. */
|
|
616
|
+
export interface FlowTraits {
|
|
617
|
+
/** The Pay route that opens its attempt. */
|
|
618
|
+
route: PayRouteEnum;
|
|
619
|
+
/** What the form asks for before Pay (`missingBeforePay`); a code means "new code" on retry. */
|
|
620
|
+
asks: Array<FlowAskEnum>;
|
|
621
|
+
/** The tab its methods are on. */
|
|
622
|
+
tab: CheckoutTabEnum;
|
|
623
|
+
/** A prompt on the phone: the waiting screen's steps and "send it again". */
|
|
624
|
+
prompt: boolean;
|
|
625
|
+
/**
|
|
626
|
+
* The waiting screen counts down, and gives the form back at the end. Not
|
|
627
|
+
* for a store's sheet or a provider's window, which take their own time.
|
|
628
|
+
*/
|
|
629
|
+
clock: boolean;
|
|
630
|
+
/**
|
|
631
|
+
* The payer leaves for a provider's page (PayPal's own, or the bank's it
|
|
632
|
+
* sends the payer to, ADR 0014): closed once approved or settled.
|
|
633
|
+
*/
|
|
634
|
+
providerWindow: boolean;
|
|
635
|
+
/** The price group its methods take their price from (GLOSSARY: Price); none for a store, which sets its own. */
|
|
636
|
+
priceGroup: PriceGroupEnum | null;
|
|
637
|
+
/** One country's own scheme (a bank redirect): shown for the payer country. */
|
|
638
|
+
countryScheme: boolean;
|
|
639
|
+
/** The line under a method's name. */
|
|
640
|
+
line: MethodLineEnum;
|
|
641
|
+
/** Pays through the provider's own button (PayPal's), not ours. */
|
|
642
|
+
ownButton: boolean;
|
|
643
|
+
/** Shows the generic card tile, whatever networks it takes, not a brand logo. */
|
|
644
|
+
genericTile: boolean;
|
|
645
|
+
/**
|
|
646
|
+
* The payer coming back from the provider's page settles the turn (a bank
|
|
647
|
+
* redirect, ADR 0014): a later close is no cancel.
|
|
648
|
+
*/
|
|
649
|
+
returnFinal: boolean;
|
|
650
|
+
/** What the Simulator offers that this flow's payer cannot do. */
|
|
651
|
+
hiddenOutcomes: Array<SimulatorOutcomeEnum>;
|
|
652
|
+
}
|
|
653
|
+
/** What the payer typed or gave so far, as `missingBeforePay` reads it. */
|
|
654
|
+
export interface PayInput {
|
|
655
|
+
phoneValid: boolean;
|
|
656
|
+
/** The payment code, as typed. */
|
|
657
|
+
code: string;
|
|
658
|
+
/** The card fields say the card is complete. */
|
|
659
|
+
cardComplete: boolean;
|
|
660
|
+
payerName: string;
|
|
661
|
+
}
|
|
662
|
+
/** The checkout's themed colours (`--ck-*` in `checkout.css`), for a platform without the stylesheet. */
|
|
663
|
+
export interface CheckoutColors {
|
|
664
|
+
page: string;
|
|
665
|
+
surface: string;
|
|
666
|
+
tabOn: string;
|
|
667
|
+
fill: string;
|
|
668
|
+
fill2: string;
|
|
669
|
+
fill3: string;
|
|
670
|
+
ink: string;
|
|
671
|
+
inkStrong: string;
|
|
672
|
+
ink2: string;
|
|
673
|
+
muted: string;
|
|
674
|
+
faint: string;
|
|
675
|
+
line: string;
|
|
676
|
+
line2: string;
|
|
677
|
+
line3: string;
|
|
678
|
+
line4: string;
|
|
679
|
+
danger: string;
|
|
680
|
+
dangerSoft: string;
|
|
681
|
+
warnSoft: string;
|
|
682
|
+
warnLine: string;
|
|
683
|
+
warnInk: string;
|
|
684
|
+
warnInk2: string;
|
|
685
|
+
successInk: string;
|
|
686
|
+
}
|
|
687
|
+
export interface CheckoutPreviewApp {
|
|
688
|
+
name: string;
|
|
689
|
+
color: string;
|
|
690
|
+
logoUrl: string | null;
|
|
691
|
+
}
|
|
692
|
+
export interface SupportContact {
|
|
693
|
+
channel: SupportChannelEnum;
|
|
694
|
+
value: string;
|
|
695
|
+
href: string;
|
|
696
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|