These docs are for v1.0. Click to read the latest docs for v4.1.

3. Processando o Checkout

Checkout Transparente

Agora você poderá efetuar chamadas aos meios de pagamento que o Checkout Transparente oferece. Conheça cada um deles abaixo:

3.1. Boleto
3.2. Débito Online
3.3. Cartão de Crédito

As chamadas para os meios de pagamento do Checkout Transparente deverão ser efetuadas para o endpoint abaixo utilizando o método POST:

POST https://ws.pagseguro.uol.com.br/v2/transactions?{{credenciais}}
POST https://ws.sandbox.pagseguro.uol.com.br/v2/transactions?{{credenciais}}

Header

x-www-form-urlencoded
Content-Type: application/x-www-form-urlencoded; charset=ISO-8859-1
XML
Content-Type: application/xml; charset=ISO-8859-1

📘

Caso sua aplicação não utilize o conjunto de caracteres ISO-8859-1, p.e.(UTF-8), é necessário substituir o parâmetro charset do exemplo acima.

3.1. Exemplo de Checkout com Boleto

paymentMode=default
&paymentMethod=boleto
&[email protected]
&currency=BRL
&extraAmount=1.00
&itemId1=0001
&itemDescription1=Notebook Prata
&itemAmount1=24300.00
&itemQuantity1=1
&notificationURL=https://sualoja.com.br/notifica.html
&reference=REF1234
&senderName=Jose Comprador
&senderCPF=72962940005
&senderAreaCode=11
&senderPhone=56273440
&[email protected]
&senderHash={hash_obtido_no_passo_2.3}
&shippingAddressRequired=true
&shippingAddressStreet=Av. Brig. Faria Lima
&shippingAddressNumber=1384
&shippingAddressComplement=5o andar
&shippingAddressDistrict=Jardim Paulistano
&shippingAddressPostalCode=01452002
&shippingAddressCity=Sao Paulo
&shippingAddressState=SP
&shippingAddressCountry=BRA
&shippingType=1
&shippingCost=1.00
<payment>
    <mode>default</mode>
    <method>boleto</method>
    <sender>
        <name>Fulano Silva</name>
        <email>[email protected]</email>
        <phone>
            <areaCode>11</areaCode>
            <number>30380000</number>
        </phone>
        <documents>
            <document>
                <type>CPF</type>
                <value>72962940005</value>
            </document>
        </documents>
        <hash>{hash_obtido_no_passo_2.3}</hash>
    </sender>
    <currency>BRL</currency>
    <notificationURL>https://sualoja.com.br/notificacao</notificationURL>
    <items>
        <item>
            <id>1</id>
            <description>Descricao do item a ser vendido</description>
            <quantity>2</quantity>
            <amount>1.00</amount>
        </item>
    </items>
<extraAmount>0.00</extraAmount>
    <reference>R123456</reference>
  <shipping>
				<addressRequired>true</addressRequired>
        <address>
            <street>Av. Brigadeiro Faria Lima</street>
            <number>1384</number>
            <complement>1 andar</complement>
            <district>Jardim Paulistano</district>
            <city>Sao Paulo</city>
            <state>SP</state>
            <country>BRA</country>
            <postalCode>01452002</postalCode>
        </address>
        <type>3</type>
        <cost>0.00</cost>
    </shipping>
</payment>

3.2. Exemplo de Checkout com Débito Online

paymentMode=default
&paymentMethod=eft
&bankName=itau
&[email protected]
&currency=BRL
&extraAmount=1.00
&itemId1=0001
&itemDescription1=Notebook Prata
&itemAmount1=24300.00
&itemQuantity1=1
&notificationURL=https://sualoja.com.br/notifica.html
&reference=REF1234
&senderName=Jose Comprador
&senderCPF=22111944785
&senderAreaCode=11
&senderPhone=56273440
&[email protected]
&senderHash={hash_obtido_no_passo_2.3}
&shippingAddressRequired=true
&shippingAddressStreet=Av. Brig. Faria Lima
&shippingAddressNumber=1384
&shippingAddressComplement=5o andar
&shippingAddressDistrict=Jardim Paulistano
&shippingAddressPostalCode=01452002
&shippingAddressCity=Sao Paulo
&shippingAddressState=SP
&shippingAddressCountry=BRA
&shippingType=1
&shippingCost=1.00
<payment>
    <mode>default</mode>
    <method>eft</method>
    <bank>
    <name>itau</name>
