diff --git a/r2/example.ini b/r2/example.ini index b43540a7f..8259e2203 100644 --- a/r2/example.ini +++ b/r2/example.ini @@ -311,7 +311,6 @@ tracking_secret = abcdefghijklmnopqrstuvwxyz0123456789 # (secure) payment domain payment_domain = https://pay.reddit.local/ ad_domain = http://reddit.local -allowed_pay_countries = United States, United Kingdom, Canada sponsors = selfserve_support_email = selfservesupport@mydomain.com MAX_CAMPAIGNS_PER_LINK = 100 diff --git a/r2/r2/controllers/promotecontroller.py b/r2/r2/controllers/promotecontroller.py index 565fa66a8..75ee80017 100644 --- a/r2/r2/controllers/promotecontroller.py +++ b/r2/r2/controllers/promotecontroller.py @@ -682,8 +682,7 @@ class PromoteController(ListingController): edit=VBoolean("edit"), address=ValidAddress( ["firstName", "lastName", "company", "address", - "city", "state", "zip", "country", "phoneNumber"], - allowed_countries=g.allowed_pay_countries), + "city", "state", "zip", "country", "phoneNumber"]), creditcard=ValidCard(["cardNumber", "expirationDate", "cardCode"])) def POST_update_pay(self, form, jquery, link, campaign, customer_id, pay_id, diff --git a/r2/r2/lib/app_globals.py b/r2/r2/lib/app_globals.py index f39dcda74..bd5b8c6d1 100755 --- a/r2/r2/lib/app_globals.py +++ b/r2/r2/lib/app_globals.py @@ -183,7 +183,6 @@ class Globals(object): 'authorized_cnames', 'hardcache_categories', 's3_media_buckets', - 'allowed_pay_countries', 'case_sensitive_domains', 'reserved_subdomains', 'TRAFFIC_LOG_HOSTS', diff --git a/r2/r2/lib/validator/validator.py b/r2/r2/lib/validator/validator.py index d7f6b01ec..507a2ef66 100644 --- a/r2/r2/lib/validator/validator.py +++ b/r2/r2/lib/validator/validator.py @@ -1929,10 +1929,6 @@ class VDestination(Validator): } class ValidAddress(Validator): - def __init__(self, param, allowed_countries = ["United States"]): - self.allowed_countries = allowed_countries - Validator.__init__(self, param) - def set_error(self, msg, field): Validator.set_error(self, errors.BAD_ADDRESS, dict(message=msg), field = field) @@ -1952,11 +1948,7 @@ class ValidAddress(Validator): elif not zipCode: self.set_error(_("please provide your zip or post code"), "zip") elif not country: - self.set_error(_("please pick a country"), "country") - else: - country_name = g.countries.get(country) - if country_name not in self.allowed_countries: - self.set_error(_("Our ToS don't cover your country (yet). Sorry."), "country") + self.set_error(_("please provide your country"), "country") # Make sure values don't exceed max length defined in the authorize.net # xml schema: https://api.authorize.net/xml/v1/schema/AnetApiSchema.xsd @@ -1968,6 +1960,7 @@ class ValidAddress(Validator): (city, 40, 'city'), (state, 40, 'state'), (zipCode, 20, 'zip'), + (country, 60, 'country'), (phoneNumber, 255, 'phoneNumber') ] for (arg, max_length, form_field_name) in max_lengths: @@ -1980,7 +1973,7 @@ class ValidAddress(Validator): company = company or "", address = address, city = city, state = state, - zip = zipCode, country = country_name, + zip = zipCode, country = country, phoneNumber = phoneNumber or "") class ValidCard(Validator): diff --git a/r2/r2/templates/paymentform.html b/r2/r2/templates/paymentform.html index c89ec9e31..4c74cb38a 100644 --- a/r2/r2/templates/paymentform.html +++ b/r2/r2/templates/paymentform.html @@ -154,14 +154,12 @@ ${unsafe(js.use('sponsored'))} %elif field == "country": ## TODO: pycountry does country name i18n %else: