framepayments-react-native 2.2.1 → 3.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/FrameReactNative.podspec +44 -0
- package/Package.swift +47 -0
- package/README.md +64 -33
- package/android/build.gradle +9 -3
- package/android/src/main/java/com/framepayments/reactnativeframe/FrameCheckoutActivity.kt +18 -3
- package/android/src/main/java/com/framepayments/reactnativeframe/FrameFlowActivity.kt +16 -3
- package/android/src/main/java/com/framepayments/reactnativeframe/FrameGooglePayActivity.kt +0 -3
- package/android/src/main/java/com/framepayments/reactnativeframe/FrameOnboardingActivity.kt +2 -5
- package/android/src/main/java/com/framepayments/reactnativeframe/FrameSDKModule.kt +13 -11
- package/ios/ApplePayPresenter.swift +1 -4
- package/ios/FramePreloader.h +23 -0
- package/ios/FrameSDKBridge.m +17 -17
- package/ios/FrameSDKBridge.swift +109 -54
- package/lib/native.d.ts +12 -2
- package/lib/native.d.ts.map +1 -1
- package/lib/native.js +18 -18
- package/lib/types.d.ts +12 -6
- package/lib/types.d.ts.map +1 -1
- package/package.json +8 -2
- package/src/__tests__/native.test.ts +60 -74
- package/src/native.ts +37 -34
- package/src/types.ts +12 -6
- package/ios/FrameReactNative.podspec +0 -32
- package/lib/__tests__/native.test.d.ts +0 -32
- package/lib/__tests__/native.test.d.ts.map +0 -1
- package/lib/__tests__/native.test.js +0 -101
- package/lib/components/FrameApplePayButton.d.ts +0 -30
- package/lib/components/FrameApplePayButton.d.ts.map +0 -1
- package/lib/components/FrameApplePayButton.js +0 -42
- package/lib/components/FrameGooglePayButton.d.ts +0 -28
- package/lib/components/FrameGooglePayButton.d.ts.map +0 -1
- package/lib/components/FrameGooglePayButton.js +0 -24
- package/lib/components/index.d.ts +0 -5
- package/lib/components/index.d.ts.map +0 -1
- package/lib/components/index.js +0 -2
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* <FrameApplePayButton /> — iOS-only React Native view that wraps Frame iOS SDK's
|
|
3
|
-
* native FrameApplePayButton (PassKit + automatic device attestation).
|
|
4
|
-
*
|
|
5
|
-
* On non-iOS platforms this component renders nothing, so consumers can place it
|
|
6
|
-
* unconditionally in their JSX.
|
|
7
|
-
*/
|
|
8
|
-
import * as React from 'react';
|
|
9
|
-
import { Platform, StyleSheet, requireNativeComponent, } from 'react-native';
|
|
10
|
-
const NativeFrameApplePayButton = Platform.OS === 'ios'
|
|
11
|
-
? requireNativeComponent('FrameApplePayButtonView')
|
|
12
|
-
: null;
|
|
13
|
-
let warnedAboutOwner = false;
|
|
14
|
-
function warnIfBadOwner(owner) {
|
|
15
|
-
if (!owner ||
|
|
16
|
-
(owner.type !== 'customer' && owner.type !== 'account') ||
|
|
17
|
-
typeof owner.id !== 'string' ||
|
|
18
|
-
owner.id.length === 0) {
|
|
19
|
-
if (!warnedAboutOwner) {
|
|
20
|
-
warnedAboutOwner = true;
|
|
21
|
-
// eslint-disable-next-line no-console
|
|
22
|
-
console.warn('[FrameApplePayButton] `owner` must be { type: "customer" | "account", id: string }. The button will not render until a valid owner is provided.');
|
|
23
|
-
}
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
export const FrameApplePayButton = (props) => {
|
|
29
|
-
if (Platform.OS !== 'ios' || NativeFrameApplePayButton === null) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
if (!warnIfBadOwner(props.owner)) {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
const { style, ...rest } = props;
|
|
36
|
-
return (<NativeFrameApplePayButton {...rest} style={[styles.button, style]}/>);
|
|
37
|
-
};
|
|
38
|
-
const styles = StyleSheet.create({
|
|
39
|
-
button: {
|
|
40
|
-
height: 50,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* <FrameGooglePayButton /> — Android-only React Native view that wraps Frame Android SDK's
|
|
3
|
-
* native FrameGooglePayButton (Google Pay PaymentsClient + readiness check).
|
|
4
|
-
*
|
|
5
|
-
* On non-Android platforms this component renders nothing, so consumers can place it
|
|
6
|
-
* unconditionally in their JSX.
|
|
7
|
-
*/
|
|
8
|
-
import * as React from 'react';
|
|
9
|
-
import { type NativeSyntheticEvent, type ViewProps } from 'react-native';
|
|
10
|
-
import type { FrameGooglePayResultEvent } from '../types';
|
|
11
|
-
export interface FrameGooglePayButtonProps extends ViewProps {
|
|
12
|
-
/** Payment amount in cents. */
|
|
13
|
-
amountCents: number;
|
|
14
|
-
/** Optional Frame customer ID to associate the resulting payment method with. */
|
|
15
|
-
customerId?: string;
|
|
16
|
-
/** ISO 4217 currency code. Defaults to 'USD'. */
|
|
17
|
-
currencyCode?: string;
|
|
18
|
-
/** Optional override for the Google Pay merchant ID. */
|
|
19
|
-
googlePayMerchantId?: string;
|
|
20
|
-
/** Fired when payment completes, fails, or the user cancels the Google Pay sheet. */
|
|
21
|
-
onResult: (event: NativeSyntheticEvent<FrameGooglePayResultEvent>) => void;
|
|
22
|
-
/** Fired when Google Pay readiness changes (button shows/hides itself accordingly). */
|
|
23
|
-
onReadinessChanged?: (event: NativeSyntheticEvent<{
|
|
24
|
-
isReady: boolean;
|
|
25
|
-
}>) => void;
|
|
26
|
-
}
|
|
27
|
-
export declare const FrameGooglePayButton: React.FC<FrameGooglePayButtonProps>;
|
|
28
|
-
//# sourceMappingURL=FrameGooglePayButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FrameGooglePayButton.d.ts","sourceRoot":"","sources":["../../src/components/FrameGooglePayButton.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAE1D,MAAM,WAAW,yBAA0B,SAAQ,SAAS;IAC1D,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qFAAqF;IACrF,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,yBAAyB,CAAC,KAAK,IAAI,CAAC;IAC3E,uFAAuF;IACvF,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,KAAK,IAAI,CAAC;CAClF;AAOD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAWpE,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* <FrameGooglePayButton /> — Android-only React Native view that wraps Frame Android SDK's
|
|
3
|
-
* native FrameGooglePayButton (Google Pay PaymentsClient + readiness check).
|
|
4
|
-
*
|
|
5
|
-
* On non-Android platforms this component renders nothing, so consumers can place it
|
|
6
|
-
* unconditionally in their JSX.
|
|
7
|
-
*/
|
|
8
|
-
import * as React from 'react';
|
|
9
|
-
import { Platform, StyleSheet, requireNativeComponent, } from 'react-native';
|
|
10
|
-
const NativeFrameGooglePayButton = Platform.OS === 'android'
|
|
11
|
-
? requireNativeComponent('FrameGooglePayButtonView')
|
|
12
|
-
: null;
|
|
13
|
-
export const FrameGooglePayButton = (props) => {
|
|
14
|
-
if (Platform.OS !== 'android' || NativeFrameGooglePayButton === null) {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
const { style, ...rest } = props;
|
|
18
|
-
return (<NativeFrameGooglePayButton {...rest} style={[styles.button, style]}/>);
|
|
19
|
-
};
|
|
20
|
-
const styles = StyleSheet.create({
|
|
21
|
-
button: {
|
|
22
|
-
height: 48,
|
|
23
|
-
},
|
|
24
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { FrameApplePayButton } from './FrameApplePayButton';
|
|
2
|
-
export type { FrameApplePayButtonProps } from './FrameApplePayButton';
|
|
3
|
-
export { FrameGooglePayButton } from './FrameGooglePayButton';
|
|
4
|
-
export type { FrameGooglePayButtonProps } from './FrameGooglePayButton';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/lib/components/index.js
DELETED