Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make formId param optional in several method declarations #349

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/ember/app/components/render-elements.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class='container'>
<h1>Ember Example</h1>
<div id='myPaymentForm'>
<div class='kr-smart-form'></div>
<div class='kr-smart-form' kr-card-form-expanded=""></div>
</div>
<p data-test='payment-message'>{{this.message}}</p>
</div>
Expand Down
9 changes: 5 additions & 4 deletions examples/react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/react/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function MyComponent() {
<h1>React Example</h1>
<div className="container">
<div id="myPaymentForm">
<div className="kr-smart-form" kr-card-form-expanded></div>
<div className="kr-smart-form" kr-card-form-expanded=""></div>
</div>
<div data-test="payment-message">{message}</div>
</div>
Expand Down
72 changes: 0 additions & 72 deletions examples_build/ember/assets/chunk.143.29274073097fba1d3348.js

This file was deleted.

This file was deleted.

33 changes: 33 additions & 0 deletions examples_build/ember/assets/chunk.143.e19d6cd9ac95e6b52f06.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
var __ember_auto_import__;(()=>{var e={332:(e,t,o)=>{"use strict"
Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0
var r,n=(r=o(323))&&r.__esModule?r:{default:r}
var i=new(function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),e.instance?e.instance:(e.instance=this,this._name="Krypton Glue",this.configuration={},this.domain=null,this.formToken=null,this.publicKey=null,this.loaded=!1,this.loading=!1,this)}var t,o
return t=e,o=[{key:"loadLibrary",value:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null
if(this.loaded)return this.getKrypton(t)
if(!e)return Promise.reject("Domain not defined")
if(!t)return Promise.reject("Public key not defined")
try{var r=new URL(e)
if(!["http:","https:"].includes(r.protocol))throw new Error("Invalid protocol")
if(r.port)throw new Error("No port allowed")
if(""!==r.search)throw new Error("No query params allowed")
if("/"!==r.pathname)throw new Error("Invalid path")}catch(t){return console.error("Domain format should be https://domain.name"),Promise.reject("[".concat(e,"] is not a valid endpoint domain"))}return/^\d{2,8}:(|test)publickey_.+$/g.test(t)?(this.domain=e,this.publicKey=t,this.formToken=o,this.domain&&this.publicKey?this.loadKryptonClient():Promise.reject("The library cannot be loaded")):(console.error("Public key format should be shopId:[test]publickey_*"),Promise.reject("[".concat(t,"] is not a valid public key")))}},{key:"loadKryptonClient",value:function(){var e=this
if(!this.loading){var t=this.publicKey,o=this.domain
this.loading=!0
var r=document.createElement("script")
r.type="text/javascript",/^.+\/$/.test(o)||(o+="/"),r.src="".concat(o,"static/js/krypton-client/V4.0/stable/kr-payment-form.min.js"),r.setAttribute("kr-public-key",t),r.setAttribute("kr-spa-mode","true"),this.formToken&&r.setAttribute("kr-form-token",this.formToken),!document.querySelector('script[src="'.concat(r.src,'"]'))&&document.body?document.body.appendChild(r):document.body||console.warn("document.body is undefined")}return new Promise((function(t){(0,n.default)(window,"KR",(function(){(0,n.default)(window.KR,"ready",(function(){e.loaded=!0,e.loading=!1,t({KR:window.KR})}))}))}))}},{key:"getKrypton",value:function(e){var t=this
return new Promise((function(o,r){e&&e!==t.publicKey?window.KR.setFormConfig({publicKey:e}).then(o).catch(r):o({KR:window.KR})}))}}],o&&function(e,t){for(var o=0;o<t.length;o++){var r=t[o]
r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,o),Object.defineProperty(t,"prototype",{writable:!1}),e}())
t.default=i},44:(e,t,o)=>{"use strict"
var r
Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0
var n=((r=o(332))&&r.__esModule?r:{default:r}).default
t.default=n},323:(e,t)=>{"use strict"
Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(e,t,o){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:150
setTimeout((function n(){e[t]?o():setTimeout(n,r)}),0)}},507:(e,t,o)=>{var r,n
e.exports=(r=_eai_d,n=_eai_r,window.emberAutoImportDynamic=function(e){return 1===arguments.length?n("_eai_dyn_"+e):n("_eai_dynt_"+e)(Array.prototype.slice.call(arguments,1))},window.emberAutoImportSync=function(e){return n("_eai_sync_"+e)(Array.prototype.slice.call(arguments,1))},r("__v1-addons__early-boot-set__",[],(function(){})),void r("@lyracom/embedded-form-glue",["__v1-addons__early-boot-set__"],(function(){return o(44)})))},609:function(e,t){window._eai_r=require,window._eai_d=define}},t={}
function o(r){var n=t[r]
if(void 0!==n)return n.exports
var i=t[r]={exports:{}}
return e[r].call(i.exports,i,i.exports,o),i.exports}o(609)
var r=o(507)
__ember_auto_import__=r})()
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var __ember_auto_import__;(()=>{var r,e={248:function(r,e){window._eai_r=require,window._eai_d=define},430:(r,e,o)=>{var t,n
var __ember_auto_import__;(()=>{var r,e={609:function(r,e){window._eai_r=require,window._eai_d=define},582:(r,e,o)=>{var t,n
r.exports=(t=_eai_d,n=_eai_r,window.emberAutoImportDynamic=function(r){return 1===arguments.length?n("_eai_dyn_"+r):n("_eai_dynt_"+r)(Array.prototype.slice.call(arguments,1))},window.emberAutoImportSync=function(r){return n("_eai_sync_"+r)(Array.prototype.slice.call(arguments,1))},t("__v1-addons__early-boot-set__",[],(function(){})),void t("qunit",["__v1-addons__early-boot-set__"],(function(){return o(916)})))}},o={}
function t(r){var n=o[r]
if(void 0!==n)return n.exports
Expand All @@ -15,6 +15,6 @@ var e=(e,o)=>{var n,_,[i,a,l]=o,d=0
if(i.some((e=>0!==r[e]))){for(n in a)t.o(a,n)&&(t.m[n]=a[n])
if(l)var u=l(t)}for(e&&e(o);d<i.length;d++)_=i[d],t.o(r,_)&&r[_]&&r[_][0](),r[_]=0
return t.O(u)},o=globalThis.webpackChunk_ember_auto_import_=globalThis.webpackChunk_ember_auto_import_||[]
o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})(),t.O(void 0,[916],(()=>t(248)))
var n=t.O(void 0,[916],(()=>t(430)))
o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})(),t.O(void 0,[916],(()=>t(609)))
var n=t.O(void 0,[916],(()=>t(582)))
n=t.O(n),__ember_auto_import__=n})()

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading