Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
db331b7f
Commit
db331b7f
authored
Dec 26, 2014
by
Jesse Zoldak
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6382 from edx/zoldak/fix-master
Revert "Better i18n for credit card charge failures"
parents
619a5ea3
6122f9c9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
63 deletions
+50
-63
lms/djangoapps/shoppingcart/processors/CyberSource.py
+50
-63
No files found.
lms/djangoapps/shoppingcart/processors/CyberSource.py
View file @
db331b7f
...
@@ -241,22 +241,23 @@ def get_processor_decline_html(params):
...
@@ -241,22 +241,23 @@ def get_processor_decline_html(params):
# see if we have an override in the microsites
# see if we have an override in the microsites
payment_support_email
=
microsite
.
get_value
(
'payment_support_email'
,
settings
.
PAYMENT_SUPPORT_EMAIL
)
payment_support_email
=
microsite
.
get_value
(
'payment_support_email'
,
settings
.
PAYMENT_SUPPORT_EMAIL
)
msg
=
_
(
msg
=
dedent
(
_
(
"Sorry! Our payment processor did not accept your payment. "
"""
"The decision they returned was {decision_text}, "
<p class="error_msg">
"and the reason was {reason_text}. "
Sorry! Our payment processor did not accept your payment.
"You were not charged. "
The decision they returned was <span class="decision">{decision}</span>,
"Please try a different form of payment. "
and the reason was <span class="reason">{reason_code}:{reason_msg}</span>.
"Contact us with payment-related questions at {email}."
You were not charged. Please try a different form of payment.
)
Contact us with payment-related questions at {email}.
formatted
=
msg
.
format
(
</p>
decision_text
=
'<span class="decision">{}</span>'
.
format
(
params
[
'decision'
]),
"""
reason_text
=
'<span class="reason">{code}:{msg}</span>'
.
format
(
))
code
=
params
[
'reasonCode'
],
msg
=
REASONCODE_MAP
[
params
[
'reasonCode'
]],
),
return
msg
.
format
(
email
=
payment_support_email
,
decision
=
params
[
'decision'
],
)
reason_code
=
params
[
'reasonCode'
],
return
'<p class="error_msg">{}</p>'
.
format
(
formatted
)
reason_msg
=
REASONCODE_MAP
[
params
[
'reasonCode'
]],
email
=
payment_support_email
)
def
get_processor_exception_html
(
exception
):
def
get_processor_exception_html
(
exception
):
...
@@ -265,55 +266,41 @@ def get_processor_exception_html(exception):
...
@@ -265,55 +266,41 @@ def get_processor_exception_html(exception):
# see if we have an override in the microsites
# see if we have an override in the microsites
payment_support_email
=
microsite
.
get_value
(
'payment_support_email'
,
settings
.
PAYMENT_SUPPORT_EMAIL
)
payment_support_email
=
microsite
.
get_value
(
'payment_support_email'
,
settings
.
PAYMENT_SUPPORT_EMAIL
)
if
isinstance
(
exception
,
CCProcessorDataException
):
if
isinstance
(
exception
,
CCProcessorDataException
):
msg
=
_
(
msg
=
dedent
(
_
(
"Sorry! Our payment processor sent us back a payment confirmation "
"""
"that had inconsistent data!"
<p class="error_msg">
"We apologize that we cannot verify whether the charge went through "
Sorry! Our payment processor sent us back a payment confirmation that had inconsistent data!
"and take further action on your order."
We apologize that we cannot verify whether the charge went through and take further action on your order.
"The specific error message is: {error_message}. "
The specific error message is: <span class="exception_msg">{msg}</span>.
"Your credit card may possibly have been charged. "
Your credit card may possibly have been charged. Contact us with payment-specific questions at {email}.
"Contact us with payment-specific questions at {email}."
</p>
)
"""
.
format
(
msg
=
exception
.
message
,
email
=
payment_support_email
)
formatted
=
msg
.
format
(
))
error_message
=
'<span class="exception_msg">{msg}</span>'
.
format
(
return
msg
msg
=
exception
.
message
,
),
email
=
payment_support_email
,
)
return
'<p class="error_msg">{}</p>'
.
format
(
formatted
)
elif
isinstance
(
exception
,
CCProcessorWrongAmountException
):
elif
isinstance
(
exception
,
CCProcessorWrongAmountException
):
msg
=
_
(
msg
=
dedent
(
_
(
"Sorry! Due to an error your purchase was charged for "
"""
"a different amount than the order total! "
<p class="error_msg">
"The specific error message is: {error_message}. "
Sorry! Due to an error your purchase was charged for a different amount than the order total!
"Your credit card has probably been charged. "
The specific error message is: <span class="exception_msg">{msg}</span>.
"Contact us with payment-specific questions at {email}."
Your credit card has probably been charged. Contact us with payment-specific questions at {email}.
)
</p>
formatted
=
msg
.
format
(
"""
.
format
(
msg
=
exception
.
message
,
email
=
payment_support_email
)
error_message
=
'<span class="exception_msg">{msg}</span>'
.
format
(
))
msg
=
exception
.
message
,
return
msg
),
email
=
payment_support_email
,
)
return
'<p class="error_msg">{}</p>'
.
format
(
formatted
)
elif
isinstance
(
exception
,
CCProcessorSignatureException
):
elif
isinstance
(
exception
,
CCProcessorSignatureException
):
msg
=
_
(
msg
=
dedent
(
_
(
"Sorry! Our payment processor sent us back a corrupted message "
"""
"regarding your charge, so we are unable to validate that "
<p class="error_msg">
"the message actually came from the payment processor. "
Sorry! Our payment processor sent us back a corrupted message regarding your charge, so we are
"The specific error message is: {error_message}. "
unable to validate that the message actually came from the payment processor.
"We apologize that we cannot verify whether the charge went through "
The specific error message is: <span class="exception_msg">{msg}</span>.
"and take further action on your order. "
We apologize that we cannot verify whether the charge went through and take further action on your order.
"Your credit card may possibly have been charged. "
Your credit card may possibly have been charged. Contact us with payment-specific questions at {email}.
"Contact us with payment-specific questions at {email}."
</p>
)
"""
.
format
(
msg
=
exception
.
message
,
email
=
payment_support_email
)
formatted
=
msg
.
format
(
))
error_message
=
'<span class="exception_msg">{msg}</span>'
.
format
(
return
msg
msg
=
exception
.
message
,
),
email
=
payment_support_email
,
)
return
'<p class="exception_msg">{}</p>'
.
format
(
formatted
)
# fallthrough case, which basically never happens
# fallthrough case, which basically never happens
return
'<p class="error_msg">EXCEPTION!</p>'
return
'<p class="error_msg">EXCEPTION!</p>'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment