@@ -18,6 +18,8 @@ from decimal import Decimal
1818from santander_sdk import SantanderApiClient, SantanderClientConfiguration
1919from santander_sdk.pix import transfer_pix_payment, get_transfer
2020
21+
22+ # Setup do client
2123client = SantanderApiClient(SantanderClientConfiguration(
2224 client_id = " client_id" ,
2325 client_secret = " client_pk" ,
@@ -26,21 +28,38 @@ client = SantanderApiClient(SantanderClientConfiguration(
2628 workspace_id = " optional"
2729))
2830
29- # Realizar um PIX para uma chave
31+ # Exemplo 1 - PIX para uma chave (Telefone, email, chave aleatória, cpf ou cpnj)
3032transfer = transfer_pix_payment(
3133 client,
32- pix_info = " [email protected] " ,
# PIX key 34+ 3335 value = Decimal(0.99 ),
3436 description = " My first pix payment"
3537)
3638
37- # Obter informações de um pix realizado (SantanderTransferResponse | SantanderAPIErrorResponse)
39+ # Exemplo 2 - Transferência pix via beneficiário:
40+ benefiary = SantanderBeneficiary(
41+ name = " John Doe" ,
42+ bankCode = " 404" ,
43+ branch = " 2424" ,
44+ number = " 123456789" , # Número da conta com dígito verificador
45+ type = " CONTA_CORRENTE" ,
46+ documentType = " CPF" ,
47+ documentNumber = " 12345678909" ,
48+ )
49+
50+ transfer = transfer_pix_payment(
51+ client,
52+ benefiary,
53+ value = Decimal(0.99 ),
54+ description = " My second pix payment by beneficiary"
55+ )
56+
57+
58+ # Exemplo 3 - Consulta de um pix realizado
3859transfer = get_transfer(transfer[" id" ])
60+ assert transfer[" status" ] == " PAYED"
3961
40- status = transfer[" status" ]
4162
42- # # Em desenvolvimento
43- - Será atualizado o README
4463```
4564
4665## Funcionalidades
0 commit comments