</bank>
    <sender>
        <name>Fulano Silva</name>
        <email>[email protected]</email>
        <phone>
            <areaCode>11</areaCode>
            <number>30380000</number>
        </phone>
        <documents>
            <document>
                <type>CPF</type>
                <value>11475714734</value>
            </document>
        </documents>
        <hash>{hash_obtido_no_passo_2.3}</hash>
    </sender>
    <currency>BRL</currency>
    <notificationURL>https://sualoja.com.br/notificacao</notificationURL>
    <items>
        <item>
            <id>1</id>
            <description>Descricao do item a ser vendido</description>
            <quantity>1</quantity>
            <amount>1.00</amount>
        </item>
    </items>
<extraAmount>0.00</extraAmount>
    <reference>R123456</reference>
<shipping>
				<addressRequired>true</addressRequired>
        <address>
            <street>Av. Brigadeiro Faria Lima</street>
            <number>1384</number>
            <complement>1 andar</complement>
            <district>Jardim Paulistano</district>
            <city>Sao Paulo</city>
            <state>SP</state>
            <country>BRA</country>
            <postalCode>01452002</postalCode>
        </address>
        <type>3</type>
        <cost>0.00</cost>
    </shipping>
</payment>

3.3. Exemplo de Checkout com Cartão de Crédito

paymentMode=default
&paymentMethod=creditCard
&[email protected]
&currency=BRL
&extraAmount=1.00
&itemId1=0001
&itemDescription1=Notebook Prata
&itemAmount1=24300.00
&itemQuantity1=1
&notificationURL=https://sualoja.com.br/notifica.html
&reference=REF1234
&senderName=Jose Comprador
&senderCPF=22111944785
&senderAreaCode=11
&senderPhone=56273440
&[email protected]
&senderHash={hash_obtido_no_passo_2.3}
&shippingAddressRequired=true
&shippingAddressStreet=Av. Brig. Faria Lima
&shippingAddressNumber=1384
&shippingAddressComplement=5o andar
&shippingAddressDistrict=Jardim Paulistano
&shippingAddressPostalCode=01452002
&shippingAddressCity=Sao Paulo
&shippingAddressState=SP
&shippingAddressCountry=BRA
&shippingType=1
&shippingCost=1.00
&creditCardToken={creditCard_token_obtido_no_passo_2.6}
&installmentQuantity={quantidade_de_parcelas_escolhida}
&installmentValue={installmentAmount_obtido_no_retorno_do_passo_2.5}
&noInterestInstallmentQuantity={valor_maxInstallmentNoInterest_incluido_no_passo_2.5}
&creditCardHolderName=Jose Comprador
&creditCardHolderCPF=22111944785
&creditCardHolderBirthDate=27/10/1987
&creditCardHolderAreaCode=11
&creditCardHolderPhone=56273440
&billingAddressStreet=Av. Brig. Faria Lima
&billingAddressNumber=1384
&billingAddressComplement=5o andar
&billingAddressDistrict=Jardim Paulistano
&billingAddressPostalCode=01452002
&billingAddressCity=Sao Paulo
&billingAddressState=SP
&billingAddressCountry=BRA
<payment>
    <mode>default</mode>
    <method>creditCard</method>
    <sender>
        <name>Fulano Silva</name>
        <email>[email protected]</email>
        <phone>
            <areaCode>11</areaCode>
            <number>30380000</number>
        </phone>
        <documents>
            <document>
                <type>CPF</type>
                <value>22111944785</value>
            </document>
        </documents>
        <hash>{hash_obtido_no_passo_2.3}</hash>
    </sender>
    <currency>BRL</currency>
    <notificationURL>https://sualoja.com.br/notificacao</notificationURL>
    <items>
        <item>
            <id>1</id>
            <description>Descricao do item a ser vendido</description>
            <quantity>1</quantity>
            <amount>10.00</amount>
        </item>
    </items>
