diff --git a/package-lock.json b/package-lock.json index fa94a61f..91351b35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@material-ui/core": "^4.11.3", "@material-ui/lab": "^4.0.0-alpha.57", "@next/bundle-analyzer": "^10.1.3", - "@paypal/react-paypal-js": "^7.5.0", + "@paypal/react-paypal-js": "^7.8.2", "@sentry/browser": "^6.2.5", "@sentry/integrations": "^6.2.5", "@sentry/node": "^6.2.5", @@ -707,20 +707,20 @@ } }, "node_modules/@paypal/paypal-js": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@paypal/paypal-js/-/paypal-js-4.2.1.tgz", - "integrity": "sha512-5b+UykL8+WNOEWHgC2nGJUR9EMmRJNspVBjT7knZcItTP9sQeQ7lCGoM5yubFDMeVmhmCZDtJDASpwlo9VOcJg==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@paypal/paypal-js/-/paypal-js-5.1.4.tgz", + "integrity": "sha512-5ktge4DFOMu3rvFR4YWDiPm4wDUzOmghtCM9ZxgJyJCOJP+61IVYdrENysMay91T4GOZ10k2ywWcBN5shsGhLw==", "dependencies": { - "promise-polyfill": "^8.2.1" + "promise-polyfill": "^8.2.3" } }, "node_modules/@paypal/react-paypal-js": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@paypal/react-paypal-js/-/react-paypal-js-7.5.0.tgz", - "integrity": "sha512-QWA0FArj4DG8WcyWZuQ/m7r4tI3Z3AF8Q/1cN8ANjUljjq7crvYu1a7WlRoBiwRQqaERXNjAZ3Ch+f22KRFGMA==", + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/@paypal/react-paypal-js/-/react-paypal-js-7.8.2.tgz", + "integrity": "sha512-H6/qpAVkf57spCgvQPO7jNhtD58KdiywqKYmgmJm7Xnwu2wH03XfOsBjlINi1zM1VnzcyKhcliyBh9+uTAzI0g==", "dependencies": { - "@paypal/paypal-js": "^4.2.1", - "@paypal/sdk-constants": "^1.0.110" + "@paypal/paypal-js": "^5.1.4", + "@paypal/sdk-constants": "^1.0.122" }, "peerDependencies": { "react": ">=16.3.0", @@ -728,13 +728,11 @@ } }, "node_modules/@paypal/sdk-constants": { - "version": "1.0.111", - "resolved": "https://registry.npmjs.org/@paypal/sdk-constants/-/sdk-constants-1.0.111.tgz", - "integrity": "sha512-be/EbIb4SaMsO2nm9BhAxwpO2b38RtT65HuO8y5VU4TnzyLkunowD7E5b0a6M+YvjsdX5NCN6yCrAgqxNBpm6g==", + "version": "1.0.128", + "resolved": "https://registry.npmjs.org/@paypal/sdk-constants/-/sdk-constants-1.0.128.tgz", + "integrity": "sha512-6DB6M+mnf4B9PQR/dutI1aNMnXTbw9N+VklUbO0FkGzF7k0vr8lflfitDAKWh1hFJf8XzFCe+KbknMSpJMqiDw==", "dependencies": { - "cross-domain-utils": "^2.0.10", - "hi-base32": "^0.5.0", - "zalgo-promise": "^1.0.28" + "hi-base32": "^0.5.0" } }, "node_modules/@polka/url": { @@ -2043,14 +2041,6 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, - "node_modules/cross-domain-utils": { - "version": "2.0.38", - "resolved": "https://registry.npmjs.org/cross-domain-utils/-/cross-domain-utils-2.0.38.tgz", - "integrity": "sha512-zZfi3+2EIR9l4chrEiXI2xFleyacsJf8YMLR1eJ0Veb5FTMXeJ3DpxDjZkto2FhL/g717WSELqbptNSo85UJDw==", - "dependencies": { - "zalgo-promise": "^1.0.11" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -5421,9 +5411,9 @@ } }, "node_modules/promise-polyfill": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.2.1.tgz", - "integrity": "sha512-3p9zj0cEHbp7NVUxEYUWjQlffXqnXaZIMPkAO7HhFh8u5636xLRDHOUo2vpWSK0T2mqm6fKLXYn1KP6PAZ2gKg==" + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.2.3.tgz", + "integrity": "sha512-Og0+jCRQetV84U8wVjMNccfGCnMQ9mGs9Hv78QFe+pSDD3gWTpz0y+1QCuxy5d/vBFuZ3iwP2eycAkvqIMPmWg==" }, "node_modules/prop-types": { "version": "15.7.2", @@ -6813,11 +6803,6 @@ "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" } - }, - "node_modules/zalgo-promise": { - "version": "1.0.48", - "resolved": "https://registry.npmjs.org/zalgo-promise/-/zalgo-promise-1.0.48.tgz", - "integrity": "sha512-LLHANmdm53+MucY9aOFIggzYtUdkSBFxUsy4glTTQYNyK6B3uCPWTbfiGvSrEvLojw0mSzyFJ1/RRLv+QMNdzQ==" } }, "dependencies": { @@ -7246,30 +7231,28 @@ } }, "@paypal/paypal-js": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@paypal/paypal-js/-/paypal-js-4.2.1.tgz", - "integrity": "sha512-5b+UykL8+WNOEWHgC2nGJUR9EMmRJNspVBjT7knZcItTP9sQeQ7lCGoM5yubFDMeVmhmCZDtJDASpwlo9VOcJg==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@paypal/paypal-js/-/paypal-js-5.1.4.tgz", + "integrity": "sha512-5ktge4DFOMu3rvFR4YWDiPm4wDUzOmghtCM9ZxgJyJCOJP+61IVYdrENysMay91T4GOZ10k2ywWcBN5shsGhLw==", "requires": { - "promise-polyfill": "^8.2.1" + "promise-polyfill": "^8.2.3" } }, "@paypal/react-paypal-js": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@paypal/react-paypal-js/-/react-paypal-js-7.5.0.tgz", - "integrity": "sha512-QWA0FArj4DG8WcyWZuQ/m7r4tI3Z3AF8Q/1cN8ANjUljjq7crvYu1a7WlRoBiwRQqaERXNjAZ3Ch+f22KRFGMA==", + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/@paypal/react-paypal-js/-/react-paypal-js-7.8.2.tgz", + "integrity": "sha512-H6/qpAVkf57spCgvQPO7jNhtD58KdiywqKYmgmJm7Xnwu2wH03XfOsBjlINi1zM1VnzcyKhcliyBh9+uTAzI0g==", "requires": { - "@paypal/paypal-js": "^4.2.1", - "@paypal/sdk-constants": "^1.0.110" + "@paypal/paypal-js": "^5.1.4", + "@paypal/sdk-constants": "^1.0.122" } }, "@paypal/sdk-constants": { - "version": "1.0.111", - "resolved": "https://registry.npmjs.org/@paypal/sdk-constants/-/sdk-constants-1.0.111.tgz", - "integrity": "sha512-be/EbIb4SaMsO2nm9BhAxwpO2b38RtT65HuO8y5VU4TnzyLkunowD7E5b0a6M+YvjsdX5NCN6yCrAgqxNBpm6g==", + "version": "1.0.128", + "resolved": "https://registry.npmjs.org/@paypal/sdk-constants/-/sdk-constants-1.0.128.tgz", + "integrity": "sha512-6DB6M+mnf4B9PQR/dutI1aNMnXTbw9N+VklUbO0FkGzF7k0vr8lflfitDAKWh1hFJf8XzFCe+KbknMSpJMqiDw==", "requires": { - "cross-domain-utils": "^2.0.10", - "hi-base32": "^0.5.0", - "zalgo-promise": "^1.0.28" + "hi-base32": "^0.5.0" } }, "@polka/url": { @@ -8242,14 +8225,6 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, - "cross-domain-utils": { - "version": "2.0.38", - "resolved": "https://registry.npmjs.org/cross-domain-utils/-/cross-domain-utils-2.0.38.tgz", - "integrity": "sha512-zZfi3+2EIR9l4chrEiXI2xFleyacsJf8YMLR1eJ0Veb5FTMXeJ3DpxDjZkto2FhL/g717WSELqbptNSo85UJDw==", - "requires": { - "zalgo-promise": "^1.0.11" - } - }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -10761,9 +10736,9 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" }, "promise-polyfill": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.2.1.tgz", - "integrity": "sha512-3p9zj0cEHbp7NVUxEYUWjQlffXqnXaZIMPkAO7HhFh8u5636xLRDHOUo2vpWSK0T2mqm6fKLXYn1KP6PAZ2gKg==" + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.2.3.tgz", + "integrity": "sha512-Og0+jCRQetV84U8wVjMNccfGCnMQ9mGs9Hv78QFe+pSDD3gWTpz0y+1QCuxy5d/vBFuZ3iwP2eycAkvqIMPmWg==" }, "prop-types": { "version": "15.7.2", @@ -11800,11 +11775,6 @@ "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" } - }, - "zalgo-promise": { - "version": "1.0.48", - "resolved": "https://registry.npmjs.org/zalgo-promise/-/zalgo-promise-1.0.48.tgz", - "integrity": "sha512-LLHANmdm53+MucY9aOFIggzYtUdkSBFxUsy4glTTQYNyK6B3uCPWTbfiGvSrEvLojw0mSzyFJ1/RRLv+QMNdzQ==" } } } diff --git a/package.json b/package.json index b78454c1..692192fa 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "@material-ui/core": "^4.11.3", "@material-ui/lab": "^4.0.0-alpha.57", "@next/bundle-analyzer": "^10.1.3", - "@paypal/react-paypal-js": "^7.5.0", + "@paypal/react-paypal-js": "^7.8.2", "@sentry/browser": "^6.2.5", "@sentry/integrations": "^6.2.5", "@sentry/node": "^6.2.5", diff --git a/public/locales/de/common.json b/public/locales/de/common.json index 205a4e71..8965480f 100644 --- a/public/locales/de/common.json +++ b/public/locales/de/common.json @@ -79,6 +79,7 @@ "thankyouHeaderText": "Wir sind auf dem Weg zu einer \n

