Fix typo in DonationLinkHelper and rewrote swtich statement

This commit is contained in:
Bri@n 2020-11-01 17:34:34 -05:00
parent 2f02c0e6a4
commit 82746d172f
1 changed files with 2 additions and 4 deletions

View File

@ -15,16 +15,14 @@ public class DonationLinkHelper {
AMAZON, AMAZON,
} }
public static DonationService getDonatoinServiceByLink(String link) throws MalformedURLException { public static DonationService getDonationServiceByLink(String link) throws MalformedURLException {
URL url = new URL(fixLink(link)); URL url = new URL(fixLink(link));
switch (url.getHost()) { switch (url.getHost()) {
case "www.patreon.com": case "www.patreon.com":
return DonationService.PATREON;
case "patreon.com": case "patreon.com":
return DonationService.PATREON; return DonationService.PATREON;
case "paypal.me":
return DonationService.PAYPAL;
case "www.paypal.me": case "www.paypal.me":
case "paypal.me":
return DonationService.PAYPAL; return DonationService.PAYPAL;
default: default:
return DonationService.NO_DONATION; return DonationService.NO_DONATION;