@payvision/checkout-library
Advanced tools
Comparing version 0.2.0 to 1.0.0
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Checkout",[],t):"object"==typeof exports?exports.Checkout=t():e.Checkout=t()}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){"use strict";r.r(t);var n={width:"100%",height:"780px",frameBorder:"0"};function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){var t,r,n,o,u,a=this,c=e.target.contentWindow,f=(t=this.url,(r=t.split("/"))[0]+"//"+r[2]);n=window,o="message",u=function(e){if(e.origin===f){var t=e.data||{ready:!1,error:!1,height:0},r=t.ready,n=t.error,i=t.redirect,o=t.height;r&&a.show(),n&&function(e){document.dispatchEvent(new CustomEvent("checkout-error",{detail:{error:e}}))}(n),i&&function(e){if(window.location.href===e)return window.location.reload();window.location.assign(e)}(i),o&&function(e,t){e.style.height=t}(a.iframe,o)}},n.addEventListener?n.addEventListener(o,u,!1):n.attachEvent&&n.attachEvent("on"+o,u);var s=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){i(e,t,r[t])})}return e}({styles:this.styles},this.options);c.postMessage(s,f)}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){a(e,t,r[t])})}return e}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=n.styles,o=void 0===i?{}:i,a=c(n,["styles"]);this.checkoutId=t,this.elementId=r,this.options=u({live:!1},a),this.styles=o}var t,r,i;return t=e,(r=[{key:"render",value:function(){var e=this.options.live,t=void 0!==e&&e,r=this.styles.iframe,i=void 0===r?{}:r;return this.url=function(e){return e?"https://checkout-web.prod.payvision.app/CHECKOUT_ID":"https://stag.checkout-web.dta.payvision.app/CHECKOUT_ID"}(t),this.iframe=function(e){var t=document.createElement("iframe");return t.width=e.width,t.height=e.height,t.frameBorder=e.frameBorder,t.style.visibility="hidden",t.style.transition="all 0.2s ease-out",t.name="Checkout",t}(u({},n,i)),function(e,t,r){var n=r.url;if(!t)throw new ReferenceError("There is no checkout id");e.src="".concat(n.replace(/CHECKOUT_ID/,t))}(this.iframe,this.checkoutId,{url:this.url}),function(e,t){var r=document.getElementById(t);if(!r)throw new ReferenceError("The element specified is not present in DOM");var n=r.querySelector("iframe");n?r.replaceChild(e,n):r.appendChild(e)}(this.iframe,this.elementId),this.iframe.onload=o.bind(this),this}},{key:"show",value:function(){if(!this.iframe)throw new ReferenceError("The component is not initialiased. Use render method.");return this.iframe.style.visibility="visible",this}},{key:"hide",value:function(){if(!this.iframe)throw new ReferenceError("The component is not initialiased. Use render method.");return this.iframe.style.visibility="hidden",this}}])&&f(t.prototype,r),i&&f(t,i),e}();t.default=s}]).default}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Checkout",[],t):"object"==typeof exports?exports.Checkout=t():e.Checkout=t()}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){"use strict";r.r(t);var n={width:"100%",height:"780px",frameBorder:"0"};function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){var t,r,n,o,c,u=this,a=e.target.contentWindow,s=(t=this.url,(r=t.split("/"))[0]+"//"+r[2]);n=window,o="message",c=function(e){if(e.origin===s){var t=e.data||{ready:!1,error:!1,height:0},r=t.ready,n=t.error,i=t.redirect,o=t.height;r&&u.show(),n&&function(e){document.dispatchEvent(new CustomEvent("checkout-error",{detail:{error:e}}))}(n),i&&function(e){if(window.location.href===e)return window.location.reload();window.location.assign(e)}(i),o&&function(e,t){e.style.height=t}(u.iframe,o)}},n.addEventListener?n.addEventListener(o,c,!1):n.attachEvent&&n.attachEvent("on"+o,c);var f=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){i(e,t,r[t])})}return e}({styles:this.styles},this.options);a.postMessage(f,s)}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){u(e,t,r[t])})}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var f=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=n.styles,o=void 0===i?{}:i,u=a(n,["styles"]);this.checkoutId=t,this.elementId=r,this.options=c({live:!1},u),this.styles=o}var t,r,i;return t=e,(r=[{key:"render",value:function(){var e=this.options.live,t=void 0!==e&&e,r=this.styles.iframe,i=void 0===r?{}:r;return this.url=function(e){return e?"https://connect.acehubpaymentservices.com/gateway/v3/web/checkouts/CHECKOUT_ID":"https://stagconnect.acehubpaymentservices.com/gateway/v3/web/checkouts/CHECKOUT_ID"}(t),this.iframe=function(e){var t=document.createElement("iframe");return t.width=e.width,t.height=e.height,t.frameBorder=e.frameBorder,t.style.visibility="hidden",t.style.transition="all 0.2s ease-out",t.name="Checkout",t}(c({},n,i)),function(e,t,r){var n=r.url;if(!t)throw new ReferenceError("There is no checkout id");e.src="".concat(n.replace(/CHECKOUT_ID/,t))}(this.iframe,this.checkoutId,{url:this.url}),function(e,t){var r=document.getElementById(t);if(!r)throw new ReferenceError("The element specified is not present in DOM");var n=r.querySelector("iframe");n?r.replaceChild(e,n):r.appendChild(e)}(this.iframe,this.elementId),this.iframe.onload=o.bind(this),this}},{key:"show",value:function(){if(!this.iframe)throw new ReferenceError("The component is not initialiased. Use render method.");return this.iframe.style.visibility="visible",this}},{key:"hide",value:function(){if(!this.iframe)throw new ReferenceError("The component is not initialiased. Use render method.");return this.iframe.style.visibility="hidden",this}}])&&s(t.prototype,r),i&&s(t,i),e}();t.default=f}]).default}); |
{ | ||
"name": "@payvision/checkout-library", | ||
"version": "0.2.0", | ||
"version": "1.0.0", | ||
"description": "Payvision Checkout javascript customization library.", | ||
@@ -10,4 +10,3 @@ "main": "dist/checkout-library.js", | ||
"dev": "webpack-dev-server --open --mode=development --config webpack.dev.js", | ||
"build": "webpack --config webpack.dev.js", | ||
"build:prod": "webpack --config webpack.prod.js" | ||
"build": "webpack --config webpack.prod.js" | ||
}, | ||
@@ -14,0 +13,0 @@ "author": "Payvision", |
@@ -114,6 +114,6 @@ # Checkout.js | ||
| Environment | Url | | ||
| ----------- | ------------------------------------------- | | ||
| Live | https://checkout-web.prod.payvision.app | | ||
| Staging | https://stag.checkout-web.dta.payvision.app | | ||
| Environment | Url | | ||
| ----------- | ---------------------------------------------------------------------- | | ||
| Live | https://connect.acehubpaymentservices.com/gateway/v3/web/checkouts | | ||
| Staging | https://stagconnect.acehubpaymentservices.com/gateway/v3/web/checkouts | | ||
@@ -120,0 +120,0 @@ ## Helper methods |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
1
41535
10