@@ -476,7 +476,6 @@ def test_dispute(self):
476
476
self .assertEqual (dispute .reason , 'fraud' )
477
477
self .assertEqual (dispute .transaction .id , debit .id )
478
478
479
-
480
479
def test_external_accounts (self ):
481
480
external_account = balanced .ExternalAccount (
482
481
token = '123123123' ,
@@ -505,7 +504,7 @@ def test_get_none_for_none(self):
505
504
self .assertIsNotNone (card .customer )
506
505
self .assertTrue (isinstance (card .customer , balanced .Customer ))
507
506
508
- def test_accounts_transfer (self ):
507
+ def test_accounts_credit (self ):
509
508
merchant = balanced .Customer ().save ()
510
509
order = merchant .create_order ()
511
510
card = balanced .Card (** INTERNATIONAL_CARD ).save ()
@@ -521,7 +520,7 @@ def test_accounts_transfer(self):
521
520
self .assertEqual (payable_account .balance , 1234 )
522
521
self .assertEqual (account_credit .appears_on_statement_as , 'Payout' )
523
522
524
- def test_accounts_transfer_from_multiple_orders (self ):
523
+ def test_accounts_credit_from_multiple_orders (self ):
525
524
merchant = balanced .Customer ().save ()
526
525
card = balanced .Card (** INTERNATIONAL_CARD ).save ()
527
526
payable_account = merchant .payable_account
@@ -530,14 +529,12 @@ def test_accounts_transfer_from_multiple_orders(self):
530
529
531
530
order_one = merchant .create_order ()
532
531
order_one .debit_from (source = card , amount = amount )
533
- account_credit_one = payable_account .credit (amount = amount ,
534
- order = order_one .href )
532
+ payable_account .credit (amount = amount , order = order_one .href )
535
533
payable_account = merchant .payable_account
536
534
self .assertEqual (payable_account .balance , amount )
537
535
order_two = merchant .create_order ()
538
536
order_two .debit_from (source = card , amount = amount )
539
- account_credit_two = payable_account .credit (amount = amount ,
540
- order = order_two .href )
537
+ payable_account .credit (amount = amount , order = order_two .href )
541
538
payable_account = merchant .payable_account
542
539
self .assertEqual (payable_account .balance , amount * 2 )
543
540
@@ -548,7 +545,7 @@ def test_settlement(self):
548
545
549
546
order .debit_from (source = card , amount = 1234 )
550
547
payable_account = merchant .payable_account
551
- account_credit = payable_account .credit (
548
+ payable_account .credit (
552
549
amount = 1234 , order = order .href , appears_on_statement_as = 'Payout' )
553
550
payable_account = merchant .payable_account
554
551
self .assertEqual (payable_account .balance , 1234 )
@@ -564,21 +561,22 @@ def test_settlement(self):
564
561
appears_on_statement_as = "Settlement Oct" ,
565
562
description = "Settlement for payouts from October" )
566
563
self .assertEqual (settlement .amount , 1234 )
567
- self .assertEqual (settlement .appears_on_statement_as , "BAL*Settlement Oct" )
564
+ self .assertEqual (settlement .appears_on_statement_as ,
565
+ "BAL*Settlement Oct" )
568
566
self .assertEqual (settlement .description ,
569
567
"Settlement for payouts from October" )
570
568
payable_account = merchant .payable_account
571
569
self .assertEqual (payable_account .balance , 0 )
572
570
573
- def test_reverse_settlement (self ):
571
+ def test_settle_reverse_account_credit (self ):
574
572
merchant = balanced .Customer ().save ()
575
573
order = merchant .create_order ()
576
574
card = balanced .Card (** INTERNATIONAL_CARD ).save ()
577
575
578
576
order .debit_from (source = card , amount = 1234 )
579
577
payable_account = merchant .payable_account
580
- account_credit = payable_account .credit (amount = 1234 , order = order . href ,
581
- appears_on_statement_as = 'Payout' )
578
+ account_credit = payable_account .credit (
579
+ amount = 1234 , order = order . href , appears_on_statement_as = 'Payout' )
582
580
payable_account = merchant .payable_account
583
581
self .assertEqual (payable_account .balance , 1234 )
584
582
@@ -589,7 +587,7 @@ def test_reverse_settlement(self):
589
587
).save ()
590
588
bank_account .associate_to_customer (merchant )
591
589
592
- settlement = payable_account .settle (
590
+ payable_account .settle (
593
591
funding_instrument = bank_account .href ,
594
592
appears_on_statement_as = "Settlement Oct" ,
595
593
description = "Settlement for payouts from October" )
@@ -598,8 +596,7 @@ def test_reverse_settlement(self):
598
596
599
597
order_two = merchant .create_order ()
600
598
order_two .debit_from (source = card , amount = 1234 )
601
- account_credit_two = payable_account .credit (amount = 1234 ,
602
- order = order_two .href )
599
+ payable_account .credit (amount = 1234 , order = order_two .href )
603
600
604
601
payable_account = merchant .payable_account
605
602
self .assertEqual (payable_account .balance , 1234 )
@@ -608,23 +605,23 @@ def test_reverse_settlement(self):
608
605
payable_account = merchant .payable_account
609
606
self .assertEqual (payable_account .balance , 0 )
610
607
611
- def test_reverse_settlement_with_negative_account_balance (self ):
608
+ def test_settle_account_negative_balance (self ):
612
609
merchant = balanced .Customer ().save ()
613
610
order = merchant .create_order ()
614
611
card = balanced .Card (** INTERNATIONAL_CARD ).save ()
615
612
616
613
order .debit_from (source = card , amount = 1234 )
617
614
payable_account = merchant .payable_account
618
- account_credit = payable_account .credit (amount = 1234 , order = order . href ,
619
- appears_on_statement_as = 'Payout' )
615
+ account_credit = payable_account .credit (
616
+ amount = 1234 , order = order . href , appears_on_statement_as = 'Payout' )
620
617
bank_account = balanced .BankAccount (
621
618
account_number = '1234567890' ,
622
619
routing_number = '321174851' ,
623
620
name = 'Someone' ,
624
621
).save ()
625
622
bank_account .associate_to_customer (merchant )
626
623
627
- settlement = payable_account .settle (
624
+ payable_account .settle (
628
625
funding_instrument = bank_account .href ,
629
626
appears_on_statement_as = "Settlement Oct" ,
630
627
description = "Settlement for payouts from October" )
@@ -635,7 +632,7 @@ def test_reverse_settlement_with_negative_account_balance(self):
635
632
payable_account = merchant .payable_account
636
633
self .assertEqual (payable_account .balance , - 1234 )
637
634
638
- settlement = payable_account .settle (
635
+ payable_account .settle (
639
636
funding_instrument = bank_account .href ,
640
637
appears_on_statement_as = "Settlement Oct" ,
641
638
description = "Settlement for payouts from October" )
0 commit comments