forked from iamraphson/vue-paystack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.vue
77 lines (73 loc) · 1.72 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<template>
<div class="App">
<p class="App-intro">
<paystack
:amount="amount"
:email="email"
:firstname="firstname"
:lastname="lastname"
:accessCode="accessCode"
:splitCode="splitCode"
:split="split"
:paystackkey="paystackkey"
:reference="genReference"
:callback="callback"
:close="close"
:embed="false"
>
<i>Pay me, My Money</i>
</paystack>
</p>
</div>
</template>
<script type="text/javascript">
import paystack from '../../src';
export default {
components: {
paystack
},
data(){
return{
paystackkey: "pk_test_xxxxxxxxxxxxxxxxxxxxxxx",
firstname: "Foo",
lastname: "Bar",
email: "[email protected]",
amount: 200000,
splitCode: "",
split: {},
channels: ['card']
}
},
computed: {
genReference(){
let text = "";
let possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for( let i=0; i < 10; i++ )
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}
},
methods: {
callback: function(response){
console.log(response)
},
close: function(){
console.log("Payment closed")
}
}
}
</script>
<style>
.App {
text-align: center;
}
.App-intro {
font-size: large;
}
.payButton{
color: #61DAFB;
width: 250px;
height: 50px;
font-weight: 800;
}
</style>