Skip to content

Commit

Permalink
fix(payment): cleeng paypal invalid url error
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristiaanScheermeijer authored and AntonLantukh committed Apr 22, 2024
1 parent 1cd135e commit 880e4af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const Checkout = () => {
const cancelUrl = modalURLFromWindowLocation('payment-cancelled');
const waitingUrl = modalURLFromWindowLocation('waiting-for-payment', { offerId: selectedOffer?.offerId });
const errorUrl = modalURLFromWindowLocation('payment-error');
const successUrlPaypal = offerType === 'svod' ? waitingUrl : closeModalUrl;
const successUrlPaypal = offerType === 'svod' ? waitingUrl : modalURLFromWindowLocation(null);
const referrer = window.location.href;

const paymentMethod = paymentMethods?.find((method) => method.id === parseInt(paymentMethodId));
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/src/utils/location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export const modalURLFromLocation = (location: Location, u: keyof AccountModals
};

// Create a full modal url including hostname, mostly for external use (e.g paypal successUrl)
export const modalURLFromWindowLocation = (u: keyof AccountModals, queryParams?: QueryParamsArg) => {
export const modalURLFromWindowLocation = (u: keyof AccountModals | null, queryParams?: QueryParamsArg) => {
return createURL(window.location.href, { u, ...queryParams });
};

0 comments on commit 880e4af

Please sign in to comment.