Skip to content

Commit 6d586ce

Browse files
committed
fix:
- make use of arrow function - validate the amount props
1 parent 7fab0bb commit 6d586ce

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

dist/paystack.umd.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/paystack.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ export default defineComponent({
4141
amount: {
4242
type: Number,
4343
required: true,
44+
validator: (value)=> {
45+
return value > 0
46+
},
4447
},
4548
reference: {
4649
type: String,
4750
required: true,
4851
},
4952
channels: {
5053
type: Array,
51-
default: function() {
54+
default:()=> {
5255
return ["card", "bank"];
5356
},
5457
},
@@ -59,18 +62,18 @@ export default defineComponent({
5962
callback: {
6063
type: Function,
6164
required: true,
62-
default: function(response) {
65+
default: (response)=> {
6366
return response;
6467
},
6568
},
6669
close: {
6770
type: Function,
6871
required: true,
69-
default: function() {},
72+
default: ()=> {},
7073
},
7174
metadata: {
7275
type: Object,
73-
default: function() {
76+
default: ()=> {
7477
return {};
7578
},
7679
},
@@ -92,7 +95,7 @@ export default defineComponent({
9295
},
9396
split: {
9497
type: Object,
95-
default: function() {
98+
default:()=> {
9699
return {};
97100
},
98101
},
@@ -112,7 +115,7 @@ export default defineComponent({
112115
113116
setup(props) {
114117
const scriptLoaded = ref(null);
115-
let loadScript = (callback) => {
118+
const loadScript = (callback) => {
116119
const script = document.createElement("script");
117120
script.src = "https://js.paystack.co/v1/inline.js";
118121

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,11 @@
530530
"resolved" "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
531531
"version" "1.0.0"
532532

533+
"fsevents@~2.3.2":
534+
"integrity" "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="
535+
"resolved" "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz"
536+
"version" "2.3.2"
537+
533538
"function-bind@^1.1.1":
534539
"integrity" "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
535540
"resolved" "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"

0 commit comments

Comments
 (0)