@fat-zebra/sdk 1.4.11 → 1.4.13

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.
@@ -1,2 +1,3 @@
1
1
  import VerifyCard from "./VerifyCard";
2
- export { VerifyCard };
2
+ import submitForm from "./submitForm";
3
+ export { VerifyCard, submitForm };
@@ -1,2 +1,3 @@
1
1
  import VerifyCard from "./VerifyCard";
2
- export { VerifyCard };
2
+ import submitForm from "./submitForm";
3
+ export { VerifyCard, submitForm };
@@ -0,0 +1,2 @@
1
+ declare const submitForm: (e: React.MouseEvent<HTMLElement>) => void;
2
+ export default submitForm;
@@ -0,0 +1,10 @@
1
+ import { BridgeEvent } from "../shared/types";
2
+ const submitForm = (e) => {
3
+ const message = {
4
+ channel: 'sca',
5
+ subject: BridgeEvent.TRIGGER_PAYNOW_BUTTON,
6
+ data: {}
7
+ };
8
+ document.querySelector("iframe[title=verification-form]").contentWindow.postMessage(message, "*");
9
+ };
10
+ export default submitForm;
package/dist/react/url.js CHANGED
@@ -8,6 +8,7 @@ const generatePaymentURL = (values, environment) => {
8
8
  "iframe",
9
9
  "postmessage",
10
10
  "hide_card_holder",
11
+ "hide_button",
11
12
  "return_path",
12
13
  "card_types",
13
14
  "surcharge_enabled",
@@ -15,6 +16,7 @@ const generatePaymentURL = (values, environment) => {
15
16
  ];
16
17
  const environmentConfig = env[environment || Environment.sandbox];
17
18
  const urlTemplate = parseTemplate(`${environmentConfig.payNowUrl}/sdk/v3/{merchant}/{reference}/{currency}/{amount}/{verification}{?${queryParts.join(",")}}`);
19
+ console.log(values);
18
20
  const url = urlTemplate.expand({
19
21
  merchant: values.merchant,
20
22
  reference: values.reference,
@@ -27,6 +29,8 @@ const generatePaymentURL = (values, environment) => {
27
29
  iframe: true,
28
30
  postmessage: true,
29
31
  tokenize_only: values.tokenize_only,
32
+ hide_card_holder: values.hide_card_holder,
33
+ hide_button: values.hide_button,
30
34
  });
31
35
  return url;
32
36
  };
package/dist/sca/index.js CHANGED
@@ -28,9 +28,6 @@ class Sca {
28
28
  script.id = "songbird-script";
29
29
  script.src = this.environmentConfig.songbirdUrl;
30
30
  script.async = true;
31
- script.onload = () => {
32
- this._cardinal = new CardinalManager();
33
- };
34
31
  document.body.appendChild(script);
35
32
  }
36
33
  }
@@ -62,6 +59,7 @@ class Sca {
62
59
  }
63
60
  run(config) {
64
61
  return __awaiter(this, void 0, void 0, function* () {
62
+ this._cardinal = new CardinalManager();
65
63
  // Persist states until next 3DS run.
66
64
  this.paymentIntent = config.paymentIntent;
67
65
  this.bin = config.bin;
@@ -97,7 +97,7 @@ export type PaymentConfig = {
97
97
  options: OptionalUrlValues;
98
98
  };
99
99
  export type OptionalUrlValues = {
100
- hide_card_holder?: string;
100
+ hide_card_holder?: boolean;
101
101
  return_path?: string;
102
102
  card_types?: Array<string>;
103
103
  surcharge_enabled?: string;
@@ -105,6 +105,7 @@ export type OptionalUrlValues = {
105
105
  css?: string;
106
106
  css_signature?: string;
107
107
  tokenize_only?: boolean;
108
+ hide_button?: boolean;
108
109
  };
109
110
  declare global {
110
111
  interface Window {
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@fat-zebra/sdk",
3
- "version": "1.4.11",
4
-
3
+ "version": "1.4.13",
5
4
  "description": "",
6
5
  "main": "index.js",
7
6
  "scripts": {