witten
/
luminotes
Archived
1
0
Fork 0

If the item number is blank, ignore the transaction.

This commit is contained in:
Dan Helfman 2008-09-01 19:18:05 -07:00
parent 569fd9b070
commit 6bbe32bfff
2 changed files with 10 additions and 1 deletions

View File

@ -1284,7 +1284,7 @@ class Users( object ):
# verify item_number
plan_index = params.get( u"item_number" )
if plan_index == None:
if plan_index == None or plan_index == u"":
return dict() # ignore this transaction if there's no item number
try:

View File

@ -2725,6 +2725,15 @@ class Test_users( Test_controller ):
assert len( result ) == 1
assert result.get( u"session_id" )
def test_paypal_notify_payment_blank_item_number( self ):
data = dict( self.PAYMENT_DATA )
data[ u"custom" ] = self.user.object_id
data[ u"item_number" ] = u""
result = self.http_post( "/users/paypal_notify", data );
assert len( result ) == 1
assert result.get( u"session_id" )
def test_paypal_notify_payment_incorrect_gross( self ):
data = dict( self.PAYMENT_DATA )
data[ u"custom" ] = self.user.object_id