Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ecommerce
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
ecommerce
Commits
7c3e57b6
Commit
7c3e57b6
authored
Nov 14, 2016
by
Clinton Blackburn
Committed by
Clinton Blackburn
Nov 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed unused method from CyberSource payment processor
SOL-2125
parent
18743016
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
61 deletions
+0
-61
ecommerce/extensions/payment/processors/cybersource.py
+0
-19
ecommerce/extensions/payment/tests/processors/test_cybersource.py
+0
-42
No files found.
ecommerce/extensions/payment/processors/cybersource.py
View file @
7c3e57b6
...
...
@@ -194,25 +194,6 @@ class Cybersource(BasePaymentProcessor):
return
parameters
@staticmethod
def
get_single_seat
(
basket
):
"""
Return the first product encountered in the basket with the product
class of 'seat'. Return None if no such products were found.
"""
try
:
seat_class
=
ProductClass
.
objects
.
get
(
slug
=
'seat'
)
except
ProductClass
.
DoesNotExist
:
# this occurs in test configurations where the seat product class is not in use
return
None
for
line
in
basket
.
lines
.
all
():
product
=
line
.
product
if
product
.
get_product_class
()
==
seat_class
:
return
product
return
None
def
handle_processor_response
(
self
,
response
,
basket
=
None
):
"""
Handle a response (i.e., "merchant notification") from CyberSource.
...
...
ecommerce/extensions/payment/tests/processors/test_cybersource.py
View file @
7c3e57b6
...
...
@@ -13,7 +13,6 @@ from django.test import override_settings
from
freezegun
import
freeze_time
from
oscar.apps.payment.exceptions
import
UserCancelled
,
TransactionDeclined
,
GatewayError
from
oscar.core.loading
import
get_model
from
oscar.test
import
factories
from
ecommerce.extensions.payment.exceptions
import
(
InvalidSignatureError
,
InvalidCybersourceDecision
,
PartialAuthorizationError
,
PCIViolation
,
...
...
@@ -191,47 +190,6 @@ class CybersourceTests(CybersourceMixin, PaymentProcessorTestCaseMixin, TestCase
self
.
assertRaises
(
PartialAuthorizationError
,
self
.
processor
.
handle_processor_response
,
response
,
basket
=
self
.
basket
)
def
test_get_single_seat
(
self
):
"""
The single-seat helper for cybersource reporting should correctly
and return the first 'seat' product encountered in a basket.
"""
get_single_seat
=
Cybersource
.
get_single_seat
# finds the seat when it's the only product in the basket.
self
.
assertEqual
(
get_single_seat
(
self
.
basket
),
self
.
product
)
# finds the first seat added, when there's more than one.
basket
=
factories
.
create_basket
(
empty
=
True
)
other_seat
=
factories
.
ProductFactory
(
product_class
=
self
.
seat_product_class
,
stockrecords__price_currency
=
'USD'
,
stockrecords__partner__short_code
=
'test'
,
)
basket
.
add_product
(
self
.
product
)
basket
.
add_product
(
other_seat
)
self
.
assertEqual
(
get_single_seat
(
basket
),
self
.
product
)
# finds the seat when there's a mixture of product classes.
basket
=
factories
.
create_basket
(
empty
=
True
)
other_product
=
factories
.
ProductFactory
(
stockrecords__price_currency
=
'USD'
,
stockrecords__partner__short_code
=
'test2'
,
)
basket
.
add_product
(
other_product
)
basket
.
add_product
(
self
.
product
)
self
.
assertEqual
(
get_single_seat
(
basket
),
self
.
product
)
self
.
assertNotEqual
(
get_single_seat
(
basket
),
other_product
)
# returns None when there's no seats.
basket
=
factories
.
create_basket
(
empty
=
True
)
basket
.
add_product
(
other_product
)
self
.
assertIsNone
(
get_single_seat
(
basket
))
# returns None for an empty basket.
basket
=
factories
.
create_basket
(
empty
=
True
)
self
.
assertIsNone
(
get_single_seat
(
basket
))
@httpretty.activate
def
test_issue_credit
(
self
):
"""
...
...
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