-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathsample-payment.py
54 lines (46 loc) · 1.22 KB
/
sample-payment.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# coding: utf-8
from febraban.cnab240.user import User, UserAddress, UserBank
from febraban.cnab240.v83.file.file import FileV83
from febraban.cnab240.v83.payment.payment import PaymentV83
sender = User(
name="YOUR COMPANY NAME HERE",
identifier="12345678901234",
bank=UserBank(
bankId="341",
branchCode="4321",
accountNumber="12345678",
accountVerifier="9"
),
address=UserAddress(
streetName="AV PAULISTA",
number="1000",
city="SAO PAULO",
state="SP",
zipcode="01310000"
)
)
receiver = User(
name="RECEIVER NAME HERE",
identifier="12345678901",
bank=UserBank(
bankId="033",
branchCode="1234",
accountNumber="123456",
accountVerifier="7"
)
)
file = FileV83()
file.setSender(sender)
payment = PaymentV83()
payment.setSender(sender)
payment.setReceiver(receiver)
payment.setAmountInCents("12000")
payment.setScheduleDate("12102017")
payment.setInfo(
kind="98", #Tipo de pagamento - Diversos
method="41", #TED - Outra titularidade
reason="10" #Crédito em Conta Corrente
)
payment.setIdentifier("ID1234567890")
file.add(lot=payment)
file.output(fileName="output.REM", path="/../../")