@gr4vy/secure-fields-react 1.2.0 → 1.4.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/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ # v1.4.0 (Wed Apr 12 2023)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - fix: return useful information on card vault failure [#248](https://github.com/gr4vy/secure-fields/pull/248) ([@theturboboy](https://github.com/theturboboy))
6
+
7
+ #### Authors: 1
8
+
9
+ - Andrei Haidukevich ([@theturboboy](https://github.com/theturboboy))
10
+
11
+ ---
12
+
13
+ # v1.3.0 (Thu Feb 16 2023)
14
+
15
+ #### 🏠 Internal
16
+
17
+ - build(deps-dev): bump typescript-transform-paths from 3.4.4 to 3.4.6 [#181](https://github.com/gr4vy/secure-fields/pull/181) ([@dependabot[bot]](https://github.com/dependabot[bot]))
18
+
19
+ #### Authors: 1
20
+
21
+ - [@dependabot[bot]](https://github.com/dependabot[bot])
22
+
23
+ ---
24
+
1
25
  # v1.1.0 (Fri Jan 20 2023)
2
26
 
3
27
  #### 🏠 Internal
package/README.md CHANGED
@@ -32,7 +32,7 @@ const { SecureFields } = require(`@gr4vy/secure-fields-react`)
32
32
  font="Lato"
33
33
  onReady={(data) => console.log('Secure Fields loaded', data)}
34
34
  onCardVaultSuccess={() => console.log('Card tokenization successful')}
35
- onCardVaultFailure={() => console.error('Card tokenization failed')}
35
+ onCardVaultFailure={(data) => console.error('Card tokenization failed', data)}
36
36
  >
37
37
  <Form />
38
38
  </SecureFields>
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Config } from "../../types";
3
- export declare type Props = {
3
+ export type Props = {
4
4
  children?: ReactNode;
5
5
  } & Config;
6
6
  export declare const SecureFields: ({ children, ...config }: Props) => JSX.Element;
package/lib/types.d.ts CHANGED
@@ -1,15 +1,20 @@
1
1
  import { Config as BaseConfig, Field as BaseField } from '@gr4vy/secure-fields';
2
2
  import { MutableRefObject } from 'react';
3
- export declare type Config = BaseConfig & {
3
+ export type CardVaultFailureData = {
4
+ status: number;
5
+ code: string;
6
+ message: string;
7
+ };
8
+ export type Config = BaseConfig & {
4
9
  debug?: boolean;
5
10
  font?: string;
6
11
  onReady?: (config: {
7
12
  version: string;
8
13
  } & BaseConfig) => void;
9
14
  onCardVaultSuccess?: () => void;
10
- onCardVaultFailure?: () => void;
15
+ onCardVaultFailure?: (data: CardVaultFailureData) => void;
11
16
  };
12
- export declare type Field = BaseField & {
17
+ export type Field = BaseField & {
13
18
  ref?: MutableRefObject<HTMLElement>;
14
19
  onBlur?: (data: any) => void;
15
20
  onFocus?: (data: any) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gr4vy/secure-fields-react",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "Gr4vy-hosted secure fields offering advanced theming, PCI compliance, event handling, and more.",
5
5
  "main": "lib/index",
6
6
  "types": "lib/index",
@@ -39,17 +39,17 @@
39
39
  "react-dom": ">=17.0.0"
40
40
  },
41
41
  "dependencies": {
42
- "@gr4vy/secure-fields": "^1.2.0"
42
+ "@gr4vy/secure-fields": "^1.4.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@testing-library/react-hooks": "^8.0.1",
46
46
  "react": "^17.0.2",
47
47
  "react-dom": "^17.0.2",
48
48
  "ts-patch": "^2.1.0",
49
- "typescript-transform-paths": "^3.4.4"
49
+ "typescript-transform-paths": "^3.4.6"
50
50
  },
51
51
  "publishConfig": {
52
52
  "access": "public"
53
53
  },
54
- "gitHead": "f932a5fb2d92483a800a5b85af1e7aa2f60ed617"
54
+ "gitHead": "11c5e0e78470d22572e9b09cb112af33b3c3b44e"
55
55
  }