-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdonate_script.py
More file actions
34 lines (28 loc) · 1008 Bytes
/
donate_script.py
File metadata and controls
34 lines (28 loc) · 1008 Bytes
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
import webbrowser
import urllib.parse
def open_donation_page():
"""
Opens the default web browser to the PayPal donation page for Code Broker.
"""
recipient_email = "samiratra95@gmail.com"
item_name = "Code Broker Donation"
currency_code = "USD"
# Construct the PayPal donation URL
params = {
"cmd": "_donations",
"business": recipient_email,
"item_name": item_name,
"currency_code": currency_code,
}
base_url = "https://www.paypal.com/cgi-bin/webscr"
donation_url = f"{base_url}?{urllib.parse.urlencode(params)}"
print(f"Directing you to PayPal to donate to {recipient_email}...")
print(f"URL: {donation_url}")
try:
webbrowser.open(donation_url)
print("Browser opened successfully.")
except Exception as e:
print(f"Failed to open browser: {e}")
print("Please copy and paste the URL above into your browser.")
if __name__ == "__main__":
open_donation_page()