@@ -2587,6 +2587,7 @@ def test_sale_with_line_items_validation_error_too_many_live_items(self):
25872587 result .errors .for_object ("transaction" ).on ("line_items" )[0 ].code
25882588 )
25892589
2590+ @unittest .skip ("Flaky test" )
25902591 def test_sale_with_debit_network (self ):
25912592 result = Transaction .sale ({
25922593
@@ -3932,12 +3933,12 @@ def test_refund_returns_an_error_if_unsettled(self):
39323933 result .errors .for_object ("transaction" ).on ("base" )[0 ].code
39333934 )
39343935
3935- def test_refund_returns_an_error_if_soft_declined (self ):
3936+ def test_refund_returns_an_success_with_error_in_processor_response_if_soft_declined (self ):
39363937 transaction = Transaction .sale ({
39373938 "amount" : Decimal ("9000.00" ),
39383939 "credit_card" : {
39393940 "number" : "4111111111111111" ,
3940- "expiration_date" : "05/2009 "
3941+ "expiration_date" : "05/2008 "
39413942 },
39423943 "options" : {
39433944 "submit_for_settlement" : True
@@ -3948,31 +3949,32 @@ def test_refund_returns_an_error_if_soft_declined(self):
39483949 result = Transaction .refund (transaction .id , Decimal ("2046.00" ))
39493950 refund = result .transaction
39503951
3951- self .assertFalse (result .is_success )
3952- self .assertEqual (Transaction .Status .ProcessorDeclined , refund .status )
3953- self .assertEqual (ProcessorResponseTypes .SoftDeclined , refund .processor_response_type )
3952+ self .assertTrue (result .is_success )
3953+ self .assertEqual (Transaction .Status .SubmittedForSettlement , refund .status )
3954+ self .assertEqual (ProcessorResponseTypes .Approved , refund .processor_response_type )
39543955 self .assertEqual ("2046 : Declined" , refund .additional_processor_response )
39553956
39563957 def test_refund_returns_an_error_if_hard_declined (self ):
39573958 transaction = Transaction .sale ({
39583959 "amount" : Decimal ("9000.00" ),
39593960 "credit_card" : {
39603961 "number" : "4111111111111111" ,
3961- "expiration_date" : "05/2009 "
3962+ "expiration_date" : "05/2008 "
39623963 },
39633964 "options" : {
39643965 "submit_for_settlement" : True
39653966 }
39663967 }).transaction
39673968 TestHelper .settle_transaction (transaction .id )
39683969
3969- result = Transaction .refund (transaction .id , Decimal ("2009.00" ))
3970+ result = Transaction .refund (transaction .id , Decimal ("2004.00" ))
3971+ result = Transaction .refund (transaction .id , Decimal ("2004.00" ))
39703972 refund = result .transaction
39713973
39723974 self .assertFalse (result .is_success )
39733975 self .assertEqual (Transaction .Status .ProcessorDeclined , refund .status )
39743976 self .assertEqual (ProcessorResponseTypes .HardDeclined , refund .processor_response_type )
3975- self .assertEqual ("2009 : No Such Issuer " , refund .additional_processor_response )
3977+ self .assertEqual ("2004 : Expired Card " , refund .additional_processor_response )
39763978
39773979 @staticmethod
39783980 def __create_transaction_to_refund ():
0 commit comments