@@ -87,15 +87,27 @@ def test_transfer_pix_payment_success(mock_api, client_instance):
8787 assert mock_create .call_count == 1
8888 assert mock_confirm .call_count == 1
8989 assert mock_status .call_count == 1
90- request_body = mock_create .calls [0 ].request .body
91- assert request_body is not None
92- assert json .loads (request_body ) == {
93- "tags" : ["teste" ],
94- "paymentValue" : "100.00" ,
95- "remittanceInformation" : description ,
96- "dictCode" : pix_key ,
97- "dictCodeType" : "CPF" ,
90+
91+ create_payment_request = mock_create .calls [0 ].request .body
92+ assert create_payment_request is not None
93+ assert json .loads (create_payment_request ) == {
94+ 'dictCode' : '12345678909' ,
95+ 'dictCodeType' : 'CPF' ,
96+ 'paymentValue' : '100.00' ,
97+ 'remittanceInformation' : 'Pagamento Teste' ,
98+ 'tags' : [
99+ 'teste' ,
100+ ],
98101 }
102+
103+ confirm_payment_request_body = mock_confirm .calls [0 ].request .body
104+ confirm_payment_request_url = mock_confirm .calls [0 ].request .url
105+ assert confirm_payment_request_body is not None
106+ assert json .loads (confirm_payment_request_body ) == {
107+ 'paymentValue' : '100.00' ,
108+ 'status' : 'AUTHORIZED' ,
109+ }
110+ assert confirm_payment_request_url == f"https://trust-sandbox.api.santander.com.br/management_payments_partners/v1/workspaces/8e33d56c-204f-461e-aebe-08baaab6479e/pix_payments/12345"
99111
100112
101113def test_transfer_pix_payment_timeout_create (
@@ -251,6 +263,24 @@ def test_transfer_pix_payment_with_beneficiary(
251263 transfer_result = transfer_pix (
252264 client_instance , santander_beneciary_john , value , description
253265 )
266+
267+ transfer_request = mock_create .calls [0 ].request .body
268+ assert transfer_request is not None
269+ assert json .loads (transfer_request ) == {
270+ 'beneficiary' : {
271+ 'bankCode' : '404' ,
272+ 'branch' : '2424' ,
273+ 'documentNumber' : '12345678909' ,
274+ 'documentType' : 'CPF' ,
275+ 'name' : 'John Doe' ,
276+ 'number' : '123456789' ,
277+ 'type' : 'CONTA_CORRENTE' ,
278+ },
279+ 'paymentValue' : '59.99' ,
280+ 'remittanceInformation' : 'Pagamento Teste' ,
281+ 'tags' : [],
282+ }
283+
254284 assert transfer_result == {
255285 "success" : True ,
256286 "data" : {
@@ -287,6 +317,14 @@ def test_transfer_pix_payment_with_beneficiary(
287317 assert mock_create .call_count == 1
288318 assert mock_status .call_count == 1
289319 assert mock_confirm .call_count == 1
320+ confirm_payment_request_body = mock_confirm .calls [0 ].request .body
321+ confirm_payment_request_url = mock_confirm .calls [0 ].request .url
322+ assert confirm_payment_request_body is not None
323+ assert json .loads (confirm_payment_request_body ) == {
324+ 'paymentValue' : '59.99' ,
325+ 'status' : 'AUTHORIZED' ,
326+ }
327+ assert confirm_payment_request_url == "https://trust-sandbox.api.santander.com.br/management_payments_partners/v1/workspaces/8e33d56c-204f-461e-aebe-08baaab6479e/pix_payments/ASF5Q7Q879WQ"
290328
291329
292330def test_transfer_pix_payment_lazy_status_update (
0 commit comments