@riskdefy/chargebacks 1.0.1 → 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.
@@ -1 +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 URISearchParams(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"}})});
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@riskdefy/chargebacks",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Chargebacks Vue component",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -25,7 +25,7 @@ export default {
25
25
  async fetchChargebacks() {
26
26
  try {
27
27
  const params = { merchantId: this.merchantId };
28
- const paramsString = new URISearchParams(params).toString();
28
+ const paramsString = new URLSearchParams(params).toString();
29
29
  const response = await fetch(
30
30
  `https://api.riskdefy.io/chargebacks?${paramsString}`,
31
31
  {
package/vite.config.js CHANGED
@@ -8,7 +8,7 @@ export default defineConfig({
8
8
  lib: {
9
9
  entry: path.resolve(__dirname, "src/index.js"),
10
10
  name: "Chargebacks",
11
- fileName: (format) => `chargebacks.${format}.js`,
11
+ fileName: (format) => `index.js`,
12
12
  },
13
13
  rollupOptions: {
14
14
  external: ["vue"],
@@ -1,58 +0,0 @@
1
- import { createElementBlock as s, openBlock as c, createElementVNode as i, createCommentVNode as d, toDisplayString as h } from "vue";
2
- const l = (t, e) => {
3
- const r = t.__vccOpts || t;
4
- for (const [a, n] of e)
5
- r[a] = n;
6
- return r;
7
- }, m = {
8
- props: {
9
- apiKey: {
10
- type: String,
11
- required: !0
12
- },
13
- merchantId: {
14
- type: String,
15
- required: !0
16
- }
17
- },
18
- data() {
19
- return { data: null };
20
- },
21
- methods: {
22
- async fetchChargebacks() {
23
- try {
24
- const t = { merchantId: this.merchantId }, e = new URISearchParams(t).toString(), a = await (await fetch(
25
- `https://api.riskdefy.io/chargebacks?${e}`,
26
- {
27
- method: "GET",
28
- headers: {
29
- Authorization: `Bearer ${this.apiKey}`,
30
- "Content-Type": "application/json"
31
- }
32
- }
33
- )).json();
34
- this.data = a;
35
- } catch (t) {
36
- console.error("API Error:", t);
37
- }
38
- }
39
- }
40
- }, u = { key: 0 };
41
- function g(t, e, r, a, n, o) {
42
- return c(), s("div", null, [
43
- e[1] || (e[1] = i("h2", null, "Chargebacks Report", -1)),
44
- i("button", {
45
- onClick: e[0] || (e[0] = (...p) => o.fetchChargebacks && o.fetchChargebacks(...p))
46
- }, "Load Report"),
47
- n.data ? (c(), s("pre", u, h(n.data), 1)) : d("", !0)
48
- ]);
49
- }
50
- const k = /* @__PURE__ */ l(m, [["render", g]]), y = {
51
- install(t) {
52
- t.component("Chargebacks", k);
53
- }
54
- };
55
- export {
56
- k as Chargebacks,
57
- y as default
58
- };