Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release January 2024 #458

Merged
merged 20 commits into from
Jan 22, 2024
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
cd00b92
refactor: remove conditions
prachigarg19 Nov 9, 2023
1966965
console paymenrequest
prachigarg19 Nov 22, 2023
de0c599
deleted commented code
norbertschuler Dec 7, 2023
0741a44
fix: prevents repeated Google/ApplePay charges
mohitb35 Jan 3, 2024
2d16d70
feat: adds env vars to enable Google/ApplePay
mohitb35 Jan 3, 2024
057c639
fix: initializes`paymentRequest` on project change
mohitb35 Jan 8, 2024
1800075
chore(deps): bump axios from 0.21.4 to 1.6.0
dependabot[bot] Jan 9, 2024
5bbb787
feat: conditionally prevent redirect to VERCEL_URL
mohitb35 Jan 12, 2024
e9c24eb
enable ApplePay by default like GooglePay is enabled by default
norbertschuler Jan 13, 2024
6887189
feat: disables native payments by default
mohitb35 Jan 15, 2024
67b1d1b
Merge pull request #447 from Plant-for-the-Planet-org/feature/enable-…
mariahosfeld Jan 15, 2024
a3d9ba2
Merge pull request #448 from Plant-for-the-Planet-org/dependabot/npm_…
mariahosfeld Jan 15, 2024
996493f
chore(deps): bump follow-redirects from 1.15.2 to 1.15.5
dependabot[bot] Jan 15, 2024
260f44c
Merge pull request #459 from Plant-for-the-Planet-org/dependabot/npm_…
mohitb35 Jan 15, 2024
9050c73
fix: resolves bugs with planetcash switch
mohitb35 Jan 16, 2024
2ab3093
fix: shows a loader while refreshing native pay btns
mohitb35 Jan 16, 2024
37cf052
fix: corrects paymentLabel for payment request while donating to pcash
mohitb35 Jan 17, 2024
8ccd0d1
fix: fixes issues with native payments to pcash
mohitb35 Jan 17, 2024
a2d8163
feat: enables auth on custom domain by preventing redirects based on …
mohitb35 Jan 17, 2024
d720673
Merge pull request #460 from Plant-for-the-Planet-org/feature/planetc…
mariahosfeld Jan 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
refactor: remove conditions
prachigarg19 committed Nov 9, 2023
commit cd00b927f90ef8a63efcff40423b9d3478d29c45
14 changes: 7 additions & 7 deletions src/Donations/Components/DonationsForm.tsx
Original file line number Diff line number Diff line change
@@ -108,7 +108,7 @@ function DonationsForm(): ReactElement {
//Only used for native pay. Is this still applicable, or should this be removed?
const onPaymentFunction = async (
paymentMethod: PaymentMethod,
paymentRequest: PaymentRequest,
paymentRequest: PaymentRequest
) => {
// eslint-disable-next-line no-underscore-dangle
setPaymentType(paymentRequest._activeBackingLibraryName); //TODOO - is _activeBackingLibraryName a private variable?
@@ -223,7 +223,7 @@ function DonationsForm(): ReactElement {
amount: getFormatedCurrency(
i18n.language,
currency,
paymentSetup.unitCost * quantity,
paymentSetup.unitCost * quantity
),
});
break;
@@ -233,7 +233,7 @@ function DonationsForm(): ReactElement {
amount: getFormatedCurrency(
i18n.language,
currency,
paymentSetup.unitCost * quantity,
paymentSetup.unitCost * quantity
),
});
break;
@@ -389,13 +389,13 @@ function DonationsForm(): ReactElement {
paymentSetup?.gateways?.stripe?.account &&
currency ? (
<NativePay
isApplePayEnabled={false}
isGooglePayEnabled={false}
// isApplePayEnabled={true}
// isGooglePayEnabled={true}
country={country}
currency={currency}
amount={formatAmountForStripe(
paymentSetup?.unitCost * quantity,
currency.toLowerCase(),
currency.toLowerCase()
)}
onPaymentFunction={onPaymentFunction}
paymentSetup={paymentSetup}
@@ -405,7 +405,7 @@ function DonationsForm(): ReactElement {
query: { ...router.query, step: CONTACT },
},
undefined,
{ shallow: true },
{ shallow: true }
);
setRetainQuantityValue(true);
}}
4 changes: 2 additions & 2 deletions src/Donations/PaymentMethods/PaymentMethodTabs.tsx
Original file line number Diff line number Diff line change
@@ -218,8 +218,8 @@ export default function PaymentMethodTabs({
{/*9 May 2023 - Apple Pay / Google Pay is disabled currently as it is not working correctly*/}
{showNativePay && (
<NativePay
isApplePayEnabled={false}
isGooglePayEnabled={false}
// isApplePayEnabled={true}
// isGooglePayEnabled={true}
country={country}
currency={currency}
amount={formatAmountForStripe(
30 changes: 15 additions & 15 deletions src/Donations/PaymentMethods/PaymentRequestCustomButton.tsx
Original file line number Diff line number Diff line change
@@ -29,8 +29,8 @@ interface PaymentButtonProps {
paymentLabel: string;
frequency: string | null;
paymentSetup: PaymentOptions;
isApplePayEnabled: boolean;
isGooglePayEnabled: boolean;
// isApplePayEnabled: boolean;
// isGooglePayEnabled: boolean;
}

export const PaymentRequestCustomButton = ({
@@ -43,9 +43,9 @@ export const PaymentRequestCustomButton = ({
paymentLabel,
frequency,
paymentSetup,
isApplePayEnabled,
isGooglePayEnabled,
}: PaymentButtonProps): ReactElement | null => {
}: // isApplePayEnabled,
// isGooglePayEnabled,
PaymentButtonProps): ReactElement | null => {
const { t, ready } = useTranslation(["common"]);
const { paymentRequest, setPaymentRequest } = useContext(QueryParamContext);

@@ -74,6 +74,7 @@ export const PaymentRequestCustomButton = ({
if (result) {
setPaymentRequest(pr);
}
console.log(result);
});
}
}, [stripe, paymentRequest, country, currency, amount]);
@@ -130,6 +131,7 @@ export const PaymentRequestCustomButton = ({
}
};
}, [paymentRequest, onPaymentFunction]);
console.log(paymentRequest);

return ready ? (
<div
@@ -146,8 +148,7 @@ export const PaymentRequestCustomButton = ({
(frequency !== "once"
? paymentSetup?.recurrency?.methods?.includes("card")
: true) ? (
paymentRequest._canMakePaymentAvailability.APPLE_PAY &&
isApplePayEnabled ? ( //TODOO - is _canMakePaymentAvailability a private variable?
paymentRequest._canMakePaymentAvailability.APPLE_PAY ? ( //TODOO - is _canMakePaymentAvailability a private variable?
<div className="w-100">
<button
onClick={() => paymentRequest.show()}
@@ -170,8 +171,7 @@ export const PaymentRequestCustomButton = ({
<div className="separator-text mb-10">{t("or")}</div>
)}
</div>
) : paymentRequest._canMakePaymentAvailability.GOOGLE_PAY &&
isGooglePayEnabled ? ( //TODOO - is _canMakePaymentAvailability a private variable?
) : paymentRequest._canMakePaymentAvailability.GOOGLE_PAY ? ( //TODOO - is _canMakePaymentAvailability a private variable?
<div className="w-100">
<button
onClick={() => {
@@ -215,8 +215,8 @@ export const PaymentRequestCustomButton = ({
/* 9 May 2023 - Apple Pay / Google Pay is disabled currently as it is not working correctly*/

interface NativePayProps {
isApplePayEnabled: boolean;
isGooglePayEnabled: boolean;
// isApplePayEnabled: boolean;
// isGooglePayEnabled: boolean;
country: string;
currency: string;
amount: number;
@@ -231,8 +231,8 @@ interface NativePayProps {
frequency: string | null;
}
export const NativePay = ({
isApplePayEnabled = false,
isGooglePayEnabled = false,
// isApplePayEnabled = true,
// isGooglePayEnabled = true,
country,
currency,
amount,
@@ -279,8 +279,8 @@ export const NativePay = ({
paymentLabel={paymentLabel}
frequency={frequency}
paymentSetup={paymentSetup}
isApplePayEnabled={isApplePayEnabled}
isGooglePayEnabled={isGooglePayEnabled}
// isApplePayEnabled={true}
// isGooglePayEnabled={true}
/>
</Elements>
);