O Webhooks é a prática de recebimento de informações de forma passiva através de uma URL http/https (Localizador padrão de recursos). Com o Webhooks da maxiPago! o recebimento será sobre status das transações.

ATENÇÃO:

A URL de recebimento das informações deve ser criada e enviada para a maxiPago! para cadastro.

A URL deve ter status 200 OK, qualquer status diferente impossibilitará o funcionamento do Webhooks.

Funcionamento

Para funcionamento do Webhooks, a URL de call-back deve ser criada e ficar online constantemente.

A maxiPago! faz o envio das informações utilizando uma comunicação http/https enviando um XML através do método POST com o Header “content-type: x-www-form-urlencoded”, portanto, a URL deve estar preparada para este tipo de requisição.

Abaixo, um modelo de XML de requisição que será enviado pela maxiPago!:

Header

Pragma: no-cache
User-agent:Java/1.7.0_79
Host:10.1.4.116:8080
Accept:text/html, image/gif, image/jpeg
Connection:keep-alive
Content-length:509

Tipos de Transações Reportadas

O Webhooks da maxiPago! envia informações para a URL cadastrada sobre os seguintes tipos de transações:

 

Body

Cartão de crédito (captura – response para Adquirente Rede)

<?xml version="1.0" encoding="UTF-8"?>
<Request>
	<transaction-event>
		<brandMessage>Success.</brandMessage>
		<brandCode>00</brandCode>
		<processorCode>00</processorCode>
		<transactionStatus>3</transactionStatus>
		<transactionType>CreditCardCapture</transactionType>
		<transactionID>520330398</transactionID>
		<tid>11182212131744289937</tid>
		<brandTid></brandTid>
		<orderID>0A0115CD:01850D44AB52:262C:156EDFB5</orderID>
		<transactionState>Captured</transactionState>
		<transactionDate>12-13-2022 17:54:46</transactionDate>
		<nsu>384248853</nsu>
		<merchantId>36xxx</merchantId>
		<referenceNumber>2022121317515887</referenceNumber>
		<transactionAmount>1</transactionAmount>
		<processorMessage>Success.</processorMessage>
	</transaction-event>
</Request>


Cartão de crédito (Captura – response para demais Adquirentes)

<?xml version="1.0" encoding="UTF-8"?>
<Request>
	<transaction-event>
		<processorCode>00</processorCode>
		<transactionStatus>3</transactionStatus>
		<transactionType>CreditCardCapture</transactionType>
		<transactionID>520330398</transactionID>
		<tid>11182212131744289937</tid>
		<brandTid></brandTid>
		<orderID>0A0115CD:01850D44AB52:262C:156EDFB5</orderID>
		<transactionState>Captured</transactionState>
		<transactionDate>12-13-2022 17:54:46</transactionDate>
		<nsu>384248853</nsu>
		<merchantId>3xxxx</merchantId>
		<referenceNumber>2022121317515887</referenceNumber>
		<transactionAmount>1</transactionAmount>
		<processorMessage>Success.</processorMessage>
	</transaction-event>
</Request>

Cartão de crédito (Declinado – response para Adquirente Rede)

<Request>
	<transaction-event>
		<brandMessage>Affiliation: Invalid parameter format.</brandMessage>
		<brandCode>25</brandCode>
		<processorCode>25</processorCode>
		<transactionStatus>7</transactionStatus>
		<transactionType>CreditCardSale</transactionType>
		<transactionID>13958523</transactionID>
		<tid></tid>
		<brandTid></brandTid>
		<orderID>0A010497:0184F87F5A52:9816:5079CE74</orderID>
		<transactionState>Declined</transactionState>
		<transactionDate>12-09-2022 17:06:46</transactionDate>
		<nsu></nsu>
		<merchantId>1xxxxx</merchantId>
		<referenceNumber>Order-202212099255</referenceNumber>
		<transactionAmount>10.00</transactionAmount>
		<processorMessage>Affiliation: Invalid parameter format.</processorMessage>
	</transaction-event>
</Request>

Cartão de crédito (Declinado – response para demais Adquirentes)

<Request>
	<transaction-event>
		<processorCode>25</processorCode>
		<transactionStatus>7</transactionStatus>
		<transactionType>CreditCardSale</transactionType>
		<transactionID>13958523</transactionID>
		<tid></tid>
		<brandTid></brandTid>
		<orderID>0A010497:0184F87F5A52:9816:5079CE74</orderID>
		<transactionState>Declined</transactionState>
		<transactionDate>12-09-2022 17:06:46</transactionDate>
		<nsu></nsu>
		<merchantId>1xxxxx</merchantId>
		<referenceNumber>Order-202212099255</referenceNumber>
		<transactionAmount>10.00</transactionAmount>
		<processorMessage>Affiliation: Invalid parameter format.</processorMessage>
	</transaction-event>
</Request>

Cartão de crédito (Cancelamento)

<?xml version="1.0" encoding="UTF-8"?>
<transaction-response>
	<authCode/>
	<orderID/>
	<referenceNum>4040764123</referenceNum>
	<transactionID>460312421</transactionID>
	<transactionTimestamp/>
	<responseCode>0</responseCode>
	<responseMessage>VOIDED</responseMessage>
	<avsResponseCode/>
	<cvvResponseCode/>
	<processorCode>173</processorCode>
	<processorMessage>Authorization expired.</processorMessage>
	<processorName>REDE</processorName>
	<errorMessage/>
	<creditCardScheme>Visa</creditCardScheme>
