Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

fix: Passing paypal variable through to checkout if set #4169

Merged
merged 9 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/migrations-mysql8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
mysql -V
- name: Install Python dependencies
run: |
pip install pip==21.2.1 --upgrade # set pip version to be compatible with deprecated pip version syntax
pip install -r requirements/pip_tools.txt
pip install -r requirements/production.txt
pip uninstall -y mysqlclient
Expand Down
9 changes: 9 additions & 0 deletions ecommerce/coupons/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,16 @@ def get(self, request): # pylint: disable=too-many-statements
# and should not display the payment form before making that determination.
# TODO: It would be cleaner if the user could be redirected to their final destination up front.
redirect_url = get_payment_microfrontend_or_basket_url(self.request) + "?coupon_redeem_redirect=1"

# Check for the paypal_redirect=1 parameter from the ecommerce checkout and add it to the
# redirect URL if present
paypal_redirect = request.GET.get('paypal_redirect')

if paypal_redirect:
redirect_url += "&paypal_redirect=1"

redirect_url = add_stripe_flag_to_url(redirect_url, self.request)

return HttpResponseRedirect(redirect_url)


Expand Down
9 changes: 9 additions & 0 deletions ecommerce/extensions/basket/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,15 @@ def _redirect_response_to_basket_or_payment(self, request, invalid_code=None):
redirect_url = get_payment_microfrontend_or_basket_url(request)
redirect_url = add_utm_params_to_url(redirect_url, list(self.request.GET.items()))
grmartin marked this conversation as resolved.
Show resolved Hide resolved
redirect_url = add_invalid_code_message_to_url(redirect_url, invalid_code)

# Check for the paypal_redirect=1 parameter from the ecommerce checkout and add it to the
# redirect URL if present
paypal_redirect = request.GET.get('paypal_redirect')

if paypal_redirect:
redirect_url += '&' if '?' in redirect_url else '?'
redirect_url += 'paypal_redirect=1'
grmartin marked this conversation as resolved.
Show resolved Hide resolved

redirect_url = add_stripe_flag_to_url(redirect_url, request)

return HttpResponseRedirect(redirect_url, status=303)
Expand Down
2 changes: 1 addition & 1 deletion requirements/pip_tools.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-c constraints.txt

# Dependencies to run compile tools
pip-tools # Contains pip-compile, used to generate pip requirements files
pip-tools==6.0 # Contains pip-compile, used to generate pip requirements files
2 changes: 1 addition & 1 deletion requirements/pip_tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ click==8.1.3
# via pip-tools
packaging==23.1
# via build
pip-tools==6.13.0
pip-tools==6.0
# via -r requirements/pip_tools.in
pyproject-hooks==1.0.0
# via build
Expand Down
Loading