-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
53 lines (52 loc) · 1.81 KB
/
script.js
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
Vue.component('tinyurl', {
props: ['url'],
computed: {
tinyurl: function () {
return 'https://tinyurl.com/create.php?url='+
encodeURIComponent(this.url);
}
},
template: '<a v-bind:href="tinyurl" target="_blank">[Create Tiny URL]</a>'
});
var app = new Vue({
el: '#app',
data: {
business: '',
currency: 'EUR',
amount: '',
item_name: '',
each: 1,
unit: 'M'
},
computed: {
buylink: function () {
return 'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick'
+ '&business=' + encodeURIComponent(this.business)
+ '&item_name=' + encodeURIComponent(this.item_name)
+ '&amount=' + encodeURIComponent(this.amount)
+ '¤cy_code=' + encodeURIComponent(this.currency)
+ '&no_shipping=1'
+ '&no_note=1'
+ '&lc=US'
+ '&bn=PP%2dBuyNowBF'
+ '&charset=UTF%2d8';
},
sublink: function () {
return 'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions'
+ '&business=' + encodeURIComponent(this.business)
+ '&item_name=' + encodeURIComponent(this.item_name)
+ '&amount=' + encodeURIComponent(this.amount)
+ '¤cy_code=' + encodeURIComponent(this.currency)
+ '&no_shipping=1'
+ '&no_note=1'
+ '&lc=US'
+ '&bn=PP%2dSubscriptionsBF'
+ '&charset=UTF%2d8'
+ '&a3=' + encodeURIComponent(this.amount)
+ '&p3=' + encodeURIComponent(this.each)
+ '&t3=' + encodeURIComponent(this.unit)
+ '&src=1'
+ '&sra=1';
}
}
});