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

OM-150 Added url encoding #26

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Changes from all 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
5 changes: 2 additions & 3 deletions msystems/views/mpay.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import decimal
import logging
from functools import reduce

from lxml import etree
from django.db import transaction
Expand All @@ -15,7 +14,7 @@
from spyne.protocol.soap import Soap11
from spyne.server.django import DjangoApplication
from spyne.service import ServiceBase
from urllib.parse import urljoin
from urllib.parse import urljoin, quote_plus
from zeep.exceptions import SignatureVerificationFailed

from invoice.apps import InvoiceConfig
Expand Down Expand Up @@ -222,5 +221,5 @@ def mpay_bill_payment_redirect(request):
bill_path = f"{MsystemsConfig.mpay_config['bill_path']}/{bill_id}/"
redirect_back_url = urljoin(host, bill_path)
redirect_url = urljoin(MsystemsConfig.mpay_config['url'], MsystemsConfig.mpay_config['payment_path'])
query = f"OrderKey={bill.code}&ServiceID={MsystemsConfig.mpay_config['service_id']}&ReturnUrl={redirect_back_url}"
query = f"OrderKey={quote_plus(bill.code)}&ServiceID={quote_plus(MsystemsConfig.mpay_config['service_id'])}&ReturnUrl={quote_plus(redirect_back_url)}"
return redirect(f"{redirect_url}?{query}")
Loading