integration-plugin 1.0.1 → 1.0.3
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/dist/index.cjs +18 -38
- package/dist/index.js +18 -38
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,41 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
<div style="
|
|
3
|
-
position:fixed;
|
|
4
|
-
top:0;
|
|
5
|
-
left:0;
|
|
6
|
-
width:100%;
|
|
7
|
-
height:100%;
|
|
8
|
-
background:#00000080;
|
|
9
|
-
display:flex;
|
|
10
|
-
align-items:center;
|
|
11
|
-
justify-content:center;
|
|
12
|
-
z-index:9999;
|
|
13
|
-
">
|
|
1
|
+
var E=Object.create;var c=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var x=(e,t)=>{for(var n in t)c(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of S(t))!b.call(e,a)&&a!==n&&c(e,a,{get:()=>t[a],enumerable:!(r=I(t,a))||r.enumerable});return e};var A=(e,t,n)=>(n=e!=null?E(h(e)):{},l(t||!e||!e.__esModule?c(n,"default",{value:e,enumerable:!0}):n,e)),R=e=>l(c({},"__esModule",{value:!0}),e);var v={};x(v,{createMeeting:()=>f,createPayment:()=>P,initPlugin:()=>w});module.exports=R(v);var y=A(require("axios"),1),u="",g="",w=e=>{u=e.apiUrl,g=e.apiKey},d=()=>y.default.create({baseURL:u,headers:{"Content-Type":"application/json","X-API-KEY":g}});var P=async e=>{let r=(await d().post("/payments",e)).data;if(r.gatewayType==="RAZORPAY")return await C(r);if(r.gatewayType==="STRIPE")return await _(r)},T=e=>new Promise(t=>{let n=document.createElement("script");n.src=e,n.onload=()=>t(!0),n.onerror=()=>t(!1),document.body.appendChild(n)}),C=async e=>new Promise((t,n)=>{let r={key:e.keyId,amount:e.amount,currency:e.currency,order_id:e.paymentId,handler:function(i){let o={gateway:"RAZORPAY",status:"SUCCESS",paymentId:i.razorpay_payment_id,orderId:i.razorpay_order_id,signature:i.razorpay_signature};t(o)},modal:{ondismiss:function(){n({gateway:"RAZORPAY",status:"CANCELLED"})}}};new window.Razorpay(r).open()}),_=async e=>new Promise(async(t,n)=>{if(!await T("https://js.stripe.com/v3/")){n({gateway:"STRIPE",status:"FAILED",message:"Stripe SDK failed to load"});return}let a=window.Stripe(e.publishableKey),o=a.elements().create("card"),p=document.createElement("div");p.id="stripe-container",p.innerHTML=`
|
|
14
2
|
<div style="
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
width:
|
|
3
|
+
position:fixed;
|
|
4
|
+
top:0;
|
|
5
|
+
left:0;
|
|
6
|
+
width:100%;
|
|
7
|
+
height:100%;
|
|
8
|
+
background:#00000080;
|
|
9
|
+
display:flex;
|
|
10
|
+
justify-content:center;
|
|
11
|
+
align-items:center;
|
|
12
|
+
z-index:9999;
|
|
19
13
|
">
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"></div>
|
|
27
|
-
|
|
28
|
-
<button id="stripe-pay-btn" style="
|
|
29
|
-
width:100%;
|
|
30
|
-
padding:10px;
|
|
31
|
-
background:#6772e5;
|
|
32
|
-
color:white;
|
|
33
|
-
border:none;
|
|
34
|
-
border-radius:5px;
|
|
35
|
-
cursor:pointer;
|
|
36
|
-
">
|
|
37
|
-
Pay
|
|
38
|
-
</button>
|
|
14
|
+
<div style="background:white;padding:20px;width:400px">
|
|
15
|
+
<h3>Stripe Payment</h3>
|
|
16
|
+
<div id="card-element"></div>
|
|
17
|
+
<br/>
|
|
18
|
+
<button id="stripe-pay-btn">Pay</button>
|
|
19
|
+
</div>
|
|
39
20
|
</div>
|
|
40
|
-
|
|
41
|
-
`,document.body.appendChild(n);let c=t.elements().create("card");c.mount("#stripe-card-element"),document.getElementById("stripe-pay-btn").addEventListener("click",async()=>{let i=await t.confirmCardPayment(e.clientSecret,{payment_method:{card:c}});i.error?alert(i.error.message):(console.log("Stripe payment success:",i.paymentIntent),i.paymentIntent.status==="succeeded"&&(alert("Payment successful"),document.getElementById("stripe-payment-container").remove()))})};var f=async e=>{let n=(await s().post("/meetings",{topic:e.topic,startTime:e.startTime,endTime:e.endTime,duration:e.duration})).data;return console.log("Meeting response:",n),n.joinUrl&&window.open(n.joinUrl,"_blank"),n};0&&(module.exports={createMeeting,createPayment,initPlugin});
|
|
21
|
+
`,document.body.appendChild(p),o.mount("#card-element"),document.getElementById("stripe-pay-btn").addEventListener("click",async()=>{let m=await a.confirmCardPayment(e.clientSecret,{payment_method:{card:o}});if(m.error)n({gateway:"STRIPE",status:"FAILED",message:m.error.message});else{let s=m.paymentIntent;t({gateway:"STRIPE",status:s.status,paymentId:s.id,amount:s.amount,currency:s.currency})}document.getElementById("stripe-container").remove()})});var f=async e=>{let r=(await d().post("/meetings",{topic:e.topic,startTime:e.startTime,endTime:e.endTime,duration:e.duration})).data;return console.log("Meeting response:",r),r.joinUrl&&window.open(r.joinUrl,"_blank"),r};0&&(module.exports={createMeeting,createPayment,initPlugin});
|
package/dist/index.js
CHANGED
|
@@ -1,41 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
<div style="
|
|
3
|
-
position:fixed;
|
|
4
|
-
top:0;
|
|
5
|
-
left:0;
|
|
6
|
-
width:100%;
|
|
7
|
-
height:100%;
|
|
8
|
-
background:#00000080;
|
|
9
|
-
display:flex;
|
|
10
|
-
align-items:center;
|
|
11
|
-
justify-content:center;
|
|
12
|
-
z-index:9999;
|
|
13
|
-
">
|
|
1
|
+
import y from"axios";var m="",l="",u=e=>{m=e.apiUrl,l=e.apiKey},s=()=>y.create({baseURL:m,headers:{"Content-Type":"application/json","X-API-KEY":l}});var g=async e=>{let t=(await s().post("/payments",e)).data;if(t.gatewayType==="RAZORPAY")return await P(t);if(t.gatewayType==="STRIPE")return await f(t)},w=e=>new Promise(r=>{let n=document.createElement("script");n.src=e,n.onload=()=>r(!0),n.onerror=()=>r(!1),document.body.appendChild(n)}),P=async e=>new Promise((r,n)=>{let t={key:e.keyId,amount:e.amount,currency:e.currency,order_id:e.paymentId,handler:function(a){let i={gateway:"RAZORPAY",status:"SUCCESS",paymentId:a.razorpay_payment_id,orderId:a.razorpay_order_id,signature:a.razorpay_signature};r(i)},modal:{ondismiss:function(){n({gateway:"RAZORPAY",status:"CANCELLED"})}}};new window.Razorpay(t).open()}),f=async e=>new Promise(async(r,n)=>{if(!await w("https://js.stripe.com/v3/")){n({gateway:"STRIPE",status:"FAILED",message:"Stripe SDK failed to load"});return}let c=window.Stripe(e.publishableKey),i=c.elements().create("card"),d=document.createElement("div");d.id="stripe-container",d.innerHTML=`
|
|
14
2
|
<div style="
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
width:
|
|
3
|
+
position:fixed;
|
|
4
|
+
top:0;
|
|
5
|
+
left:0;
|
|
6
|
+
width:100%;
|
|
7
|
+
height:100%;
|
|
8
|
+
background:#00000080;
|
|
9
|
+
display:flex;
|
|
10
|
+
justify-content:center;
|
|
11
|
+
align-items:center;
|
|
12
|
+
z-index:9999;
|
|
19
13
|
">
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"></div>
|
|
27
|
-
|
|
28
|
-
<button id="stripe-pay-btn" style="
|
|
29
|
-
width:100%;
|
|
30
|
-
padding:10px;
|
|
31
|
-
background:#6772e5;
|
|
32
|
-
color:white;
|
|
33
|
-
border:none;
|
|
34
|
-
border-radius:5px;
|
|
35
|
-
cursor:pointer;
|
|
36
|
-
">
|
|
37
|
-
Pay
|
|
38
|
-
</button>
|
|
14
|
+
<div style="background:white;padding:20px;width:400px">
|
|
15
|
+
<h3>Stripe Payment</h3>
|
|
16
|
+
<div id="card-element"></div>
|
|
17
|
+
<br/>
|
|
18
|
+
<button id="stripe-pay-btn">Pay</button>
|
|
19
|
+
</div>
|
|
39
20
|
</div>
|
|
40
|
-
|
|
41
|
-
`,document.body.appendChild(t);let s=n.elements().create("card");s.mount("#stripe-card-element"),document.getElementById("stripe-pay-btn").addEventListener("click",async()=>{let r=await n.confirmCardPayment(e.clientSecret,{payment_method:{card:s}});r.error?alert(r.error.message):(console.log("Stripe payment success:",r.paymentIntent),r.paymentIntent.status==="succeeded"&&(alert("Payment successful"),document.getElementById("stripe-payment-container").remove()))})};var f=async e=>{let t=(await i().post("/meetings",{topic:e.topic,startTime:e.startTime,endTime:e.endTime,duration:e.duration})).data;return console.log("Meeting response:",t),t.joinUrl&&window.open(t.joinUrl,"_blank"),t};export{f as createMeeting,y as createPayment,m as initPlugin};
|
|
21
|
+
`,document.body.appendChild(d),i.mount("#card-element"),document.getElementById("stripe-pay-btn").addEventListener("click",async()=>{let p=await c.confirmCardPayment(e.clientSecret,{payment_method:{card:i}});if(p.error)n({gateway:"STRIPE",status:"FAILED",message:p.error.message});else{let o=p.paymentIntent;r({gateway:"STRIPE",status:o.status,paymentId:o.id,amount:o.amount,currency:o.currency})}document.getElementById("stripe-container").remove()})});var E=async e=>{let t=(await s().post("/meetings",{topic:e.topic,startTime:e.startTime,endTime:e.endTime,duration:e.duration})).data;return console.log("Meeting response:",t),t.joinUrl&&window.open(t.joinUrl,"_blank"),t};export{E as createMeeting,g as createPayment,u as initPlugin};
|