@heyama/pay-react-native 0.0.0-stage → 1.0.1
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 +99 -2
- 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/apple-pay.png +0 -0
- package/assets/logos/card.png +0 -0
- package/assets/logos/google-pay.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/orange.png +0 -0
- package/assets/logos/paypal.png +0 -0
- package/assets/logos/visa.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 +319 -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 +253 -0
- package/dist/checkout-core/messages/en.js +243 -0
- package/dist/checkout-core/messages/fr.d.ts +4 -0
- package/dist/checkout-core/messages/fr.js +245 -0
- package/dist/checkout-core/models/checkout.card.utils.d.ts +22 -0
- package/dist/checkout-core/models/checkout.card.utils.js +101 -0
- package/dist/checkout-core/models/checkout.constants.d.ts +56 -0
- package/dist/checkout-core/models/checkout.constants.js +142 -0
- package/dist/checkout-core/models/checkout.enum.d.ts +133 -0
- package/dist/checkout-core/models/checkout.enum.js +150 -0
- package/dist/checkout-core/models/checkout.interface.d.ts +417 -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 +34 -0
- package/dist/checkout-core/models/checkout.view.utils.js +205 -0
- package/dist/checkout-core/models/domain.enum.d.ts +56 -0
- package/dist/checkout-core/models/domain.enum.js +62 -0
- package/dist/components/BrissotoPayProvider.d.ts +6 -0
- package/dist/components/BrissotoPayProvider.js +41 -0
- package/dist/components/PaymentSheetModal.d.ts +8 -0
- package/dist/components/PaymentSheetModal.js +77 -0
- package/dist/components/SheetBone.d.ts +3 -0
- package/dist/components/SheetBone.js +12 -0
- package/dist/components/SheetButton.d.ts +3 -0
- package/dist/components/SheetButton.js +33 -0
- package/dist/components/SheetCardFields.d.ts +8 -0
- package/dist/components/SheetCardFields.js +66 -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 +97 -0
- package/dist/components/SheetContent.d.ts +3 -0
- package/dist/components/SheetContent.js +106 -0
- package/dist/components/SheetFailed.d.ts +3 -0
- package/dist/components/SheetFailed.js +43 -0
- package/dist/components/SheetForm.d.ts +8 -0
- package/dist/components/SheetForm.js +101 -0
- package/dist/components/SheetHeader.d.ts +6 -0
- package/dist/components/SheetHeader.js +69 -0
- package/dist/components/SheetIcon.d.ts +3 -0
- package/dist/components/SheetIcon.js +70 -0
- package/dist/components/SheetLayout.d.ts +9 -0
- package/dist/components/SheetLayout.js +48 -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 +32 -0
- package/dist/components/SheetPhoneField.d.ts +3 -0
- package/dist/components/SheetPhoneField.js +58 -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 +39 -0
- package/dist/components/SheetSkeleton.d.ts +5 -0
- package/dist/components/SheetSkeleton.js +23 -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 +25 -0
- package/dist/components/SheetToast.d.ts +3 -0
- package/dist/components/SheetToast.js +24 -0
- package/dist/components/SheetWaiting.d.ts +7 -0
- package/dist/components/SheetWaiting.js +77 -0
- package/dist/hooks/use-native-platform.d.ts +10 -0
- package/dist/hooks/use-native-platform.js +47 -0
- package/dist/hooks/use-payment-sheet.d.ts +4 -0
- package/dist/hooks/use-payment-sheet.js +10 -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-theme.d.ts +4 -0
- package/dist/hooks/use-sheet-theme.js +12 -0
- package/dist/hooks/use-watched-payment.d.ts +6 -0
- package/dist/hooks/use-watched-payment.js +17 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/models/sheet.constants.d.ts +39 -0
- package/dist/models/sheet.constants.js +78 -0
- package/dist/models/sheet.enum.d.ts +16 -0
- package/dist/models/sheet.enum.js +18 -0
- package/dist/models/sheet.interface.d.ts +232 -0
- package/dist/models/sheet.interface.js +1 -0
- package/dist/models/sheet.utils.d.ts +43 -0
- package/dist/models/sheet.utils.js +132 -0
- package/dist/services/checkout.service.d.ts +7 -0
- package/dist/services/checkout.service.js +39 -0
- package/package.json +58 -4
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { makeFunctionReference } from 'convex/server';
|
|
2
|
+
import { CHECKOUT_FUNCTIONS } from "../models/sheet.constants.js";
|
|
3
|
+
/**
|
|
4
|
+
* The checkout's calls over the Convex client: the same public functions the
|
|
5
|
+
* web checkout calls, by path, so the package needs none of the backend's code.
|
|
6
|
+
*/
|
|
7
|
+
export function convexCheckoutCalls(client) {
|
|
8
|
+
const mutation = (path) => (args) => client.mutation(makeFunctionReference(path), args);
|
|
9
|
+
const action = (path) => (args) => client.action(makeFunctionReference(path), args);
|
|
10
|
+
const mutations = {
|
|
11
|
+
pay: mutation(CHECKOUT_FUNCTIONS.pay),
|
|
12
|
+
payWithCode: action(CHECKOUT_FUNCTIONS.payWithCode),
|
|
13
|
+
checkNow: mutation(CHECKOUT_FUNCTIONS.checkNow),
|
|
14
|
+
open: mutation(CHECKOUT_FUNCTIONS.open),
|
|
15
|
+
cancel: mutation(CHECKOUT_FUNCTIONS.cancel),
|
|
16
|
+
resend: mutation(CHECKOUT_FUNCTIONS.resend),
|
|
17
|
+
simulate: mutation(CHECKOUT_FUNCTIONS.simulate),
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
watch: (paymentId, onView, onError) => {
|
|
21
|
+
const watch = client.watchQuery(makeFunctionReference(CHECKOUT_FUNCTIONS.get), { paymentId });
|
|
22
|
+
const read = () => {
|
|
23
|
+
let view;
|
|
24
|
+
try {
|
|
25
|
+
view = watch.localQueryResult();
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
onError();
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (view !== undefined)
|
|
32
|
+
onView(view);
|
|
33
|
+
};
|
|
34
|
+
read();
|
|
35
|
+
return watch.onUpdate(read);
|
|
36
|
+
},
|
|
37
|
+
mutations,
|
|
38
|
+
};
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heyama/pay-react-native",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.1",
|
|
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
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"libphonenumber-js": "^1.13.15",
|
|
30
|
+
"use-intl": "^4.14.9"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"convex": "^1.48.0",
|
|
34
|
+
"expo-font": "*",
|
|
35
|
+
"react": "*",
|
|
36
|
+
"react-native": "*",
|
|
37
|
+
"react-native-webview": "*"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@react-native/jest-preset": "^0.88.1",
|
|
44
|
+
"@testing-library/react-native": "^14.1.0",
|
|
45
|
+
"@types/jest": "^30.0.0",
|
|
46
|
+
"@types/react": "~19.2",
|
|
47
|
+
"babel-preset-expo": "~58.0.23",
|
|
48
|
+
"convex": "^1.49.0",
|
|
49
|
+
"expo": "~58.0.22",
|
|
50
|
+
"expo-font": "~58.0.11",
|
|
51
|
+
"expo-status-bar": "~58.0.4",
|
|
52
|
+
"jest": "^30.5.2",
|
|
53
|
+
"jest-expo": "~58.0.13",
|
|
54
|
+
"react": "19.3.0",
|
|
55
|
+
"react-native": "0.88.1",
|
|
56
|
+
"react-native-webview": "14.0.1",
|
|
57
|
+
"test-renderer": "^1.3.1",
|
|
58
|
+
"typescript": "^6.0.3"
|
|
59
|
+
}
|
|
60
|
+
}
|