@riskdefy/chargebacks 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/Readme.md +29 -0
- package/dist/{chargebacks.umd.js → index.js} +1 -1
- package/package.json +1 -1
- package/src/components/Chargebacks.vue +1 -1
- package/vite.config.js +1 -1
- package/dist/chargebacks.es.js +0 -58
package/Readme.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Chargebacks
|
2
|
+
|
3
|
+
**Chargebacks** is an npm module designed to help you efficiently manage and process chargebacks.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Install the Chargebacks module using npm:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
npm install chargebacks
|
11
|
+
```
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
Here is an example of how to use the Chargebacks module in a Vue project:
|
16
|
+
|
17
|
+
```javascript
|
18
|
+
import Chargebacks from "chargebacks";
|
19
|
+
|
20
|
+
<Chargebacks apikey={your_api_key} merchantId={your_merchant_id} />;
|
21
|
+
```
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
We welcome contributions! If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
|
26
|
+
|
27
|
+
## License
|
28
|
+
|
29
|
+
This version follows the best practices for `README.md` formatting and ensures clarity. Let me know if you need any modifications! 🚀
|
@@ -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
|
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
@@ -25,7 +25,7 @@ export default {
|
|
25
25
|
async fetchChargebacks() {
|
26
26
|
try {
|
27
27
|
const params = { merchantId: this.merchantId };
|
28
|
-
const paramsString = new
|
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
package/dist/chargebacks.es.js
DELETED
@@ -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
|
-
};
|