Billion Bäume

.", "donationFailed": "Spende fehlgeschlagen", "donationFailedMessage": "Beim Abschluss deiner Zahlung ist etwas schief gelaufen. Wenn du weiterhin Probleme hast, kontaktiere uns bitte unter support@plant-for-the-planet.org.", + "paypalPaymentError": "Leider haben wir bei PayPal Zahlungen aktuell vereinzelt Probleme. Bitte versuchen Sie es erneut mit einer anderen Zahlart. Vielen Dank für Ihre Unterstützung und Ihr Verständnis. Wir arbeiten an der Problemlösung.", "donationPending": "Abschließen deiner Spende", "donationPendingMessage": "Wir warten derzeit auf die Bestätigung von deiner Bank. Dies kann einige Zeit dauern, daher kannst du diese Seite auch schließen. Wir werden dir den Beleg in Kürze per E-Mail zusenden.", "transactionId": "Transaktions-ID", @@ -175,4 +176,4 @@ "planetCashIUnderstand": "Ich verstehe, dass PlanetCash Spenden/Zahlungen nicht zurückerstattet werden können, und dass nicht zugewiesene Zahlungen nach sechs Monaten automatisch Projekten auf der Plattform zugewiesen werden.", "createPlanetCashAccount": "PlanetCash Konto erstellen", "myContributionIsPartOfThat": "Und meine Spende ist Teil davon." -} \ No newline at end of file +} diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 682e7644..e1d28a88 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -79,6 +79,7 @@ "thankyouHeaderText": "We're on the road to a \n

