@brissoto/pay-react-native 0.0.0-stage → 1.5.0
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 +181 -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 +302 -0
- package/dist/checkout-core/messages/en.js +301 -0
- package/dist/checkout-core/messages/fr.d.ts +4 -0
- package/dist/checkout-core/messages/fr.js +302 -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 +233 -0
- package/dist/checkout-core/models/checkout.enum.js +259 -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 +698 -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 +331 -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 +133 -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 +141 -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 +6 -0
- package/dist/components/SheetTerminal.js +31 -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 +426 -0
- package/dist/models/sheet.interface.js +1 -0
- package/dist/models/sheet.utils.d.ts +68 -0
- package/dist/models/sheet.utils.js +214 -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,214 @@
|
|
|
1
|
+
import { CardFieldsMessageEnum, CheckoutPaymentStatusEnum, CheckoutThemeEnum, PayRefusalEnum, StoreSheetOutcomeEnum, } from "../checkout-core/models/checkout.enum.js";
|
|
2
|
+
import { AttemptStatusEnum, LangEnum, } from "../checkout-core/models/domain.enum.js";
|
|
3
|
+
import { BANK_PAGE_VIEWPORT, PAGE_VIEWPORT, PILL_ROW_HEIGHT, SHEET_FLICK_SPEED, SHEET_SWIPE_DISTANCE, STORE_TOKEN_PATTERN, } from "./sheet.constants.js";
|
|
4
|
+
import { StoreErrorCodeEnum, StorePurchaseStateEnum } from "./sheet.enum.js";
|
|
5
|
+
/** The payment's language, else the device's when the sheet speaks it, else English. */
|
|
6
|
+
export function sheetLanguage(payment, deviceLocale) {
|
|
7
|
+
if (payment)
|
|
8
|
+
return payment;
|
|
9
|
+
const device = deviceLocale.slice(0, 2).toLowerCase();
|
|
10
|
+
return Object.values(LangEnum).find((lang) => lang === device) ?? LangEnum.EN;
|
|
11
|
+
}
|
|
12
|
+
/** The payment's theme, else the device's scheme. */
|
|
13
|
+
export function sheetTheme(payment, scheme) {
|
|
14
|
+
return (payment ??
|
|
15
|
+
(scheme === CheckoutThemeEnum.DARK
|
|
16
|
+
? CheckoutThemeEnum.DARK
|
|
17
|
+
: CheckoutThemeEnum.LIGHT));
|
|
18
|
+
}
|
|
19
|
+
/** What `presentPayment` answers when the sheet closes on this payment. */
|
|
20
|
+
export function sheetResult(view, failed) {
|
|
21
|
+
if (view === null)
|
|
22
|
+
return { status: 'closed', error: 'not_found' };
|
|
23
|
+
if (!view)
|
|
24
|
+
return failed
|
|
25
|
+
? { status: 'closed', error: 'network' }
|
|
26
|
+
: { status: 'closed' };
|
|
27
|
+
if (view.status !== CheckoutPaymentStatusEnum.PENDING) {
|
|
28
|
+
return { status: view.status };
|
|
29
|
+
}
|
|
30
|
+
// No method could ever take it: the app may offer something else.
|
|
31
|
+
if (view.unavailable)
|
|
32
|
+
return { status: 'unavailable' };
|
|
33
|
+
// A prompt still on the phone: approved later, the payment goes through.
|
|
34
|
+
return {
|
|
35
|
+
status: view.attempt?.status === AttemptStatusEnum.PENDING ? 'pending' : 'closed',
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** `cm` → 🇨🇲: the country's flag, as the phone draws it. */
|
|
39
|
+
export function flagOf(country) {
|
|
40
|
+
return String.fromCodePoint(...[...country.toUpperCase()].map((letter) => 0x1f1e6 + letter.charCodeAt(0) - 'A'.charCodeAt(0)));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Where a pill's list opens: the current row second from the top, the one
|
|
44
|
+
* before it showing there is more above, and never past the end, so a row
|
|
45
|
+
* near the end leaves no empty room under the list.
|
|
46
|
+
*/
|
|
47
|
+
export function pillListOffset(current, count, viewHeight) {
|
|
48
|
+
const end = Math.max(0, count * PILL_ROW_HEIGHT - viewHeight);
|
|
49
|
+
return Math.min(Math.max(0, current - 1) * PILL_ROW_HEIGHT, end);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The card fields page the sheet loads: English under `/en`, French the bare
|
|
53
|
+
* path asking for French (as the checkout link does), with the payment, the
|
|
54
|
+
* method and the sheet's look.
|
|
55
|
+
*/
|
|
56
|
+
export function cardFieldsUrl({ siteUrl, path, paymentId, method, color, dark, lang, }) {
|
|
57
|
+
const query = new URLSearchParams({
|
|
58
|
+
payment: paymentId,
|
|
59
|
+
method,
|
|
60
|
+
color,
|
|
61
|
+
theme: dark ? CheckoutThemeEnum.DARK : CheckoutThemeEnum.LIGHT,
|
|
62
|
+
...(lang === LangEnum.FR ? { lang } : {}),
|
|
63
|
+
});
|
|
64
|
+
const prefix = lang === LangEnum.EN ? `/${lang}` : '';
|
|
65
|
+
return `${siteUrl}${prefix}${path}?${query.toString()}`;
|
|
66
|
+
}
|
|
67
|
+
const WEB_ADDRESS = /^(https?:\/\/[^/?#]+)([^?#]*)/i;
|
|
68
|
+
const LANG_PREFIX = new RegExp(`^/(?:${Object.values(LangEnum).join('|')})(?=/|$)`);
|
|
69
|
+
/** `https://pay.brissoto.com/en/checkout` → `https://pay.brissoto.com`; null for anything not on the web. */
|
|
70
|
+
export function originOf(url) {
|
|
71
|
+
return WEB_ADDRESS.exec(url)?.[1].toLowerCase() ?? null;
|
|
72
|
+
}
|
|
73
|
+
/** The path of a web address without its language and trailing slash. */
|
|
74
|
+
function pageOf(url) {
|
|
75
|
+
const path = WEB_ADDRESS.exec(url)[2].replace(LANG_PREFIX, '');
|
|
76
|
+
return path.replace(/\/+$/, '');
|
|
77
|
+
}
|
|
78
|
+
/** The card fields page itself, in either language: the one page its WebView may load. */
|
|
79
|
+
export function isCardFieldsPage(url, page) {
|
|
80
|
+
const origin = originOf(url);
|
|
81
|
+
return (origin !== null && origin === originOf(page) && pageOf(url) === pageOf(page));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* What the card fields page said, as the core reads it, when it is one of
|
|
85
|
+
* its messages; anything else, Pay itself included, is dropped.
|
|
86
|
+
*/
|
|
87
|
+
export function cardFieldsMessageOf(data) {
|
|
88
|
+
let message;
|
|
89
|
+
try {
|
|
90
|
+
message = JSON.parse(data);
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
switch (message?.type) {
|
|
96
|
+
case CardFieldsMessageEnum.STATE:
|
|
97
|
+
return typeof message.complete === 'boolean'
|
|
98
|
+
? { type: message.type, complete: message.complete }
|
|
99
|
+
: null;
|
|
100
|
+
case CardFieldsMessageEnum.HEIGHT:
|
|
101
|
+
return typeof message.height === 'number' && message.height >= 0
|
|
102
|
+
? { type: message.type, height: message.height }
|
|
103
|
+
: null;
|
|
104
|
+
case CardFieldsMessageEnum.BANK_PAGE:
|
|
105
|
+
return typeof message.showing === 'boolean'
|
|
106
|
+
? { type: message.type, showing: message.showing }
|
|
107
|
+
: null;
|
|
108
|
+
case CardFieldsMessageEnum.DONE:
|
|
109
|
+
case CardFieldsMessageEnum.CLOSED:
|
|
110
|
+
return { type: message.type };
|
|
111
|
+
case CardFieldsMessageEnum.REFUSED:
|
|
112
|
+
return Object.values(PayRefusalEnum).includes(message.reason)
|
|
113
|
+
? { type: message.type, reason: message.reason }
|
|
114
|
+
: { type: message.type };
|
|
115
|
+
default:
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Runs in the card fields page before it loads. At the top of a WebView the
|
|
121
|
+
* page tells its checkout by posting to itself: what it posts from its own
|
|
122
|
+
* origin goes on to the sheet, Pay (which only the sheet sends) aside. While
|
|
123
|
+
* a bank's 3D Secure page shows, the page keeps its size: on iOS its field
|
|
124
|
+
* under 16px would zoom it on focus, past the sheet's edges (the last
|
|
125
|
+
* viewport tag wins). Gone, the payer may pinch again.
|
|
126
|
+
*/
|
|
127
|
+
export function cardFieldsBridge() {
|
|
128
|
+
return `var bankViewport = null;
|
|
129
|
+
function holdZoom(showing) {
|
|
130
|
+
if (!bankViewport) {
|
|
131
|
+
if (!showing) return;
|
|
132
|
+
bankViewport = document.createElement('meta');
|
|
133
|
+
bankViewport.name = 'viewport';
|
|
134
|
+
document.head.append(bankViewport);
|
|
135
|
+
}
|
|
136
|
+
bankViewport.content = showing
|
|
137
|
+
? '${BANK_PAGE_VIEWPORT}'
|
|
138
|
+
: '${PAGE_VIEWPORT}';
|
|
139
|
+
}
|
|
140
|
+
window.addEventListener('message', function (event) {
|
|
141
|
+
var data = event.data;
|
|
142
|
+
if (event.origin !== window.location.origin || event.source !== window) return;
|
|
143
|
+
if (!data || typeof data.type !== 'string' || data.type === '${CardFieldsMessageEnum.SUBMIT}') return;
|
|
144
|
+
if (data.type === '${CardFieldsMessageEnum.BANK_PAGE}') holdZoom(data.showing === true);
|
|
145
|
+
window.ReactNativeWebView.postMessage(JSON.stringify(data));
|
|
146
|
+
});
|
|
147
|
+
true;`;
|
|
148
|
+
}
|
|
149
|
+
/** Tells the card fields page that Pay was pressed, as the web checkout does. */
|
|
150
|
+
export function cardFieldsSubmit() {
|
|
151
|
+
return `window.postMessage({ type: '${CardFieldsMessageEnum.SUBMIT}' }, window.location.origin);
|
|
152
|
+
true;`;
|
|
153
|
+
}
|
|
154
|
+
/** Letting go of the sheet's top `dy` points lower, at `vy` points per ms: far enough, or flicked, it closes. */
|
|
155
|
+
export function sheetSwipeCloses(dy, vy) {
|
|
156
|
+
return dy > SHEET_SWIPE_DISTANCE || (dy > 0 && vy > SHEET_FLICK_SPEED);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* A purchase is the attempt's when it is of its product and carries its
|
|
160
|
+
* token: any other (an earlier one the store replays) is left to the next
|
|
161
|
+
* start, which recovers it.
|
|
162
|
+
*/
|
|
163
|
+
export function isAttemptPurchase(purchase, attempt) {
|
|
164
|
+
return (purchase.productId === attempt.productId &&
|
|
165
|
+
tokenOf(purchase) === attempt.token);
|
|
166
|
+
}
|
|
167
|
+
/** The token the store carried for the sheet: `appAccountToken` on iOS, `obfuscatedAccountId` on Android. */
|
|
168
|
+
const tokenOf = (purchase) => purchase.appAccountToken ?? purchase.obfuscatedAccountIdAndroid;
|
|
169
|
+
/**
|
|
170
|
+
* A purchase the store holds unfinished, as the gateway takes it again: a
|
|
171
|
+
* paid one carrying a token of ours. Null for any other (the app's own
|
|
172
|
+
* purchases, one still waiting for approval): it is left alone.
|
|
173
|
+
*/
|
|
174
|
+
export function unreportedPurchaseOf(purchase) {
|
|
175
|
+
const token = tokenOf(purchase);
|
|
176
|
+
const paid = purchase.purchaseState === StorePurchaseStateEnum.PURCHASED;
|
|
177
|
+
if (!paid || !purchase.purchaseToken || !token)
|
|
178
|
+
return null;
|
|
179
|
+
return STORE_TOKEN_PATTERN.test(token)
|
|
180
|
+
? { token, purchase: purchase.purchaseToken }
|
|
181
|
+
: null;
|
|
182
|
+
}
|
|
183
|
+
/** How the store's sheet ended, from its error: closed, waiting for approval, or failed. */
|
|
184
|
+
export function sheetOutcomeOf(code) {
|
|
185
|
+
if (code === StoreErrorCodeEnum.USER_CANCELLED) {
|
|
186
|
+
return StoreSheetOutcomeEnum.CANCELLED;
|
|
187
|
+
}
|
|
188
|
+
return code === StoreErrorCodeEnum.DEFERRED_PAYMENT
|
|
189
|
+
? StoreSheetOutcomeEnum.PENDING
|
|
190
|
+
: StoreSheetOutcomeEnum.ERROR;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* A call the sheet does not wait on: one that fails changes nothing, the
|
|
194
|
+
* next start (or status check) picks it up.
|
|
195
|
+
*/
|
|
196
|
+
export function quietly(call) {
|
|
197
|
+
call.catch(() => null);
|
|
198
|
+
}
|
|
199
|
+
/** What `read` answers within `ms`; null when it fails or is later. */
|
|
200
|
+
export async function answerWithin(read, ms) {
|
|
201
|
+
let timer;
|
|
202
|
+
const late = new Promise((resolve) => {
|
|
203
|
+
timer = setTimeout(() => resolve(null), ms);
|
|
204
|
+
});
|
|
205
|
+
try {
|
|
206
|
+
return await Promise.race([read(), late]);
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
finally {
|
|
212
|
+
clearTimeout(timer);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SheetConnection, StoreRecovery } from '../models/sheet.interface.js';
|
|
2
|
+
/**
|
|
3
|
+
* The checkout's calls to the gateway at `url` (ADR 0006): plain HTTP calls,
|
|
4
|
+
* by path, to the same public functions the web checkout calls, so the
|
|
5
|
+
* package needs none of the backend's code. A live connection is opened only
|
|
6
|
+
* to follow one payment, and closed with it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function convexCheckoutConnection(url: string): SheetConnection;
|
|
9
|
+
/**
|
|
10
|
+
* The calls that recover store purchases the app never reported (ADR 0007):
|
|
11
|
+
* one HTTP call sends each again, and a live connection follows its attempt
|
|
12
|
+
* only until it pays, closed with it. No client is made while the store
|
|
13
|
+
* holds nothing to recover.
|
|
14
|
+
*/
|
|
15
|
+
export declare function convexStoreRecovery(url: string): StoreRecovery;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ConvexClient, ConvexHttpClient } from 'convex/browser';
|
|
2
|
+
import { makeFunctionReference } from 'convex/server';
|
|
3
|
+
import { CHECKOUT_FUNCTIONS, IP_COUNTRY_PATH, IP_COUNTRY_TIMEOUT_MS, } from "../models/sheet.constants.js";
|
|
4
|
+
import { CHECKOUT_CALL_TIMEOUT_MS } from "../checkout-core/models/checkout.constants.js";
|
|
5
|
+
import { fetchWithTimeout } from "../checkout-core/models/checkout.fetch.utils.js";
|
|
6
|
+
import { answerWithin } from "../models/sheet.utils.js";
|
|
7
|
+
/**
|
|
8
|
+
* The country of the payer's connection, which Cloudflare in front of the
|
|
9
|
+
* gateway names: what the web checkout reads on its own server.
|
|
10
|
+
*/
|
|
11
|
+
function ipCountryAt(url) {
|
|
12
|
+
const ask = async () => {
|
|
13
|
+
const response = await fetch(`${url.replace(/\/+$/, '')}${IP_COUNTRY_PATH}`);
|
|
14
|
+
if (!response.ok)
|
|
15
|
+
return null;
|
|
16
|
+
const { country } = (await response.json());
|
|
17
|
+
return typeof country === 'string' ? country : null;
|
|
18
|
+
};
|
|
19
|
+
return answerWithin(ask, IP_COUNTRY_TIMEOUT_MS);
|
|
20
|
+
}
|
|
21
|
+
/** A plain client whose calls end after `CHECKOUT_CALL_TIMEOUT_MS`, as the web checkout's: a hung Pay fails, never stays on Sending. */
|
|
22
|
+
function timedClient(url) {
|
|
23
|
+
return new ConvexHttpClient(url, {
|
|
24
|
+
fetch: fetchWithTimeout(CHECKOUT_CALL_TIMEOUT_MS),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The checkout's calls to the gateway at `url` (ADR 0006): plain HTTP calls,
|
|
29
|
+
* by path, to the same public functions the web checkout calls, so the
|
|
30
|
+
* package needs none of the backend's code. A live connection is opened only
|
|
31
|
+
* to follow one payment, and closed with it.
|
|
32
|
+
*/
|
|
33
|
+
export function convexCheckoutConnection(url) {
|
|
34
|
+
const http = timedClient(url);
|
|
35
|
+
const mutation = (path) => (args) => http.mutation(makeFunctionReference(path), args);
|
|
36
|
+
const action = (path) => (args) => http.action(makeFunctionReference(path), args);
|
|
37
|
+
const get = makeFunctionReference(CHECKOUT_FUNCTIONS.get);
|
|
38
|
+
const mutations = {
|
|
39
|
+
pay: mutation(CHECKOUT_FUNCTIONS.pay),
|
|
40
|
+
payWithCode: action(CHECKOUT_FUNCTIONS.payWithCode),
|
|
41
|
+
checkNow: mutation(CHECKOUT_FUNCTIONS.checkNow),
|
|
42
|
+
open: (args) => mutation(CHECKOUT_FUNCTIONS.open)({ ...args }),
|
|
43
|
+
cancel: mutation(CHECKOUT_FUNCTIONS.cancel),
|
|
44
|
+
resend: mutation(CHECKOUT_FUNCTIONS.resend),
|
|
45
|
+
simulate: mutation(CHECKOUT_FUNCTIONS.simulate),
|
|
46
|
+
startPaypal: action(CHECKOUT_FUNCTIONS.startPaypal),
|
|
47
|
+
paypalClosed: mutation(CHECKOUT_FUNCTIONS.paypalClosed),
|
|
48
|
+
paypalReturned: mutation(CHECKOUT_FUNCTIONS.paypalReturned),
|
|
49
|
+
startBankRedirect: action(CHECKOUT_FUNCTIONS.startBankRedirect),
|
|
50
|
+
store: {
|
|
51
|
+
payWithStore: mutation(CHECKOUT_FUNCTIONS.payWithStore),
|
|
52
|
+
sendStorePurchase: mutation(CHECKOUT_FUNCTIONS.sendStorePurchase),
|
|
53
|
+
storeSheet: mutation(CHECKOUT_FUNCTIONS.storeSheet),
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
return {
|
|
57
|
+
ipCountry: () => ipCountryAt(url),
|
|
58
|
+
load: (paymentId) => http.query(get, { paymentId }),
|
|
59
|
+
follow: (paymentId, onView, onError) => {
|
|
60
|
+
const socket = new ConvexClient(url, { unsavedChangesWarning: false });
|
|
61
|
+
const stop = socket.onUpdate(get, { paymentId }, (view) => onView(view), () => onError());
|
|
62
|
+
return () => {
|
|
63
|
+
stop();
|
|
64
|
+
void socket.close();
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
mutations,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The calls that recover store purchases the app never reported (ADR 0007):
|
|
72
|
+
* one HTTP call sends each again, and a live connection follows its attempt
|
|
73
|
+
* only until it pays, closed with it. No client is made while the store
|
|
74
|
+
* holds nothing to recover.
|
|
75
|
+
*/
|
|
76
|
+
export function convexStoreRecovery(url) {
|
|
77
|
+
let http;
|
|
78
|
+
const recover = makeFunctionReference(CHECKOUT_FUNCTIONS.recoverStorePurchase);
|
|
79
|
+
const read = makeFunctionReference(CHECKOUT_FUNCTIONS.storePurchase);
|
|
80
|
+
return {
|
|
81
|
+
recover: (args) => {
|
|
82
|
+
http ??= timedClient(url);
|
|
83
|
+
return http.mutation(recover, { ...args });
|
|
84
|
+
},
|
|
85
|
+
follow: (token, onAnswer) => {
|
|
86
|
+
const socket = new ConvexClient(url, { unsavedChangesWarning: false });
|
|
87
|
+
const stop = socket.onUpdate(read, { token }, (answer) => onAnswer(answer),
|
|
88
|
+
// Unread is unpaid: the purchase waits for the next start.
|
|
89
|
+
() => onAnswer(null));
|
|
90
|
+
return () => {
|
|
91
|
+
stop();
|
|
92
|
+
void socket.close();
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ExpoWebBrowser } from '../models/sheet.interface.js';
|
|
2
|
+
/** expo-web-browser, an optional dependency: the require throws when the app has none. */
|
|
3
|
+
export declare function installedWebBrowser(): ExpoWebBrowser;
|
|
4
|
+
/**
|
|
5
|
+
* Opens a provider window on `url`, PayPal's or a bank redirect's bank (ADR 0014): an in-app browser (expo-web-browser), else
|
|
6
|
+
* the phone's browser. Resolves once the payer is back on the sheet: the
|
|
7
|
+
* browser says it closed (iOS), or, when it cannot (Android, the phone's
|
|
8
|
+
* browser), the app comes back to the front. On iOS the app going away and
|
|
9
|
+
* back (an SMS code, a password manager) is not the window closing.
|
|
10
|
+
*/
|
|
11
|
+
export declare function openProviderWindow(url: string, load?: () => ExpoWebBrowser): Promise<void>;
|
|
12
|
+
/** Closes PayPal's or the bank's in-app browser, once the attempt settled; nothing without one. */
|
|
13
|
+
export declare function closeProviderWindow(load?: () => ExpoWebBrowser): void;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { AppState, Linking } from 'react-native';
|
|
2
|
+
import { WebBrowserResultEnum } from "../models/sheet.enum.js";
|
|
3
|
+
/** expo-web-browser, an optional dependency: the require throws when the app has none. */
|
|
4
|
+
export function installedWebBrowser() {
|
|
5
|
+
return require('expo-web-browser');
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Opens a provider window on `url`, PayPal's or a bank redirect's bank (ADR 0014): an in-app browser (expo-web-browser), else
|
|
9
|
+
* the phone's browser. Resolves once the payer is back on the sheet: the
|
|
10
|
+
* browser says it closed (iOS), or, when it cannot (Android, the phone's
|
|
11
|
+
* browser), the app comes back to the front. On iOS the app going away and
|
|
12
|
+
* back (an SMS code, a password manager) is not the window closing.
|
|
13
|
+
*/
|
|
14
|
+
export function openProviderWindow(url, load = installedWebBrowser) {
|
|
15
|
+
return new Promise((resolve) => {
|
|
16
|
+
let browser = null;
|
|
17
|
+
try {
|
|
18
|
+
browser = load();
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// No in-app browser: the phone's own; the app coming back closes it.
|
|
22
|
+
}
|
|
23
|
+
/** Resolves on the app's next return to the front. */
|
|
24
|
+
const untilBack = () => {
|
|
25
|
+
const subscription = AppState.addEventListener('change', (state) => {
|
|
26
|
+
if (state !== 'active')
|
|
27
|
+
return;
|
|
28
|
+
subscription.remove();
|
|
29
|
+
resolve();
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
if (!browser) {
|
|
33
|
+
untilBack();
|
|
34
|
+
void Linking.openURL(url).catch(() => resolve());
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
browser.openBrowserAsync(url).then((result) => {
|
|
38
|
+
if (result.type === WebBrowserResultEnum.OPENED)
|
|
39
|
+
untilBack();
|
|
40
|
+
else
|
|
41
|
+
resolve();
|
|
42
|
+
}, () => resolve());
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/** Closes PayPal's or the bank's in-app browser, once the attempt settled; nothing without one. */
|
|
46
|
+
export function closeProviderWindow(load = installedWebBrowser) {
|
|
47
|
+
try {
|
|
48
|
+
void Promise.resolve(load().dismissBrowser()).catch(() => undefined);
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
// No in-app browser: the phone's own stays with the payer.
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { PhoneStoreEnum } from '../checkout-core/models/checkout.enum.js';
|
|
2
|
+
import type { PhoneStore } from '../checkout-core/models/checkout.interface.js';
|
|
3
|
+
import type { ExpoIap, StoreOffer, StorePurchase, StorePurchaseError, StoreSheetAttempt } from '../models/sheet.interface.js';
|
|
4
|
+
/** expo-iap, an optional dependency: the require throws when the app has none. */
|
|
5
|
+
export declare function installedExpoIap(): ExpoIap;
|
|
6
|
+
/** This phone's store: the App Store on an iPhone, Google Play on Android, none elsewhere. */
|
|
7
|
+
export declare const phoneStoreOf: () => PhoneStoreEnum | null;
|
|
8
|
+
/**
|
|
9
|
+
* The phone's store and the country of its account, which price a product
|
|
10
|
+
* payment (ADR 0007). Null without expo-iap (Expo Go included), off a phone,
|
|
11
|
+
* or when the store fails or takes longer than `STORE_COUNTRY_TIMEOUT_MS`:
|
|
12
|
+
* the sheet then opens at the home price.
|
|
13
|
+
*/
|
|
14
|
+
export declare function readPhoneStore(load?: () => ExpoIap): Promise<PhoneStore | null>;
|
|
15
|
+
/**
|
|
16
|
+
* What this phone's store sells the product for, or null when it does not
|
|
17
|
+
* sell it, expo-iap is missing, or the store fails: the store tab hides.
|
|
18
|
+
* The billing connection `readPhoneStore` opened is opened again if needed.
|
|
19
|
+
*/
|
|
20
|
+
export declare function readStoreOffer(productId: string, load?: () => ExpoIap): Promise<StoreOffer | null>;
|
|
21
|
+
/**
|
|
22
|
+
* Opens the store's sheet for one attempt, its token carried by the
|
|
23
|
+
* purchase on either store. How it ends comes through `listenToStore`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function openStoreSheet(attempt: StoreSheetAttempt, load?: () => ExpoIap): Promise<void>;
|
|
26
|
+
/** Hears every purchase and error of the store's sheet; answers how to stop. */
|
|
27
|
+
export declare function listenToStore(onPurchase: (purchase: StorePurchase) => void, onError: (error: StorePurchaseError) => void, load?: () => ExpoIap): () => void;
|
|
28
|
+
/** Takes a paid purchase off the store's queue, as a consumable: bought again next time. */
|
|
29
|
+
export declare function finishStorePurchase(purchase: StorePurchase, load?: () => ExpoIap): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* The purchases the store still holds unfinished: the App Store's
|
|
32
|
+
* unfinished transactions on an iPhone, Google Play's purchases not
|
|
33
|
+
* consumed yet on Android. None without expo-iap, off a phone, or when the
|
|
34
|
+
* store fails: the next start reads them again.
|
|
35
|
+
*/
|
|
36
|
+
export declare function readUnfinishedPurchases(load?: () => ExpoIap): Promise<Array<StorePurchase>>;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import { PhoneStoreEnum } from "../checkout-core/models/checkout.enum.js";
|
|
3
|
+
import { STORE_COUNTRY_TIMEOUT_MS } from "../models/sheet.constants.js";
|
|
4
|
+
import { StoreProductStatusEnum, StoreProductTypeEnum, } from "../models/sheet.enum.js";
|
|
5
|
+
import { answerWithin } from "../models/sheet.utils.js";
|
|
6
|
+
/** expo-iap, an optional dependency: the require throws when the app has none. */
|
|
7
|
+
export function installedExpoIap() {
|
|
8
|
+
return require('expo-iap');
|
|
9
|
+
}
|
|
10
|
+
const STORE_OF_PLATFORM = {
|
|
11
|
+
ios: PhoneStoreEnum.APP_STORE,
|
|
12
|
+
android: PhoneStoreEnum.GOOGLE_PLAY,
|
|
13
|
+
};
|
|
14
|
+
/** This phone's store: the App Store on an iPhone, Google Play on Android, none elsewhere. */
|
|
15
|
+
export const phoneStoreOf = () => STORE_OF_PLATFORM[Platform.OS] ?? null;
|
|
16
|
+
/**
|
|
17
|
+
* The phone's store and the country of its account, which price a product
|
|
18
|
+
* payment (ADR 0007). Null without expo-iap (Expo Go included), off a phone,
|
|
19
|
+
* or when the store fails or takes longer than `STORE_COUNTRY_TIMEOUT_MS`:
|
|
20
|
+
* the sheet then opens at the home price.
|
|
21
|
+
*/
|
|
22
|
+
export async function readPhoneStore(load = installedExpoIap) {
|
|
23
|
+
const store = STORE_OF_PLATFORM[Platform.OS];
|
|
24
|
+
if (!store)
|
|
25
|
+
return null;
|
|
26
|
+
const read = async () => {
|
|
27
|
+
const iap = load();
|
|
28
|
+
await iap.initConnection();
|
|
29
|
+
const storeCountry = await iap.getStorefront();
|
|
30
|
+
return storeCountry ? { storeCountry, store } : null;
|
|
31
|
+
};
|
|
32
|
+
return answerWithin(read, STORE_COUNTRY_TIMEOUT_MS);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* What this phone's store sells the product for, or null when it does not
|
|
36
|
+
* sell it, expo-iap is missing, or the store fails: the store tab hides.
|
|
37
|
+
* The billing connection `readPhoneStore` opened is opened again if needed.
|
|
38
|
+
*/
|
|
39
|
+
export async function readStoreOffer(productId, load = installedExpoIap) {
|
|
40
|
+
try {
|
|
41
|
+
const iap = load();
|
|
42
|
+
await iap.initConnection();
|
|
43
|
+
const product = (await iap.fetchProducts({
|
|
44
|
+
skus: [productId],
|
|
45
|
+
type: StoreProductTypeEnum.IN_APP,
|
|
46
|
+
}))?.find((candidate) => candidate.id === productId &&
|
|
47
|
+
(candidate.productStatusAndroid ?? StoreProductStatusEnum.OK) ===
|
|
48
|
+
StoreProductStatusEnum.OK);
|
|
49
|
+
return product
|
|
50
|
+
? {
|
|
51
|
+
productId,
|
|
52
|
+
displayPrice: product.displayPrice,
|
|
53
|
+
}
|
|
54
|
+
: null;
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Opens the store's sheet for one attempt, its token carried by the
|
|
62
|
+
* purchase on either store. How it ends comes through `listenToStore`.
|
|
63
|
+
*/
|
|
64
|
+
export async function openStoreSheet(attempt, load = installedExpoIap) {
|
|
65
|
+
await load().requestPurchase({
|
|
66
|
+
type: StoreProductTypeEnum.IN_APP,
|
|
67
|
+
request: {
|
|
68
|
+
apple: { sku: attempt.productId, appAccountToken: attempt.token },
|
|
69
|
+
google: { skus: [attempt.productId], obfuscatedAccountId: attempt.token },
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** Hears every purchase and error of the store's sheet; answers how to stop. */
|
|
74
|
+
export function listenToStore(onPurchase, onError, load = installedExpoIap) {
|
|
75
|
+
const iap = load();
|
|
76
|
+
const purchases = iap.purchaseUpdatedListener(onPurchase);
|
|
77
|
+
const errors = iap.purchaseErrorListener(onError);
|
|
78
|
+
return () => {
|
|
79
|
+
purchases.remove();
|
|
80
|
+
errors.remove();
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** Takes a paid purchase off the store's queue, as a consumable: bought again next time. */
|
|
84
|
+
export async function finishStorePurchase(purchase, load = installedExpoIap) {
|
|
85
|
+
await load().finishTransaction({ purchase, isConsumable: true });
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The purchases the store still holds unfinished: the App Store's
|
|
89
|
+
* unfinished transactions on an iPhone, Google Play's purchases not
|
|
90
|
+
* consumed yet on Android. None without expo-iap, off a phone, or when the
|
|
91
|
+
* store fails: the next start reads them again.
|
|
92
|
+
*/
|
|
93
|
+
export async function readUnfinishedPurchases(load = installedExpoIap) {
|
|
94
|
+
const store = phoneStoreOf();
|
|
95
|
+
if (!store)
|
|
96
|
+
return [];
|
|
97
|
+
try {
|
|
98
|
+
const iap = load();
|
|
99
|
+
await iap.initConnection();
|
|
100
|
+
return store === PhoneStoreEnum.APP_STORE
|
|
101
|
+
? await iap.getPendingTransactionsIOS()
|
|
102
|
+
: await iap.getAvailablePurchases();
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,75 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brissoto/pay-react-native",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"description": "Brissoto Pay for Expo and React Native apps: the payment sheet.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"assets",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "node scripts/build.mjs",
|
|
23
|
+
"prepack": "npm run build",
|
|
24
|
+
"test": "jest",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"example": "node example/start.mjs",
|
|
27
|
+
"example:ios": "node example/start.mjs ios",
|
|
28
|
+
"example:android": "node example/start.mjs android"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"libphonenumber-js": "^1.13.15",
|
|
32
|
+
"use-intl": "^4.14.9"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"convex": "^1.48.0",
|
|
36
|
+
"expo-font": "*",
|
|
37
|
+
"expo-iap": ">=4.7.0",
|
|
38
|
+
"react": "*",
|
|
39
|
+
"react-native": "*",
|
|
40
|
+
"react-native-webview": "*",
|
|
41
|
+
"expo-web-browser": "*"
|
|
42
|
+
},
|
|
43
|
+
"peerDependenciesMeta": {
|
|
44
|
+
"expo-iap": {
|
|
45
|
+
"optional": true
|
|
46
|
+
},
|
|
47
|
+
"expo-web-browser": {
|
|
48
|
+
"optional": true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@react-native/jest-preset": "^0.88.1",
|
|
56
|
+
"@testing-library/react-native": "^14.1.0",
|
|
57
|
+
"@types/jest": "^30.0.0",
|
|
58
|
+
"@types/react": "~19.2",
|
|
59
|
+
"babel-preset-expo": "~58.0.23",
|
|
60
|
+
"convex": "^1.49.0",
|
|
61
|
+
"expo": "~58.0.22",
|
|
62
|
+
"expo-dev-client": "~58.0.18",
|
|
63
|
+
"expo-font": "~58.0.11",
|
|
64
|
+
"expo-iap": "^6.4.3",
|
|
65
|
+
"expo-status-bar": "~58.0.4",
|
|
66
|
+
"expo-web-browser": "~58.0.7",
|
|
67
|
+
"jest": "^30.5.2",
|
|
68
|
+
"jest-expo": "~58.0.13",
|
|
69
|
+
"react": "19.3.0",
|
|
70
|
+
"react-native": "0.88.1",
|
|
71
|
+
"react-native-webview": "14.0.1",
|
|
72
|
+
"test-renderer": "^1.3.1",
|
|
73
|
+
"typescript": "^6.0.3"
|
|
74
|
+
}
|
|
75
|
+
}
|