@riskdefy/chargebacks 1.0.0 → 1.0.2
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.js +1 -0
- package/package.json +1 -1
- package/src/components/Chargebacks.vue +40 -11
- package/vite.config.js +1 -1
- package/dist/chargebacks.css +0 -1
- package/dist/chargebacks.es.js +0 -24
- package/dist/chargebacks.umd.js +0 -1
package/dist/index.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
(function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.Chargebacks={},r.Vue))})(this,function(r,e){"use strict";const d=(t,n)=>{const o=t.__vccOpts||t;for(const[a,s]of n)o[a]=s;return o},p={props:{apiKey:{type:String,required:!0},merchantId:{type:String,required:!0}},data(){return{data:null}},methods:{async fetchChargebacks(){try{const t={merchantId:this.merchantId},n=new URLSearchParams(t).toString(),a=await(await fetch(`https://api.riskdefy.io/chargebacks?${n}`,{method:"GET",headers:{Authorization:`Bearer ${this.apiKey}`,"Content-Type":"application/json"}})).json();this.data=a}catch(t){console.error("API Error:",t)}}}},h={key:0};function l(t,n,o,a,s,i){return e.openBlock(),e.createElementBlock("div",null,[n[1]||(n[1]=e.createElementVNode("h2",null,"Chargebacks Report",-1)),e.createElementVNode("button",{onClick:n[0]||(n[0]=(...f)=>i.fetchChargebacks&&i.fetchChargebacks(...f))},"Load Report"),s.data?(e.openBlock(),e.createElementBlock("pre",h,e.toDisplayString(s.data),1)):e.createCommentVNode("",!0)])}const c=d(p,[["render",l]]),u={install(t){t.component("Chargebacks",c)}};r.Chargebacks=c,r.default=u,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
@@ -1,18 +1,47 @@
|
|
1
1
|
<template>
|
2
|
-
<div
|
3
|
-
<h2>Chargebacks
|
4
|
-
<
|
2
|
+
<div>
|
3
|
+
<h2>Chargebacks Report</h2>
|
4
|
+
<button @click="fetchChargebacks">Load Report</button>
|
5
|
+
<pre v-if="data">{{ data }}</pre>
|
5
6
|
</div>
|
6
7
|
</template>
|
8
|
+
|
7
9
|
<script>
|
8
10
|
export default {
|
9
|
-
|
11
|
+
props: {
|
12
|
+
apiKey: {
|
13
|
+
type: String,
|
14
|
+
required: true,
|
15
|
+
},
|
16
|
+
merchantId: {
|
17
|
+
type: String,
|
18
|
+
required: true,
|
19
|
+
},
|
20
|
+
},
|
21
|
+
data() {
|
22
|
+
return { data: null };
|
23
|
+
},
|
24
|
+
methods: {
|
25
|
+
async fetchChargebacks() {
|
26
|
+
try {
|
27
|
+
const params = { merchantId: this.merchantId };
|
28
|
+
const paramsString = new URLSearchParams(params).toString();
|
29
|
+
const response = await fetch(
|
30
|
+
`https://api.riskdefy.io/chargebacks?${paramsString}`,
|
31
|
+
{
|
32
|
+
method: "GET",
|
33
|
+
headers: {
|
34
|
+
Authorization: `Bearer ${this.apiKey}`,
|
35
|
+
"Content-Type": "application/json",
|
36
|
+
},
|
37
|
+
}
|
38
|
+
);
|
39
|
+
const data = await response.json();
|
40
|
+
this.data = data;
|
41
|
+
} catch (error) {
|
42
|
+
console.error("API Error:", error);
|
43
|
+
}
|
44
|
+
},
|
45
|
+
},
|
10
46
|
};
|
11
47
|
</script>
|
12
|
-
<style scoped>
|
13
|
-
.chargebacks {
|
14
|
-
border: 1px solid #ddd;
|
15
|
-
padding: 10px;
|
16
|
-
border-radius: 5px;
|
17
|
-
}
|
18
|
-
</style>
|
package/vite.config.js
CHANGED
package/dist/chargebacks.css
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
.chargebacks[data-v-dc14aa5f]{border:1px solid #ddd;padding:10px;border-radius:5px}
|
package/dist/chargebacks.es.js
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
import { createElementBlock as s, openBlock as r, createElementVNode as o } from "vue";
|
2
|
-
const l = (e, t) => {
|
3
|
-
const a = e.__vccOpts || e;
|
4
|
-
for (const [n, c] of t)
|
5
|
-
a[n] = c;
|
6
|
-
return a;
|
7
|
-
}, p = {
|
8
|
-
name: "Chargebacks"
|
9
|
-
}, d = { class: "chargebacks" };
|
10
|
-
function _(e, t, a, n, c, k) {
|
11
|
-
return r(), s("div", d, t[0] || (t[0] = [
|
12
|
-
o("h2", null, "Chargebacks Component", -1),
|
13
|
-
o("p", null, "Displaying chargeback data...", -1)
|
14
|
-
]));
|
15
|
-
}
|
16
|
-
const i = /* @__PURE__ */ l(p, [["render", _], ["__scopeId", "data-v-dc14aa5f"]]), g = {
|
17
|
-
install(e) {
|
18
|
-
e.component("Chargebacks", i);
|
19
|
-
}
|
20
|
-
};
|
21
|
-
export {
|
22
|
-
i as Chargebacks,
|
23
|
-
g as default
|
24
|
-
};
|
package/dist/chargebacks.umd.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.Chargebacks={},e.Vue))})(this,function(e,t){"use strict";const d=(n,o)=>{const a=n.__vccOpts||n;for(const[c,r]of o)a[c]=r;return a},i={name:"Chargebacks"},l={class:"chargebacks"};function u(n,o,a,c,r,p){return t.openBlock(),t.createElementBlock("div",l,o[0]||(o[0]=[t.createElementVNode("h2",null,"Chargebacks Component",-1),t.createElementVNode("p",null,"Displaying chargeback data...",-1)]))}const s=d(i,[["render",u],["__scopeId","data-v-dc14aa5f"]]),f={install(n){n.component("Chargebacks",s)}};e.Chargebacks=s,e.default=f,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|