Trillion Trees

.", "donationFailed": "Donation Failed", "donationFailedMessage": "Something went wrong while completing your payment. If you continue having issues please reach out to us at support@plant-for-the-planet.org", + "paypalPaymentError": "Unfortunately, we are currently experiencing isolated problems with PayPal payments. Please try again with another payment method. Thank you for your support and understanding. We are working on solving the problem.", "donationPending": "Completing your donation", "donationPendingMessage": "We are currently waiting for the confirmation from your bank. This might take some time so, please feel free to close this page. We’ll send your receipt via email shortly.", "transactionId": "Transaction ID", @@ -175,4 +176,4 @@ "planetCashIUnderstand": "I understand that PlanetCash donation/payments are non-refundable, and unallocated payments will be auto allocated to projects on the Platform after six months of Payment.", "createPlanetCashAccount": "Create PlanetCash Account", "myContributionIsPartOfThat": "And my contribution is a part of that." -} \ No newline at end of file +} diff --git a/public/locales/es/common.json b/public/locales/es/common.json index b3fc7cbe..61fd00ab 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -66,6 +66,7 @@ "thankyouHeaderText": "Estamos en el camino hacia una \n

Trillón de árboles

", "donationFailed": "Donación fallida", "donationFailedMessage": "Algo ha ido mal al completar el pago. Si sigue teniendo problemas, póngase en contacto con nosotros en support@plant-for-the-planet.org", + "paypalPaymentError": "Lamentablemente, estamos experimentando problemas con los pagos de PayPal. Por favor, inténtelo de nuevo con otro método de pago. Gracias por su apoyo y comprensión. Estamos trabajando en una solución al problema.", "donationPending": "Completar su donación", "donationPendingMessage": "Actualmente estamos esperando la confirmación de su banco. Esto puede llevar algún tiempo, así que no dude en cerrar esta página. En breve le enviaremos su recibo por correo electrónico.", "transactionId": "Ref. de la donación", @@ -105,4 +106,4 @@ "dedicatedTo": "Dedicado a", "message": "Mensaje", "contributedToTpo": "He aportado {{amount}} a {{organization}}" -} \ No newline at end of file +} diff --git a/src/Donations/PaymentMethods/NewPaypal.tsx b/src/Donations/PaymentMethods/NewPaypal.tsx index 00d998fa..44830b76 100644 --- a/src/Donations/PaymentMethods/NewPaypal.tsx +++ b/src/Donations/PaymentMethods/NewPaypal.tsx @@ -1,4 +1,5 @@ import React, { ReactElement, Dispatch, SetStateAction } from "react"; +import { useTranslation } from "next-i18next"; import { PayPalScriptProvider, PayPalButtons, @@ -39,6 +40,7 @@ function NewPaypal({ payDonationFunction, setPaymentError, }: Props): ReactElement { + const { t } = useTranslation("common"); const initialOptions = { "client-id": paymentSetup?.gateways.paypal.authorization.client_id, "enable-funding": "venmo", @@ -85,9 +87,8 @@ function NewPaypal({ } const onError = (data: Record): void => { - setPaymentError(`Your order failed due to some error.`); - - // This function shows a transaction success message to your buyer. + setPaymentError(t("paypalPaymentError")); + // This function shows a transaction error message to your buyer. const _data: Readonly = { ...data, type: "sdk", diff --git a/src/Utils/countriesData.json b/src/Utils/countriesData.json index 7aff6ccc..e9d941bf 100644 --- a/src/Utils/countriesData.json +++ b/src/Utils/countriesData.json @@ -890,8 +890,8 @@ { "countryName": "Croatia (Hrvatska)", "countryCode": "HR", - "currencyName": "Croatian Dinar", - "currencyCode": "HRK", + "currencyName": "Euros", + "currencyCode": "EUR", "currencyCountryFlag": "HR", "languageCode": "en" },