-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathApp.vue
67 lines (63 loc) · 1.43 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
<template>
<div class="App">
<p class="App-intro">
<paystack
:amount="amount"
:email="email"
:paystackkey="paystackkey"
:reference="reference"
: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_a137d402b5975716e89952a898aad2832c961d69",
email: "[email protected]",
amount: 1000000
}
},
computed: {
reference(){
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>