-
Notifications
You must be signed in to change notification settings - Fork 3
/
donate.js
30 lines (24 loc) · 1.06 KB
/
donate.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
/*
// Original Paypal code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="2TW2GK2S5UBAJ" />
<input type="image" src="https://www.paypalobjects.com/en_US/DK/i/btn/btn_donateCC_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />
<img alt="" border="0" src="https://www.paypal.com/en_DE/i/scr/pixel.gif" width="1" height="1" />
</form>
*/
const form = document.createElement('form')
form.method = 'post'
form.action = 'https://www.paypal.com/cgi-bin/webscr'
let cmd = document.createElement('input')
cmd.type = 'hidden'
cmd.name = 'cmd'
cmd.value = '_s-xclick'
form.appendChild ( cmd )
let hosted_button_id = document.createElement('input')
hosted_button_id.type = 'hidden'
hosted_button_id.name = 'hosted_button_id'
hosted_button_id.value = '2TW2GK2S5UBAJ'
form.appendChild ( hosted_button_id )
document.body.appendChild ( form )
form.submit()