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
03490908
Commit
03490908
authored
Jun 10, 2015
by
Renzo Lucioni
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8456 from edx/renzo/payment-button-ui
Payment button UI modifications
parents
2374685d
d6c04604
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
7 deletions
+19
-7
lms/static/js/spec/verify_student/make_payment_step_view_spec.js
+8
-4
lms/static/js/verify_student/views/make_payment_step_view.js
+7
-3
lms/static/sass/_developer.scss
+4
-0
No files found.
lms/static/js/spec/verify_student/make_payment_step_view_spec.js
View file @
03490908
...
...
@@ -103,11 +103,15 @@ define([
expect
(
$el
.
length
).
toEqual
(
_
.
size
(
buttons
));
_
.
each
(
buttons
,
function
(
expectedText
,
expectedId
)
{
var
buttonEl
=
$
(
'#'
+
expectedId
);
buttonEl
.
removeAttr
(
'disabled'
);
expect
(
buttonEl
.
length
).
toEqual
(
1
);
expect
(
buttonEl
[
0
]
).
toHaveClass
(
'payment-button'
);
expect
(
buttonEl
[
0
]
).
toHaveText
(
expectedText
);
buttonEl
[
0
].
click
();
expect
(
buttonEl
[
0
]
).
toHaveClass
(
'is-selected'
);
expectPaymentButtonEnabled
(
false
);
expect
(
requests
[
requests
.
length
-
1
].
requestBody
.
split
(
'&'
)).
toContain
(
'processor='
+
expectedId
);
});
};
...
...
@@ -136,15 +140,15 @@ define([
it
(
'provides working payment buttons for a single processor'
,
function
()
{
createView
({
processors
:
[
'cybersource'
]});
checkPaymentButtons
(
AjaxHelpers
.
requests
(
this
),
{
cybersource
:
"
Pay with Credit Card
"
});
checkPaymentButtons
(
AjaxHelpers
.
requests
(
this
),
{
cybersource
:
"
Checkout
"
});
});
it
(
'provides working payment buttons for multiple processors'
,
function
()
{
createView
({
processors
:
[
'cybersource'
,
'paypal'
,
'other'
]});
checkPaymentButtons
(
AjaxHelpers
.
requests
(
this
),
{
cybersource
:
"
Pay with Credit Card
"
,
paypal
:
"
Pay
with PayPal"
,
other
:
"
Pay
with other"
cybersource
:
"
Checkout
"
,
paypal
:
"
Checkout
with PayPal"
,
other
:
"
Checkout
with other"
});
});
...
...
lms/static/js/verify_student/views/make_payment_step_view.js
View file @
03490908
...
...
@@ -45,13 +45,13 @@ var edx = edx || {};
_getPaymentButtonText
:
function
(
processorName
)
{
if
(
processorName
.
toLowerCase
().
substr
(
0
,
11
)
==
'cybersource'
)
{
return
gettext
(
'
Pay with Credit Card
'
);
return
gettext
(
'
Checkout
'
);
}
else
if
(
processorName
.
toLowerCase
()
==
'paypal'
)
{
return
gettext
(
'
Pay
with PayPal'
);
return
gettext
(
'
Checkout
with PayPal'
);
}
else
{
// This is mainly for testing as no other processors are supported right now.
// Translators: 'processor' is the name of a third-party payment processing vendor (example: "PayPal")
return
interpolate_text
(
gettext
(
'
Pay
with {processor}'
),
{
processor
:
processorName
});
return
interpolate_text
(
gettext
(
'
Checkout
with {processor}'
),
{
processor
:
processorName
});
}
},
...
...
@@ -134,6 +134,8 @@ var edx = edx || {};
// Disable the payment button to prevent multiple submissions
this
.
setPaymentEnabled
(
false
);
$
(
event
.
target
).
toggleClass
(
'is-selected'
);
// Create the order for the amount
$
.
ajax
({
url
:
'/verify_student/create_order/'
,
...
...
@@ -194,6 +196,8 @@ var edx = edx || {};
// Re-enable the button so the user can re-try
this
.
setPaymentEnabled
(
true
);
$
(
'.payment-button'
).
toggleClass
(
'is-selected'
,
false
);
},
getPaymentAmount
:
function
()
{
...
...
lms/static/sass/_developer.scss
View file @
03490908
...
...
@@ -67,6 +67,10 @@
.payment-button
{
float
:
right
;
@include
margin-left
(
(
$baseline
/
2
)
);
&
.is-selected
{
background
:
$m-blue-d3
!
important
;
}
}
}
...
...
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