<extraAmount>0.00</extraAmount>
    <reference>R123456</reference>
<shipping>
				<addressRequired>true</addressRequired>
        <address>
            <street>Av. Brigadeiro Faria Lima</street>
            <number>1384</number>
            <complement>1 andar</complement>
            <district>Jardim Paulistano</district>
            <city>Sao Paulo</city>
            <state>SP</state>
            <country>BRA</country>
            <postalCode>01452002</postalCode>
        </address>
        <type>3</type>
        <cost>0.00</cost>
    </shipping>
    <creditCard>
        <token>{creditCard_token_obtido_no_passo_2.6}</token>
       <installment>
             <quantity>{quantidade_de_parcelas_escolhida}</quantity>
            <value>{installmentAmount_obtido_no_retorno_do_passo_2.5}</value>
    				<noInterestInstallmentQuantity>{valor_maxInstallmentNoInterest_incluido_no_passo_2.5}
         		</noInterestInstallmentQuantity>
        </installment>
        <holder>
            <name>Nome impresso no cartao</name>
            <documents>
                <document>
                    <type>CPF</type>
                    <value>22111944785</value>
                </document>
            </documents>
            <birthDate>20/10/1980</birthDate>
            <phone>
                <areaCode>11</areaCode>
                <number>999991111</number>
            </phone>
        </holder>
        <billingAddress>
            <street>Av. Brigadeiro Faria Lima</street>
            <number>1384</number>
            <complement>1 andar</complement>
            <district>Jardim Paulistano</district>
            <city>Sao Paulo</city>
            <state>SP</state>
            <country>BRA</country>
            <postalCode>01452002</postalCode>
        </billingAddress>
    </creditCard>
</payment>

Tratando a resposta

Após realizar a chamada para processar o checkout é retornado um XML contendo todos os dados da transação. Veja os exemplos de retorno de acordo com os respectivos meios de pagamento abaixo:

<transaction>
    <date>2011-02-05T15:46:12.000-02:00</date>  
    <lastEventDate>2011-02-15T17:39:14.000-03:00</lastEventDate>  
    <code>9E884542-81B3-4419-9A75-BCC6FB495EF1</code>  
    <reference>REF1234</reference>  
    <type>1</type>  
    <status>3</status>  
    <paymentMethod>  
        <type>1</type>  
        <code>101</code>  
    </paymentMethod>
<paymentLink>
https://pagseguro.uol.com.br/checkout/imprimeBoleto.jhtml?code=314601B208B24A5CA53260000F7BB0D
</paymentLink>
    <grossAmount>49900.00</grossAmount>
    <discountAmount>0.00</discountAmount> 
    <feeAmount>0.00</feeAmount> 
    <netAmount>49900.50</netAmount>  
    <extraAmount>0.00</extraAmount> 
    <installmentCount>1</installmentCount>  
    <itemCount>2</itemCount>  
    <items> 
        <item>  
            <id>0001</id>  
            <description>Notebook Prata</description>  
            <quantity>1</quantity>  
            <amount>24300.00</amount>  
        </item>  
        <item> 
            <id>0002</id>  
            <description>Notebook Rosa</description>  
            <quantity>1</quantity>  
            <amount>25600.00</amount>  
        </item>  
    </items>  
    <sender>  
        <name>José Comprador</name>  
        <email>[email protected]</email>  
        <phone>  
            <areaCode>11</areaCode>  
            <number>56273440</number>  
        </phone>  
    </sender>  
    <shipping>  
        <address>  
            <street>Av. Brig. Faria Lima</street>  
            <number>1384</number>  
            <complement>5o andar</complement>  
            <district>Jardim Paulistano</district>  
            <postalCode>01452002</postalCode>  
            <city>Sao Paulo</city>  
            <state>SP</state>  
            <country>BRA</country>  
        </address>  
        <type>1</type>  
        <cost>21.50</cost>  
    </shipping>  
