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
Honor verification required setting for professional courses in the receipt view #12470
Conversation
Thanks for the pull request, @jbzdak! It looks like you're a member of a company that does contract work for edX. If you're doing this work as part of a paid contract with edX, you should talk to edX about who will review this pull request. If this work is not part of a paid contract with edX, then you should ensure that there is an OSPR issue to track this work in JIRA, so that we don't lose track of your pull request. To automatically create an OSPR issue for this pull request, just visit this link: https://openedx-webhooks.herokuapp.com/github/process_pr?repo=edx%2Fedx-platform&number=12470 |
9a94862
to
d2d8e86
Compare
d2d8e86
to
e42be45
Compare
👍 |
Thanks for the pull request, @jbzdak! I've created OSPR-1273 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams. Feel free to add as much of the following information to the ticket:
All technical communication about the code itself will still be done via the GitHub pull request interface. As a reminder, our process documentation is here. |
d70043c
to
2958839
Compare
verify the user.
2958839
to
83e557d
Compare
@edx/ecommerce Does this need a second thumb? (Also, sincere apologies @jbzdak for letting this sit without action for so long) |
Will do, @e-kolpakov |
@shaunagm Does this silence means "everything is right" or "we haven't looked at it yet"? :) |
@e-kolpakov it means we haven't had a chance to look at it. Review of this PR is in our sprint, which ends next Monday. We'll take a look at it before then. |
@mjfrey has the receipt page been moved to edx/ecommerce? If not, when will that happen and what ticket is tracking the work? |
The decision has been made to not merge this. The receipt page is moving to edx/ecommerce, where this issue will be addressed. |
Moving discussion from email to the relevant PR. It seems like there are two major options - making this fix as part of the refactoring/move to edx/ecommerce, and making this fix afterwards. What's your preference for how to proceed? (What's Deen's github handle? I want to tag them too.) |
Considering the uncertainty around when the receipt page will be moved, I'm inclined to merge this and move forward. |
@clintonb That would be great - this way there is something in place to address it in the meantime. Thank you! I'm reopening this PR then - let me know if there is anything else we need to do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks goods good aside from the string vs. boolean questions.
var requests, view, orderUrlFormat, | ||
actualRequestInThemedSite = requestInThemedSite; | ||
if (typeof actualRequestInThemedSite === 'undefined') { | ||
actualRequestInThemedSite = 'False'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a string instead of an actual boolean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@clintonb Most likely it would work with actualRequestInThemedSite
(and corresponding parameters up the call chain) being a proper boolean, but this is closer to how LMS actually operates: it renders a python boolean into a HTML tag. When it happens, booleans are str
ed, and their python string representation is "True" and "False` (i.e. titlecase).
I would suggest keeping it as now for two reasons:
- As I've said, it is closer to how LMS actually works
- We maintain a fork with this exact commit applied - it would be nice to not introduce the code drift.
}, | ||
|
||
renderReceipt: function(data) { | ||
var templateHtml = $('#receipt-tpl').html(), | ||
self = this, | ||
context = { | ||
platformName: this.$el.data('platform-name'), | ||
verified: this.$el.data('verified').toLowerCase() === 'true', | ||
is_request_in_themed_site: this.$el.data('is-request-in-themed-site').toLowerCase() === 'true' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question regarding string versus boolean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@clintonb Better ask @mattdrayer about this, but as far as I can tell, this.$el.data('is-request-in-themed-site')
returns a string (just like other jQuery.data
"getter" calls). Than, if what was stored in attribute was boolean there's a quirk:
- When it is stored (either via
data-something
attribute in HTML or viajQuery.data
call) it is serialized. Booleans serialize as "true" or "false" - When it is extracted by
jQuery.data
, it returns string, "true" or "false. - The thing is string "false" is still a trueish value if passed directly to JS
bool
function.
So, a check using === "true"
is necessary.
@clintonb Thank you for the review! We'll schedule time from @e-kolpakov this week so he can look into your comments. |
Thanks for merging, @clintonb ! |
Background
When creating a profesional course in CAT (
/courses
view ecommerce) administrator is given option to either enable or disable "Verification" feature for that course. This setting is honored on the LMS/dashboard
view, however it is not honored on the/receipt
view.Only LMS is affected by this change.
Sandbox URL: http://pr12470.sandbox.opencraft.com/
Partner information: 3rd party-hosted open edX instance
Reviewers
Testing instructions
On sandbox
Login as a {{verified@example.com}} user and see following two receipts:
On Devstack
Prepare the enviorment:
localhost:8002/courses
, and add two courses, first one with Verification second one without it.Reproduce the issue:
Verify the fix:
asks user to verify:
Setting up PayPal
To configure paypal add section from this gist to
ecommerce/settings/private.py
. Andclient_id
andclient_secret
.I also had problems releated to PayPal forcing TLS 1.2 for all urls (including Sandbox), if you'll get errors citing: 'sslv3 alert handshake failure', you'll need to update
lib-ssl-*
,openssl-*
(and probably*curl*
) in your devstack.Settings