upn-library-v2 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.
Files changed (2) hide show
  1. package/README.md +53 -4
  2. package/package.json +5 -1
package/README.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # upn-library
2
2
 
3
3
  A simple JS library for creating UPN QR codes using the https://www.npmjs.com/package/qrcode package
4
+ ## Table of Contents
5
+ 1. [Installation](#installation)
6
+ 2. [Usage](#usage)
7
+ 3. [Example using VueJs](#example-using-vuejs)
4
8
 
5
- # installation:
9
+ ## Installation
6
10
 
7
11
  Inside your project folder:
8
12
 
@@ -10,9 +14,54 @@ Inside your project folder:
10
14
  npm i upn-library-v2
11
15
  ```
12
16
 
13
- # usage
17
+ ## Usage
14
18
 
15
- Example using VueJs
19
+ Import the function from the package:
20
+ ```JS
21
+ import { generateUPNQR } from "upn-library-v2";
22
+ ```
23
+
24
+ Call it using:
25
+ ```JS
26
+ await generateUPNQR(options, size)
27
+ ```
28
+
29
+ Function params:
30
+ - **options**: `Object` – contains the data of the UPN QR code. Fields:
31
+ ```JS
32
+
33
+ {
34
+ price: Number, // *required* - amount to be paid
35
+ title_code: String, // *required* - example COST
36
+ title: String, // *required* - title of the payment "Payment for x"
37
+ due_date: Date, // *required* - payment due date
38
+ reference: String, // *required* - payment reference
39
+ payment_date: Date, // optional - actual payment date
40
+
41
+ payer: { // *required* - payer information
42
+ name: String, // *required*
43
+ surname: String, // *required*
44
+ address: String, // *required*
45
+ zip: String, // *required*
46
+ city: String, // *required*
47
+ iban: String // optional
48
+ },
49
+
50
+ payee: { // *required* - payee information
51
+ iban: String, // *required*
52
+ title: String, // *required*
53
+ address: String, // *required*
54
+ zip: String, // *required*
55
+ city: String // *required*
56
+ }
57
+ }
58
+ ```
59
+
60
+
61
+ - **size**: `Number` – the size of the QR code (passed down to qrcode package), optional, default is 300
62
+
63
+
64
+ ## Example using VueJs
16
65
 
17
66
  ```html
18
67
  <script>
@@ -21,7 +70,7 @@ import { generateUPNQR } from "upn-library-v2";
21
70
  export default {
22
71
  name: "QrCodePage",
23
72
  async mounted() {
24
- this.$refs.qrCodeImg = await generateUPNQR({
73
+ this.$refs.qrCodeImg.src = await generateUPNQR({
25
74
  price: 10,
26
75
  title_code: 'COST',
27
76
  title: 'Payment for x',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "upn-library-v2",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "main": "src/index.js",
5
5
  "keywords": [
6
6
  "UPN",
@@ -16,5 +16,9 @@
16
16
  },
17
17
  "devDependencies": {
18
18
  "vite": "^8.0.3"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/tomazcede/Upn-library-for-js"
19
23
  }
20
24
  }