</transaction>
<transaction>
    <date>2018-11-13T11:56:32.000-02:00</date>
    <code>92BDD4E2-F571-4B4B-B7C4-5699CF00C1AC</code>
    <reference>REF1234</reference>
    <recoveryCode>7df5a68dd88c50bb869c4db8e73271f82a3f91f79a49407e</recoveryCode>
    <type>1</type>
    <status>1</status>
    <lastEventDate>2018-11-13T11:56:33.000-02:00</lastEventDate>
    <paymentMethod>
        <type>3</type>
        <code>302</code>
    </paymentMethod>
    <paymentLink>https://pagseguro.uol.com.br/checkout/payment/eft/print.jhtml?c=da5005c0aed949871fb25cbfbddb725d9cd951888f3d9a0ae5a11005e2998b99219b32e8f3891c0a</paymentLink>
    <grossAmount>24302.00</grossAmount>
    <discountAmount>0.00</discountAmount>
    <feeAmount>970.05</feeAmount>
    <netAmount>23331.95</netAmount>
    <extraAmount>1.00</extraAmount>
    <installmentCount>1</installmentCount>
    <itemCount>1</itemCount>
    <items>
        <item>
            <id>0001</id>
            <description>Notebook Prata</description>
            <quantity>1</quantity>
            <amount>24300.00</amount>
        </item>
    </items>
    <sender>
        <name>Jose Comprador</name>
        <email>[email protected]</email>
        <phone>
            <areaCode>11</areaCode>
            <number>56273440</number>
        </phone>
    </sender>
    <shipping>
        <address>
            <street>Av. Brig. Faria Lima</street>
            <number>1384</number>
            <complement>5o andar</complement>
            <district>Jardim Paulistano</district>
            <city>Sao Paulo</city>
            <state>SP</state>
            <country>BRA</country>
            <postalCode>01452002</postalCode>
        </address>
        <type>1</type>
        <cost>1.00</cost>
    </shipping>
</transaction>
<transaction>
    <date>2018-11-13T12:08:45.000-02:00</date>
    <code>A31CDEEB-4FC7-41A7-A895-AE91C8F54C03</code>
    <reference>REF1234</reference>
    <type>1</type>
    <status>1</status>
    <lastEventDate>2018-11-13T12:08:45.000-02:00</lastEventDate>
    <paymentMethod>
        <type>1</type>
        <code>101</code>
    </paymentMethod>
    <grossAmount>24302.00</grossAmount>
    <discountAmount>0.00</discountAmount>
    <feeAmount>1538.72</feeAmount>
    <netAmount>22763.28</netAmount>
    <extraAmount>1.00</extraAmount>
    <installmentCount>5</installmentCount>
    <itemCount>1</itemCount>
    <items>
        <item>
            <id>0001</id>
            <description>Notebook Prata</description>
            <quantity>1</quantity>
            <amount>24300.00</amount>
        </item>
    </items>
    <sender>
        <name>Jose Comprador</name>
        <email>[email protected]</email>
        <phone>
            <areaCode>11</areaCode>
            <number>56273440</number>
        </phone>
    </sender>
    <shipping>
        <address>
            <street>Av. Brig. Faria Lima</street>
            <number>1384</number>
            <complement>5o andar</complement>
            <district>Jardim Paulistano</district>
            <city>Sao Paulo</city>
            <state>SP</state>
            <country>BRA</country>
            <postalCode>01452002</postalCode>
        </address>
        <type>1</type>
        <cost>1.00</cost>
    </shipping>
</transaction>

📘

Note que para os meios de pagamento Boleto e Débito Online, o XML possui o item paymentLink . Esse parâmetro pode ser um link de acesso para a imagem do boleto ou para a página de pagamento do banco selecionado. Lembrando que a página do banco não deve ser aberta em um IFrame.