installment value Invalid Pagseguro

2

Oops, I'm using the transparent checkout of Pagseguro, but if I report a number of parcels larger than 1, on a credit card sale, I get the error: installment value invalid value:

My shipping xml:

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
        <payment>
            <mode>default</mode>
            <method>creditCard</method>
            <sender>
                <name>Leonidas Wander</name>
                <email>*************@sandbox.pagseguro.com.br</email>
                <phone>
                    <areaCode>99</areaCode>
                    <number>999999999</number>
                </phone>
                <documents>
                    <document>
                        <type>CPF</type>
                        <value>99999999999</value>
                    </document>
                </documents>
                <hash>**************************************</hash>
            </sender>
            <currency>BRL</currency>
            <notificationURL>https://www.site.com.br/notificacao</notificationURL>
            <items>
                <item>
                    <id>0001</id>
                    <description>Compra Pacote </description>
                    <quantity>1</quantity>
                    <amount>200.00</amount>
                </item>
            </items>
            <extraAmount>0.00</extraAmount>
            <reference>P2EV2</reference>
            <shipping>
                <address>
                    <street>Rua Santa Maria</street>
                    <number>11</number>
                    <complement></complement>
                    <district>Petrópolis</district>
                    <city>Maceió</city>
                    <state>AL</state>
                    <country>ATA</country>
                    <postalCode>99999999</postalCode>
                </address>
                <type>3</type>
                <cost>0.00</cost>
            </shipping>
            <creditCard>
                <token>********************</token>
                    <installment>
                        <quantity>2</quantity>
                        <value>100.00</value>
                    </installment>
                    <holder>
                        <name>Leonidas Waaa</name>
                        <documents>
                            <document>
                                <type>CPF</type>
                                <value>99999999999</value>
                            </document>
                        </documents>
                        <birthDate>01/01/1900</birthDate>
                        <phone>
                            <areaCode>99</areaCode>
                            <number>999999999</number>
                        </phone>
                    </holder>
                    <billingAddress>
                        <street>Rua Santa Maria</street>
                        <number>11</number>
                        <complement></complement>
                        <district>Petrópolis</district>
                        <city>Maceió</city>
                        <state>AL</state>
                        <country>ATA</country>
                        <postalCode>99999999</postalCode>
                    </billingAddress>
            </creditCard>
        </payment>

These portion values are returned by Pagseguro itself. By reporting only one parcel, that is, the total value, the transaction is performed.

    
asked by anonymous 02.11.2016 / 20:22

2 answers

3

According to PagSeguro documentation for installment without addition, the model of the XML for installment must follow the following format.

You should use the end endpoint

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<checkout>
<currency>BRL</currency>
<items>
    <item>
        <id>0001</id>
        <description>Notebook Prata</description>
        <amount>24300.00</amount>
        <quantity>1</quantity>
        <weight>1000</weight>
    </item>
</items>
<reference>REF1234</reference>
<sender>
    <name>José Comprador</name>
    <email>[email protected]</email>
    <phone>
        <areaCode>11</areaCode>
        <number>56273440</number>
    </phone>
</sender>
<shipping>
    <type>1</type>
    <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>
</shipping>
<paymentMethodConfigs>
    <paymentMethodConfig>
        <paymentMethod>
            <group>CREDIT_CARD</group>
        </paymentMethod>
        <configs>
            <config>
                <key>MAX_INSTALLMENTS_NO_INTEREST</key>
                <value>6</value>
            </config>
        </configs>
    </paymentMethodConfig>
</paymentMethodConfigs>

Isolating the part that interests.

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<checkout>
    (...)
    <paymentMethodConfigs>
        <paymentMethodConfig>
            <paymentMethod>
                <group>CREDIT_CARD</group>
            </paymentMethod>
            <configs>
                <config>
                    <key>MAX_INSTALLMENTS_NO_INTEREST</key>
                    <value>6</value>
                </config>
            </configs>
        </paymentMethodConfig>
    </paymentMethodConfigs>
</checkout>

There is also a way to pay for the card through Transparent Payment

    
22.11.2016 / 20:12
2

Resolved

Correct XML for transparent Pagseguro checkout

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
    <payment>
        <mode>default</mode>
        <method>creditCard</method>
        <sender>
            <name>Leonidas Wander</name>
            <email>*************@sandbox.pagseguro.com.br</email>
            <phone>
                <areaCode>99</areaCode>
                <number>999999999</number>
            </phone>
            <documents>
                <document>
                    <type>CPF</type>
                    <value>99999999999</value>
                </document>
            </documents>
            <hash>**************************************</hash>
        </sender>
        <currency>BRL</currency>
        <notificationURL>https://www.site.com.br/notificacao</notificationURL>
        <items>
            <item>
                <id>0001</id>
                <description>Compra Pacote </description>
                <quantity>1</quantity>
                <amount>200.00</amount>
            </item>
        </items>
        <extraAmount>0.00</extraAmount>
        <reference>P2EV2</reference>
        <shipping>
            <address>
                <street>Rua Santa Maria</street>
                <number>11</number>
                <complement></complement>
                <district>Petrópolis</district>
                <city>Maceió</city>
                <state>AL</state>
                <country>ATA</country>
                <postalCode>99999999</postalCode>
            </address>
            <type>3</type>
            <cost>0.00</cost>
        </shipping>
        <creditCard>
            <token>********************</token>
                <installment>
                    <quantity>2</quantity>
                    <value>100.00</value>
                    <noInterestInstallmentQuantity>2</noInterestInstallmentQuantity>
                </installment>
                <holder>
                    <name>Leonidas Waaa</name>
                    <documents>
                        <document>
                            <type>CPF</type>
                            <value>99999999999</value>
                        </document>
                    </documents>
                    <birthDate>01/01/1900</birthDate>
                    <phone>
                        <areaCode>99</areaCode>
                        <number>999999999</number>
                    </phone>
                </holder>
                <billingAddress>
                    <street>Rua Santa Maria</street>
                    <number>11</number>
                    <complement></complement>
                    <district>Petrópolis</district>
                    <city>Maceió</city>
                    <state>AL</state>
                    <country>ATA</country>
                    <postalCode>99999999</postalCode>
                </billingAddress>
        </creditCard>
    </payment>

The value that is in the noInterestInstallmentQuantity should be the same as that put in maxInstallmentNoInterest in javascript.

    
22.11.2016 / 21:12