@rebilly/instruments 8.16.0 → 8.17.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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [8.17.1](https://github.com/Rebilly/rebilly/compare/instruments/core-v8.17.0...instruments/core-v8.17.1) (2024-01-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **frontend:** Upgrade to axios 1.6.3 dependancy ([#2747](https://github.com/Rebilly/rebilly/issues/2747)) ([780b91a](https://github.com/Rebilly/rebilly/commit/780b91abc803de88dfe8d9a4b09db11c1d76db73))
7
+
8
+ ## [8.17.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v8.16.0...instruments/core-v8.17.0) (2024-01-02)
9
+
10
+
11
+ ### Features
12
+
13
+ * **instruments:** use new framepay asset name and global in instruments code ([#2626](https://github.com/Rebilly/rebilly/issues/2626)) ([4ea0331](https://github.com/Rebilly/rebilly/commit/4ea0331a515424b025bc0ddc3fc9404d11826297))
14
+
1
15
  ## [8.16.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v8.15.0...instruments/core-v8.16.0) (2023-12-27)
2
16
 
3
17
 
package/dist/index.js CHANGED
@@ -1634,7 +1634,6 @@ const state = (() => {
1634
1634
  const defaultState = {
1635
1635
  options: null,
1636
1636
  data: {},
1637
- mountingPoints: null,
1638
1637
  mainStyleVars: null,
1639
1638
  storefront: null,
1640
1639
  form: null,
@@ -4774,7 +4773,7 @@ function isAbsoluteURL(url) {
4774
4773
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
4775
4774
  }
4776
4775
  function combineURLs(baseURL, relativeURL) {
4777
- return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
4776
+ return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
4778
4777
  }
4779
4778
  function buildFullPath(baseURL, requestedURL) {
4780
4779
  if (baseURL && !isAbsoluteURL(requestedURL)) {
@@ -5198,7 +5197,7 @@ function mergeConfig(config1, config2) {
5198
5197
  });
5199
5198
  return config;
5200
5199
  }
5201
- const VERSION = "1.6.2";
5200
+ const VERSION = "1.6.3";
5202
5201
  const validators$1 = {};
5203
5202
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((type2, i2) => {
5204
5203
  validators$1[type2] = function validator2(thing) {
@@ -14660,7 +14659,7 @@ async function fetchData({
14660
14659
  return new DataInstance({});
14661
14660
  }
14662
14661
  function mountExpressMethod({ state: state2, id: id2 }) {
14663
- const { Rebilly } = window;
14662
+ const { Framepay } = window;
14664
14663
  const container = state2.form.querySelector(
14665
14664
  `.rebilly-instruments-${id2}-method`
14666
14665
  );
@@ -14678,7 +14677,7 @@ function mountExpressMethod({ state: state2, id: id2 }) {
14678
14677
  }
14679
14678
  function mountButton() {
14680
14679
  if (!container.children.length) {
14681
- const rebillyMountFunction = {
14680
+ const mountFunction = {
14682
14681
  "google-pay": "googlePay",
14683
14682
  "pay-pal-billing-agreement": "paypal",
14684
14683
  "apple-pay": "applePay"
@@ -14686,8 +14685,8 @@ function mountExpressMethod({ state: state2, id: id2 }) {
14686
14685
  const element = state2.form.querySelector(
14687
14686
  `.rebilly-instruments-${id2}-method`
14688
14687
  );
14689
- if (rebillyMountFunction[id2]) {
14690
- Rebilly[rebillyMountFunction[id2]].mount(element);
14688
+ if (mountFunction[id2]) {
14689
+ Framepay[mountFunction[id2]].mount(element);
14691
14690
  if (id2 === "apple-pay") {
14692
14691
  updateApplePayStyling();
14693
14692
  }
@@ -14696,10 +14695,10 @@ function mountExpressMethod({ state: state2, id: id2 }) {
14696
14695
  }
14697
14696
  }
14698
14697
  }
14699
- Rebilly == null ? void 0 : Rebilly.on("ready", () => {
14698
+ Framepay == null ? void 0 : Framepay.on("ready", () => {
14700
14699
  mountButton();
14701
14700
  });
14702
- Rebilly == null ? void 0 : Rebilly.on("error", (error2) => {
14701
+ Framepay == null ? void 0 : Framepay.on("error", (error2) => {
14703
14702
  console.error(error2);
14704
14703
  });
14705
14704
  }
@@ -14760,9 +14759,9 @@ async function mountExpressMethods({ methods, container }) {
14760
14759
  const { METHOD_ID } = getMethodData(expressMethod);
14761
14760
  return METHOD_ID;
14762
14761
  });
14763
- const { Rebilly } = window;
14764
- if (!(Rebilly == null ? void 0 : Rebilly.initialized)) {
14765
- await (Rebilly == null ? void 0 : Rebilly.initialize(
14762
+ const { Framepay } = window;
14763
+ if (!(Framepay == null ? void 0 : Framepay.initialized)) {
14764
+ await (Framepay == null ? void 0 : Framepay.initialize(
14766
14765
  generateFramepayConfig({
14767
14766
  methodIds
14768
14767
  })
@@ -14800,7 +14799,7 @@ async function mountExpressMethods({ methods, container }) {
14800
14799
  });
14801
14800
  });
14802
14801
  const redirectUrl = state.options.apiMode === "sandbox" ? "https://forms-sandbox.secure-payments.app/approval-url?close=true" : "https://forms.secure-payments.app/approval-url?close=true";
14803
- Rebilly == null ? void 0 : Rebilly.on("token-ready", (token) => {
14802
+ Framepay == null ? void 0 : Framepay.on("token-ready", (token) => {
14804
14803
  var _a, _b, _c;
14805
14804
  const instrumentReadyPayload = {
14806
14805
  websiteId: state.options.websiteId,
@@ -23296,7 +23295,7 @@ function handleComputedProperty(options) {
23296
23295
  var _a;
23297
23296
  return Object.assign({}, options, {
23298
23297
  _computed: {
23299
- version: "8.15.0",
23298
+ version: "8.17.0",
23300
23299
  paymentMethodsUrl: ((_a = options._dev) == null ? void 0 : _a.paymentMethodsUrl) ?? "https://forms.secure-payments.app"
23301
23300
  }
23302
23301
  });
@@ -23382,8 +23381,8 @@ const setupOptions = ({
23382
23381
  async function setupFramepay() {
23383
23382
  const { _dev } = state.options || {};
23384
23383
  const urls = {
23385
- script: (_dev == null ? void 0 : _dev.framePayScriptLink) || "https://framepay.rebilly.com/rebilly.js",
23386
- style: (_dev == null ? void 0 : _dev.framePayStyleLink) || "https://framepay.rebilly.com/rebilly.css"
23384
+ script: (_dev == null ? void 0 : _dev.framePayScriptLink) || "https://framepay.rebilly.com/framepay.js",
23385
+ style: (_dev == null ? void 0 : _dev.framePayStyleLink) || "https://framepay.rebilly.com/framepay.css"
23387
23386
  };
23388
23387
  return new Promise((resolve2) => {
23389
23388
  const framepayStyle = document.createElement("link");
@@ -26297,14 +26296,10 @@ async function show({ componentName, payload }) {
26297
26296
  throw new Error(`'${componentName}' not a supported component`);
26298
26297
  }
26299
26298
  }
26300
- function showResult({
26301
- state: state2,
26302
- payload
26303
- }) {
26299
+ function showResult({ payload }) {
26304
26300
  show({
26305
26301
  componentName: "result",
26306
- payload,
26307
- state: state2
26302
+ payload
26308
26303
  });
26309
26304
  }
26310
26305
  const setupUserFlow = ({ state: state2 = {} }) => {
@@ -26329,8 +26324,7 @@ const setupUserFlow = ({ state: state2 = {} }) => {
26329
26324
  }
26330
26325
  show({
26331
26326
  componentName: "confirmation",
26332
- payload,
26333
- state: state2
26327
+ payload
26334
26328
  });
26335
26329
  }
26336
26330
  });
@@ -26340,21 +26334,21 @@ const setupUserFlow = ({ state: state2 = {} }) => {
26340
26334
  eventName: "payout-completed",
26341
26335
  callback: (payload) => {
26342
26336
  payload = JSON.parse(JSON.stringify(payload));
26343
- showResult({ state: state2, payload });
26337
+ showResult({ payload });
26344
26338
  }
26345
26339
  });
26346
26340
  on({
26347
26341
  eventName: "purchase-completed",
26348
26342
  callback: (payload) => {
26349
26343
  payload = JSON.parse(JSON.stringify(payload));
26350
- showResult({ state: state2, payload });
26344
+ showResult({ payload });
26351
26345
  }
26352
26346
  });
26353
26347
  on({
26354
26348
  eventName: "setup-completed",
26355
26349
  callback: (payload) => {
26356
26350
  payload = JSON.parse(JSON.stringify(payload));
26357
- showResult({ state: state2, payload });
26351
+ showResult({ payload });
26358
26352
  }
26359
26353
  });
26360
26354
  }
@@ -26500,7 +26494,7 @@ class RebillyInstrumentsInstance {
26500
26494
  await show({ componentName, payload });
26501
26495
  }
26502
26496
  get version() {
26503
- return `RebillyInstruments Ver.${"8.15.0"}`;
26497
+ return `RebillyInstruments Ver.${"8.17.0"}`;
26504
26498
  }
26505
26499
  on(eventName, callback) {
26506
26500
  on({ eventName, callback });