You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.4 KiB

  1. /* eslint react/prop-types: 0 */
  2. import React from "react";
  3. import i18n from "../../i18n";
  4. import { withTranslation } from "react-i18next";
  5. import { faPaypal } from "@fortawesome/free-brands-svg-icons";
  6. import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
  7. const Paypal = props => {
  8. const { t } = props;
  9. let localeStringShort = i18n.language? i18n.language.substring(0, 2): "en";
  10. let localeStringComplete =
  11. localeStringShort.toLowerCase() + "_" + localeStringShort.toUpperCase();
  12. if (localeStringComplete === "en_EN") {
  13. localeStringComplete = "en_US";
  14. }
  15. const pixelLink =
  16. "https://www.paypal.com/" + localeStringComplete + "/i/scr/pixel.gif";
  17. return (
  18. <div className="d-inline-block m-auto">
  19. <form
  20. action="https://www.paypal.com/cgi-bin/webscr"
  21. method="post"
  22. target="_top"
  23. >
  24. <button
  25. type="submit"
  26. className={"btn " + props.btnColor}
  27. title={t("PayPal - The safer, easier way to pay online!")}
  28. >
  29. {" "}
  30. <FontAwesomeIcon icon={faPaypal} className="mr-2" />
  31. {t("Support us !")}
  32. </button>
  33. <input type="hidden" name="cmd" value="_s-xclick" />
  34. <input type="hidden" name="hosted_button_id" value="KB2Z7L9KARS7C" />
  35. <img alt="" border="0" src={pixelLink} width="1" height="1" />
  36. </form>
  37. </div>
  38. );
  39. };
  40. export default withTranslation()(Paypal);