Skip to content

Commit

Permalink
Merge branch 'develop' into feature/offlineTesting
Browse files Browse the repository at this point in the history
  • Loading branch information
sagararyal committed Dec 16, 2021
2 parents 21795de + ce99b38 commit cb64fd8
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 40 deletions.
6 changes: 4 additions & 2 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ESRI_CLIENT_SECRET=
SCHEME=https

# Only required to upload sourcemaps
NEXT_PUBLIC_SENTRY_DSN=https://[email protected]/6108978
SENTRY_ORG=plant-for-the-planet
SENTRY_PROJECT=app-20-next
NEXT_PUBLIC_SENTRY_DSN=https://[email protected]/5433504
SENTRY_PROJECT=planet-donations
SENTRY_AUTH_TOKEN=
SOURCE_VERSION=
15 changes: 4 additions & 11 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const withPlugins = require("next-compose-plugins");
// Use the hidden-source-map option when you don't want the source maps to be
// publicly available on the servers, only to the error reporting
const withSourceMaps = require("@zeit/next-source-maps")();
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
Expand All @@ -16,13 +13,15 @@ const {
SENTRY_PROJECT,
SENTRY_AUTH_TOKEN,
NODE_ENV,
VERCEL_GIT_COMMIT_SHA,
VERCEL_GITHUB_COMMIT_SHA,
VERCEL_GITLAB_COMMIT_SHA,
VERCEL_BITBUCKET_COMMIT_SHA,
SOURCE_VERSION,
} = process.env;

const COMMIT_SHA =
VERCEL_GIT_COMMIT_SHA ||
VERCEL_GITHUB_COMMIT_SHA ||
VERCEL_GITLAB_COMMIT_SHA ||
VERCEL_BITBUCKET_COMMIT_SHA ||
Expand All @@ -46,7 +45,8 @@ if (process.env.NEXT_PUBLIC_VERCEL_ENV === "preview") {
const hasAssetPrefix =
process.env.ASSET_PREFIX !== "" && process.env.ASSET_PREFIX !== undefined;

module.exports = withPlugins([[withBundleAnalyzer], [withSourceMaps]], {
module.exports = withPlugins([[withBundleAnalyzer]], {
productionBrowserSourceMaps: true,
serverRuntimeConfig: {
rootDir: __dirname,
},
Expand Down Expand Up @@ -87,13 +87,6 @@ module.exports = withPlugins([[withBundleAnalyzer], [withSourceMaps]], {
NODE_ENV === "production"
) {
config.plugins.push(
new SentryWebpackPlugin({
include: ".next",
ignore: ["node_modules"],
stripPrefix: ["webpack://_N_E/"],
urlPrefix: `~${basePath}/_next`,
release: COMMIT_SHA,
}),
new SentryWebpackPlugin({
include: ".next",
ignore: ["node_modules"],
Expand Down
12 changes: 0 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"@sentry/webpack-plugin": "^1.14.2",
"@stripe/react-stripe-js": "^1.4.0",
"@stripe/stripe-js": "^1.13.2",
"@zeit/next-source-maps": "0.0.4-canary.1",
"axios": "^0.21.1",
"dom-to-image": "^2.6.0",
"geocoder-arcgis": "^2.0.5",
Expand Down
9 changes: 3 additions & 6 deletions src/Donations/Components/PaymentsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,7 @@ function PaymentsForm({}: Props): ReactElement {
const onPaymentFunction = async (paymentMethod: any, paymentRequest: any) => {
setPaymentType(paymentRequest._activeBackingLibraryName);
const gateway = "stripe";
onSubmitPayment(
gateway,
"card",
paymentMethod
);
onSubmitPayment(gateway, "card", paymentMethod);
};

async function getDonation() {
Expand Down Expand Up @@ -306,7 +302,8 @@ function PaymentsForm({}: Props): ReactElement {
showSepa={showPaymentMethod({
paymentMethod: "sepa_debit",
currencies: ["EUR"],
authenticatedMethod: true,
authenticatedMethod:
projectDetails.purpose === "funds" ? false : true,
})}
showSofort={showPaymentMethod({
paymentMethod: "sofort",
Expand Down
2 changes: 1 addition & 1 deletion src/Donations/Micros/DonationTypes/FundingDonations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function FundingDonations({ setopenCurrencyModal }: Props): ReactElement {
}, [paymentSetup]);

const customInputRef = React.useRef(null);
console.log(`option.quantity , quantity `, paymentSetup.options, quantity);

return (
<>
<div
Expand Down
29 changes: 23 additions & 6 deletions src/Donations/PaymentMethods/NewPaypal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ function NewPaypal({
const { donationUid } = React.useContext(QueryParamContext);

function createOrder(data, actions) {
const value = paymentSetup.unitBased
? quantity * unitCost
: quantity;
return actions.order.create({
purchase_units: [
{
amount: {
value: (paymentSetup.unitBased
? quantity * unitCost
: quantity
).toFixed(2),
value: value.toFixed(2),
currency: currency,
},
invoice_id: `planet-${donationID}`,
Expand All @@ -67,11 +67,28 @@ function NewPaypal({
}

const onError = (data) => {
setPaymentError(`Your order ${data.orderID} failed due to some error.`);
setPaymentError(`Your order failed due to some error.`);

// This function shows a transaction success message to your buyer.
data = {
...data,
type: "sdk",
status: "error",
errorMessage: data?.message,
};
payDonationFunction("paypal", "paypal", data);
};

const onCancel = (data) => {
const onCancel = (data, actions) => {
setPaymentError("Order was cancelled, please try again");

// This function shows a transaction success message to your buyer.
data = {
...data,
type: "sdk",
status: "cancel",
};
payDonationFunction("paypal", "paypal", data);
};

return (
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/getTenantBackground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function getTenantBackground(tenant: any, projectDetails: any) {
imageUrl = tenantImage;
} else {
if (projectDetails && projectDetails.image) {
imageUrl = getImageUrl("project", "medium", projectDetails.image);
imageUrl = getImageUrl("project", "large", projectDetails.image);
} else {
imageUrl = defaultForest;
}
Expand Down

0 comments on commit cb64fd8

Please sign in to comment.