File tree 1 file changed +60
-0
lines changed
1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change
1
+ # coding: utf-8
2
+
3
+ from datetime import datetime
4
+ from febraban .cnab240 .itau .charge import Slip , File
5
+ from febraban .cnab240 .user import User , UserAddress , UserBank
6
+
7
+
8
+ myself = User (
9
+ name = "YOUR COMPANY NAME" ,
10
+ identifier = "123456789012345" ,
11
+ bank = UserBank (
12
+ bankId = "341" ,
13
+ branchCode = "1234" ,
14
+ accountNumber = "33333" ,
15
+ accountVerifier = "4" ,
16
+ bankName = "BANCO ITAU SA"
17
+ ),
18
+ address = UserAddress (
19
+ streetLine1 = "AV PAULISTA 1000" ,
20
+ streetLine2 = "CJ 601" ,
21
+ city = "SAO PAULO" ,
22
+ stateCode = "SP" ,
23
+ zipCode = "01310000"
24
+ )
25
+ )
26
+
27
+ payer = User (
28
+ name = "PAYER NAME" ,
29
+ identifier = "12345678901" ,
30
+ address = UserAddress (
31
+ streetLine1 = "AV PAULISTA 1000" ,
32
+ district = "BELA VISTA" ,
33
+ city = "SAO PAULO" ,
34
+ stateCode = "SP" ,
35
+ zipCode = "01310000"
36
+ )
37
+ )
38
+ now = datetime .now ()
39
+
40
+ file = File ()
41
+ file .setSender (myself )
42
+ file .setIssueDate (now )
43
+
44
+ slip = Slip ()
45
+ slip .setSender (myself )
46
+ slip .setAmountInCents ("2000" )
47
+ slip .setPayer (payer )
48
+ slip .setExpirationDate (datetime (day = 01 , month = 07 , year = 2019 ))
49
+ slip .setBankIdentifier (
50
+ identifier = "1" ,
51
+ branch = myself .bank .branchCode ,
52
+ accountNumber = myself .bank .accountNumber ,
53
+ wallet = "109"
54
+ )
55
+ slip .setIdentifier ("ID456" )
56
+ slip .setCancel ()
57
+
58
+ file .add (register = slip )
59
+
60
+ file .output (fileName = "output.REM" , path = "/../../" )
You can’t perform that action at this time.
0 commit comments