frames-react-native 1.2.2 → 1.2.3
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/.github/workflows/cd.yml +36 -36
- package/README.md +36 -2
- package/__tests__/Integration.test.tsx +55 -2
- package/__tests__/Unit.test.tsx +1 -1
- package/dist/Frames.d.ts +2 -2
- package/dist/Frames.js +6 -3
- package/dist/Frames.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/types/types.d.ts +5 -1
- package/package.json +1 -1
package/.github/workflows/cd.yml
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
name: Test and Deploy
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
10
|
|
|
11
11
|
jobs:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
verbose: true
|
|
12
|
+
test-and-coverage:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-node@v4
|
|
17
|
+
with:
|
|
18
|
+
node-version: 21
|
|
19
|
+
- run: npm ci
|
|
20
|
+
- run: npm test
|
|
21
|
+
- name: Upload coverage to Codecov
|
|
22
|
+
uses: codecov/codecov-action@v1
|
|
23
|
+
with:
|
|
24
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
25
|
+
verbose: true
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
27
|
+
publish-npm:
|
|
28
|
+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
|
29
|
+
needs: test-and-coverage
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
steps:
|
|
32
|
+
- uses: actions/checkout@v4
|
|
33
|
+
- uses: actions/setup-node@v4
|
|
34
|
+
with:
|
|
35
|
+
node-version: 21
|
|
36
|
+
registry-url: https://registry.npmjs.org/
|
|
37
|
+
- run: npm ci
|
|
38
|
+
- run: npm run build
|
|
39
|
+
- run: cp -R src/icons dist/
|
|
40
|
+
- run: npm publish
|
|
41
|
+
env:
|
|
42
|
+
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
|
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ export default function App() {
|
|
|
57
57
|
<Frames
|
|
58
58
|
config={{
|
|
59
59
|
debug: true,
|
|
60
|
-
publicKey: "
|
|
60
|
+
publicKey: "pk_sbox_eo3yb3urja2ozf6ycgn5kuy7ke#",
|
|
61
61
|
}}
|
|
62
62
|
cardTokenized={(e) => {
|
|
63
63
|
alert(e.token);
|
|
@@ -144,7 +144,41 @@ const styles = StyleSheet.create({
|
|
|
144
144
|
|
|
145
145
|
## Trigger tokenization
|
|
146
146
|
|
|
147
|
-
The tokenization is triggered when the SubmitButton is pressed
|
|
147
|
+
The tokenization is triggered when the `SubmitButton` is pressed, or programmatically via a ref on `Frames`.
|
|
148
|
+
|
|
149
|
+
### Programmatic submit via ref
|
|
150
|
+
|
|
151
|
+
You can attach a ref to `Frames` and call `submitCard()` imperatively:
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
import React, { useRef } from "react";
|
|
155
|
+
import { Frames, CardNumber, ExpiryDate, Cvv } from "frames-react-native";
|
|
156
|
+
import type { FramesRef } from "frames-react-native";
|
|
157
|
+
|
|
158
|
+
export const Example = () => {
|
|
159
|
+
const framesRef = useRef<FramesRef>(null);
|
|
160
|
+
|
|
161
|
+
const onCustomPress = () => {
|
|
162
|
+
framesRef.current?.submitCard();
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
return (
|
|
166
|
+
<Frames
|
|
167
|
+
ref={framesRef}
|
|
168
|
+
config={{ debug: true, publicKey: "pk_test_..." }}
|
|
169
|
+
cardTokenized={(e) => console.log(e.token)}
|
|
170
|
+
>
|
|
171
|
+
<CardNumber />
|
|
172
|
+
<ExpiryDate />
|
|
173
|
+
<Cvv />
|
|
174
|
+
{/* Use your own button UI */}
|
|
175
|
+
<MyCustomButton onPress={onCustomPress} />
|
|
176
|
+
</Frames>
|
|
177
|
+
);
|
|
178
|
+
};
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
The process of getting the token is async, so the outcome of the tokenization will be shared in the `cardTokenized` or `cardTokenizationFailed` handlers.
|
|
148
182
|
|
|
149
183
|
## The `props` for the Frames wrapper component
|
|
150
184
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { createRef } from "react";
|
|
2
2
|
import { render, fireEvent, waitFor } from "@testing-library/react-native";
|
|
3
3
|
|
|
4
4
|
import {
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
Cvv,
|
|
9
9
|
SubmitButton,
|
|
10
10
|
} from "../src/index";
|
|
11
|
+
import type { FramesRef } from "../src/index";
|
|
11
12
|
|
|
12
13
|
// Mock network-dependent modules to avoid real HTTP requests
|
|
13
14
|
jest.mock("../src/utils/http", () => {
|
|
@@ -32,7 +33,7 @@ describe("Frames integration", () => {
|
|
|
32
33
|
const validCvv = "123";
|
|
33
34
|
|
|
34
35
|
const config = {
|
|
35
|
-
publicKey: "
|
|
36
|
+
publicKey: "pk_sbox_eo3yb3urja2ozf6ycgn5kuy7ke#",
|
|
36
37
|
debug: true,
|
|
37
38
|
cardholder: {
|
|
38
39
|
name: "John Doe",
|
|
@@ -47,6 +48,10 @@ describe("Frames integration", () => {
|
|
|
47
48
|
},
|
|
48
49
|
};
|
|
49
50
|
|
|
51
|
+
beforeEach(() => {
|
|
52
|
+
jest.clearAllMocks();
|
|
53
|
+
});
|
|
54
|
+
|
|
50
55
|
it("emits validation and bin events, and tokenizes on submit", async () => {
|
|
51
56
|
const { tokenize } = require("../src/utils/http");
|
|
52
57
|
|
|
@@ -134,4 +139,52 @@ describe("Frames integration", () => {
|
|
|
134
139
|
expect(cardTokenized).toHaveBeenCalledWith(mockTokenResponse);
|
|
135
140
|
expect(cardTokenizationFailed).not.toHaveBeenCalled();
|
|
136
141
|
});
|
|
142
|
+
|
|
143
|
+
it("allows submitting via Frames ref submitCard()", async () => {
|
|
144
|
+
const { tokenize } = require("../src/utils/http");
|
|
145
|
+
|
|
146
|
+
const mockTokenResponse = {
|
|
147
|
+
type: "card",
|
|
148
|
+
token: "tok_test_ref_123",
|
|
149
|
+
expires_on: "2030-12-31T23:59:59Z",
|
|
150
|
+
expiry_month: "12",
|
|
151
|
+
expiry_year: "2030",
|
|
152
|
+
scheme: "Visa",
|
|
153
|
+
last4: "4242",
|
|
154
|
+
bin: "424242",
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
tokenize.mockResolvedValueOnce(mockTokenResponse);
|
|
158
|
+
|
|
159
|
+
const cardTokenized = jest.fn();
|
|
160
|
+
|
|
161
|
+
const ref = createRef<FramesRef>();
|
|
162
|
+
|
|
163
|
+
const screen = render(
|
|
164
|
+
<Frames config={config} cardTokenized={cardTokenized} ref={ref}>
|
|
165
|
+
<CardNumber />
|
|
166
|
+
<ExpiryDate />
|
|
167
|
+
<Cvv />
|
|
168
|
+
</Frames>
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
const cardNumberInput = screen.getByPlaceholderText("•••• •••• •••• ••••");
|
|
172
|
+
const expiryInput = screen.getByPlaceholderText("MM/YY");
|
|
173
|
+
const cvvInput = screen.getByPlaceholderText("•••");
|
|
174
|
+
|
|
175
|
+
// Fill valid data
|
|
176
|
+
fireEvent.changeText(cardNumberInput, validVisa);
|
|
177
|
+
fireEvent.changeText(expiryInput, validExpiry);
|
|
178
|
+
fireEvent.changeText(cvvInput, validCvv);
|
|
179
|
+
|
|
180
|
+
// Call submit via ref
|
|
181
|
+
await waitFor(async () => {
|
|
182
|
+
expect(ref.current).not.toBeNull();
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
await ref.current!.submitCard();
|
|
186
|
+
|
|
187
|
+
await waitFor(() => expect(tokenize).toHaveBeenCalledTimes(1));
|
|
188
|
+
expect(cardTokenized).toHaveBeenCalledWith(mockTokenResponse);
|
|
189
|
+
});
|
|
137
190
|
});
|
package/__tests__/Unit.test.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { getFormattedDate } from "../src/utils/date";
|
|
|
3
3
|
import { getEnvironment } from "../src/utils/http";
|
|
4
4
|
import { getEnvironment as loggerGetEnvironment } from "../src/utils/logger";
|
|
5
5
|
|
|
6
|
-
const PK_SB = "
|
|
6
|
+
const PK_SB = "pk_sbox_eo3yb3urja2ozf6ycgn5kuy7ke#";
|
|
7
7
|
const PK_PROD = "pk_4296fd52-efba-4a38-b6ce-cf0d93639d8a"; // fake key
|
|
8
8
|
|
|
9
9
|
describe("Date", () => {
|
package/dist/Frames.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { FramesContextType, FramesProps } from "./types/types";
|
|
2
|
+
import { FramesContextType, FramesProps, FramesRef } from "./types/types";
|
|
3
3
|
export declare const FramesContext: React.Context<FramesContextType>;
|
|
4
|
-
declare const Frames:
|
|
4
|
+
declare const Frames: React.ForwardRefExoticComponent<FramesProps & React.RefAttributes<FramesRef>>;
|
|
5
5
|
export default Frames;
|
|
6
6
|
export declare const FramesConsumer: React.Consumer<FramesContextType>;
|
|
7
7
|
export declare const FramesProvider: React.Provider<FramesContextType>;
|
package/dist/Frames.js
CHANGED
|
@@ -34,13 +34,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
34
34
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
import React, { useEffect } from "react";
|
|
37
|
+
import React, { useEffect, useImperativeHandle } from "react";
|
|
38
38
|
import { View, StyleSheet } from "react-native";
|
|
39
39
|
import { framesReducer } from "./utils/reducer";
|
|
40
40
|
import { log } from "./utils/logger";
|
|
41
41
|
import { tokenize, formatDataForTokenization } from "./utils/http";
|
|
42
42
|
export var FramesContext = React.createContext({});
|
|
43
|
-
var Frames = function (props) {
|
|
43
|
+
var Frames = React.forwardRef(function (props, ref) {
|
|
44
44
|
var initialState = {
|
|
45
45
|
cardNumber: null,
|
|
46
46
|
cardBin: {
|
|
@@ -88,6 +88,9 @@ var Frames = function (props) {
|
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
}); };
|
|
91
|
+
useImperativeHandle(ref, function () { return ({
|
|
92
|
+
submitCard: submitCard,
|
|
93
|
+
}); }, [submitCard]);
|
|
91
94
|
useEffect(function () {
|
|
92
95
|
if (state.cardBin.bin !== null) {
|
|
93
96
|
if (props.config.debug)
|
|
@@ -170,7 +173,7 @@ var Frames = function (props) {
|
|
|
170
173
|
{props.children}
|
|
171
174
|
</FramesContext.Provider>
|
|
172
175
|
</View>);
|
|
173
|
-
};
|
|
176
|
+
});
|
|
174
177
|
export default Frames;
|
|
175
178
|
export var FramesConsumer = FramesContext.Consumer;
|
|
176
179
|
export var FramesProvider = FramesContext.Provider;
|
package/dist/Frames.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Frames.js","sourceRoot":"","sources":["../src/Frames.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,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C,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACxE,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IAE5B,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAC3C;MAAA,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,OAAA,EAAE,QAAQ,UAAA,EAAE,UAAU,YAAA,EAAE,CAAC,CAC7D;QAAA,CAAC,KAAK,CAAC,QAAQ,CACjB;MAAA,EAAE,aAAa,CAAC,QAAQ,CAC1B;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC;AAEtB,MAAM,CAAC,IAAM,cAAc,GAAG,aAAa,CAAC,QAAQ,CAAC;AACrD,MAAM,CAAC,IAAM,cAAc,GAAG,aAAa,CAAC,QAAQ,CAAC;AAErD,IAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,KAAK,EAAE,MAAM;KACd;CACF,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export { default as ExpiryDate } from "./components/ExpiryDate";
|
|
|
4
4
|
export { default as Cvv } from "./components/Cvv";
|
|
5
5
|
export { default as SubmitButton } from "./components/SubmitButton";
|
|
6
6
|
export { default as FramesConsumer } from "./Frames";
|
|
7
|
+
export type { FramesRef } from "./types/types";
|
package/dist/types/types.d.ts
CHANGED
|
@@ -88,8 +88,11 @@ interface ValidationChange {
|
|
|
88
88
|
export type FramesContextType = {
|
|
89
89
|
state: FramesState;
|
|
90
90
|
dispatch: FramesDispatch;
|
|
91
|
-
submitCard: () => void
|
|
91
|
+
submitCard: () => Promise<void>;
|
|
92
92
|
};
|
|
93
|
+
export interface FramesRef {
|
|
94
|
+
submitCard: () => Promise<void>;
|
|
95
|
+
}
|
|
93
96
|
export interface TokenizationParams {
|
|
94
97
|
key: string;
|
|
95
98
|
body: TokenizationBody;
|
|
@@ -128,6 +131,7 @@ export interface FrameCardTokenizedEvent {
|
|
|
128
131
|
expiry_month: string;
|
|
129
132
|
expiry_year: string;
|
|
130
133
|
scheme?: Scheme;
|
|
134
|
+
scheme_local?: string;
|
|
131
135
|
last4: string;
|
|
132
136
|
bin: string;
|
|
133
137
|
card_type?: CardType;
|