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
ea7cf3a2
Commit
ea7cf3a2
authored
Aug 07, 2013
by
Jason Bau
Committed by
Diana Huang
Aug 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add parameterization of cybersource creds
parent
4d81383e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
25 deletions
+41
-25
lms/djangoapps/shoppingcart/views.py
+5
-4
lms/envs/aws.py
+2
-0
lms/envs/common.py
+8
-0
lms/templates/shoppingcart/list.html
+26
-21
No files found.
lms/djangoapps/shoppingcart/views.py
View file @
ea7cf3a2
...
...
@@ -5,6 +5,7 @@ import hmac
import
binascii
from
hashlib
import
sha1
from
django.conf
import
settings
from
collections
import
OrderedDict
from
django.http
import
HttpResponse
from
django.contrib.auth.decorators
import
login_required
...
...
@@ -71,10 +72,10 @@ def cybersource_sign(params):
params needs to be an ordered dict, b/c cybersource documentation states that order is important.
Reverse engineered from PHP version provided by cybersource
"""
shared_secret
=
"ELIDED"
merchant_id
=
"ELIDED"
serial_number
=
"ELIDED"
orderPage_version
=
"7"
shared_secret
=
settings
.
CYBERSOURCE
.
get
(
'SHARED_SECRET'
,
''
)
merchant_id
=
settings
.
CYBERSOURCE
.
get
(
'MERCHANT_ID'
,
''
)
serial_number
=
settings
.
CYBERSOURCE
.
get
(
'SERIAL_NUMBER'
,
''
)
orderPage_version
=
settings
.
CYBERSOURCE
.
get
(
'ORDERPAGE_VERSION'
,
'7'
)
params
[
'merchantID'
]
=
merchant_id
params
[
'orderPage_timestamp'
]
=
int
(
time
.
time
()
*
1000
)
params
[
'orderPage_version'
]
=
orderPage_version
...
...
lms/envs/aws.py
View file @
ea7cf3a2
...
...
@@ -191,6 +191,8 @@ if SEGMENT_IO_LMS_KEY:
MITX_FEATURES
[
'SEGMENT_IO_LMS'
]
=
ENV_TOKENS
.
get
(
'SEGMENT_IO_LMS'
,
False
)
CYBERSOURCE
=
AUTH_TOKENS
.
get
(
'CYBERSOURCE'
,
CYBERSOURCE
)
SECRET_KEY
=
AUTH_TOKENS
[
'SECRET_KEY'
]
AWS_ACCESS_KEY_ID
=
AUTH_TOKENS
[
"AWS_ACCESS_KEY_ID"
]
...
...
lms/envs/common.py
View file @
ea7cf3a2
...
...
@@ -431,6 +431,14 @@ ZENDESK_URL = None
ZENDESK_USER
=
None
ZENDESK_API_KEY
=
None
##### CyberSource Payment parameters #####
CYBERSOURCE
=
{
'SHARED_SECRET'
:
''
,
'MERCHANT_ID'
:
''
,
'SERIAL_NUMBER'
:
''
,
'ORDERPAGE_VERSION'
:
'7'
,
}
################################# open ended grading config #####################
#By setting up the default settings with an incorrect user name and password,
...
...
lms/templates/shoppingcart/list.html
View file @
ea7cf3a2
...
...
@@ -7,27 +7,32 @@
<
%
block
name=
"title"
><title>
${_("Your Shopping Cart")}
</title></
%
block>
<section
class=
"container cart-list"
>
<table>
<thead>
<tr><td>
Qty
</td><td>
Description
</td><td>
Unit Price
</td><td>
Price
</td></tr>
</thead>
<tbody>
% for idx,item in enumerate(shoppingcart_items):
<tr><td>
${item.qty}
</td><td>
${item.line_desc}
</td><td>
${item.unit_cost}
</td><td>
${item.line_cost}
</td>
<td><a
data-item-idx=
"${idx}"
class=
'remove_line_item'
href=
'#'
>
[x]
</a></td></tr>
% endfor
<tr><td></td><td></td><td></td><td>
Total Cost
</td></tr>
<tr><td></td><td></td><td></td><td>
${total_cost}
</td></tr>
</tbody>
</table>
<form
action=
"https://orderpagetest.ic3.com/hop/orderform.jsp"
method=
"post"
>
% for pk, pv in params.iteritems():
<input
type=
"hidden"
name=
"${pk}"
value=
"${pv}"
/>
% endfor
<input
type=
"submit"
value=
"Check Out"
/>
</form>
% if shoppingcart_items:
<table>
<thead>
<tr><td>
Qty
</td><td>
Description
</td><td>
Unit Price
</td><td>
Price
</td></tr>
</thead>
<tbody>
% for idx,item in enumerate(shoppingcart_items):
<tr><td>
${item.qty}
</td><td>
${item.line_desc}
</td><td>
${item.unit_cost}
</td><td>
${item.line_cost}
</td>
<td><a
data-item-idx=
"${idx}"
class=
'remove_line_item'
href=
'#'
>
[x]
</a></td></tr>
% endfor
<tr><td></td><td></td><td></td><td>
Total Cost
</td></tr>
<tr><td></td><td></td><td></td><td>
${total_cost}
</td></tr>
</tbody>
</table>
<form
action=
"https://orderpagetest.ic3.com/hop/orderform.jsp"
method=
"post"
>
% for pk, pv in params.iteritems():
<input
type=
"hidden"
name=
"${pk}"
value=
"${pv}"
/>
% endfor
<input
type=
"submit"
value=
"Check Out"
/>
</form>
% else:
<p>
You have selected no items for purchase.
</p>
% endif
</section>
...
...
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