</transaction-response>

Boleto Bancário (visualizado)

xml=
<?xml version="1.0" encoding="UTF-8"?>
<Request>
    <transaction-event>
        <transactionStatus>34</transactionStatus>
        <transactionType>30</transactionType>
        <transactionID>501043</transactionID>
        <orderID>7F000101:015DF791E89B:C66D:79BA05A3</orderID>
        <transactionState>Viewed</transactionState>
        <transactionDate>08-19-2017 00:56:27</transactionDate>
        <merchantId>1xxx1</merchantId>
        <transactionAmount>24.00</transactionAmount>
        <referenceNumber>20200001</referenceNumber>
    </transaction-event>

Boleto Bancário (pago)

undefined</Request>
xml=undefined<?xml version="1.0" encoding="UTF-8"?>undefined<Request>
<transaction-event>
    <transactionStatus>10</transactionStatus>
    <transactionType>30</transactionType>
    <transactionID>501043</transactionID>
    <orderID>7F000101:015DF791E89B:C66D:79BA05A3</orderID>
    <transactionState>Settled</transactionState>
    <transactionDate>08-19-2017 00:56:27</transactionDate>
    <merchantId>1xxx</merchantId>
    <transactionAmount>24.00</transactionAmount>
    <referenceNumber>20200001</referenceNumber>
</transaction-event>

Recorrência (operação acatada)

xml=<?xml version="1.0" encoding="UTF-8"?>
<Request>
    <transaction-event>
        <transactionStatus>3</transactionStatus>
        <transactionType>CreditCardSale</transactionType>
        <transactionID>501043</transactionID>
        <tid>1006993069000AC96D2A</tid>
        <orderID>7F000101:015DF791E89B:C66D:79BA05A3</orderID>
        <transactionState>Captured</transactionState>
        <transactionDate>08-19-2017 00:56:27</transactionDate>
        <nsu>310802</nsu>
        <merchantId>1xxx</merchantId>
        <transactionAmount>24.00</transactionAmount>
        <recurringFlag>Y</recurringFlag>
        <referenceNumber>20200001</referenceNumber>
    </transaction-event>

Recorrência (operação declinada)

xml=<?xml version="1.0" encoding="UTF-8"?>
<Request>
    <transaction-event>
        <transactionStatus>7</transactionStatus>
        <transactionType>CreditCardSale</transactionType>
        <transactionID>501043</transactionID>
        <tid>1006993069000AC96D2A</tid>
        <orderID>7F000101:015DF791E89B:C66D:79BA05A3</orderID>
        <transactionState>Declined</transactionState>
        <transactionDate>08-19-2017 00:56:27</transactionDate>
        <nsu>310802</nsu>
        <merchantId>1xxxx</merchantId>
        <transactionAmount>24.00</transactionAmount>
        <recurringFlag>Y</recurringFlag>
        <referenceNumber>20200001</referenceNumber>
    </transaction-event>
</Request>

Fraude (aprovada)

xml=<?xml version="1.0" encoding="UTF-8"?>
<Request>
    <transaction-event>
        <transactionStatus>44</transactionStatus>
        <transactionType>CreditCardSale</transactionType>
        <transactionID>501043</transactionID>
        <tid>1006993069000AC96D2A</tid>
        <orderID>7F000101:015DF791E89B:C66D:79BA05A3</orderID>
        <transactionState>Fraud Approved</transactionState>
        <transactionDate>08-19-2017 00:56:27</transactionDate>
        <nsu>310802</nsu>
        <merchantId>1xxxx</merchantId>
        <transactionAmount>24.00</transactionAmount>
        <referenceNumber>20200001</referenceNumber>
    </transaction-event>

Fraude (declinada)

<Request>
    <transaction-event>
        <transactionStatus>45</transactionStatus>
        <transactionType>CreditCardSale</transactionType>
        <transactionID>501043</transactionID>
        <tid>1006993069000AC96D2A</tid>
        <orderID>7F000101:015DF791E89B:C66D:79BA05A3</orderID>
        <transactionState>Fraud Declined</transactionState>
        <transactionDate>08-19-2017 00:56:27</transactionDate>
        <nsu>310802</nsu>
        <merchantId>1xxxx</merchantId>
        <transactionAmount>24.00</transactionAmount>
        <referenceNumber>20200001</referenceNumber>
    </transaction-event>
</Request>

Pix

xml=<?xml version="1.0" encoding="UTF-8"?>
<Request>
    <transaction-event>
        <transactionStatus>3</transactionStatus>
        <transactionType>PixSale</transactionType>
        <orderID>0A01049C:017D4824A517:6280:5556432E</orderID>
        <transactionState>Captured</transactionState>
        <transactionDate>08-19-2017 00:56:27</transactionDate>        
        <merchantId>1xxxx</merchantId>
        <transactionAmount>24.00</transactionAmount>
        <referenceNumber>20200001</referenceNumber>
    </transaction-event>
</Request>

Tabela de Parâmetros Enviados: