Hello! I am verifying how to get the total value of a purchase made by PagSeguro, including payment for purchases on the credit card, additional value for purchases per ticket (R $ 1.00), etc. ...
The problem is that the API returns only the gross value ( grossAmount
) set when I created the payment in the PaySafe (I am a seller) and the net value ( netAmount
), which is the gross decrease in the PaySease .
However, the gross amount may not be the total value of the payment made by the buyer, and the invoice would not include the total amount paid.
For example, I created a payment with $ 59.90 (in sandbox), and when I a payment was made in the total amount of R $ 72.17 .
When I check the payment via API v3 ( https://ws.sandbox.pagseguro.uol.com.br/v3/transactions/{{transactionCode}}
) I get the following return:
<?xml version="1.0" encoding="UTF-8"?>
<transaction>
<date>2018-12-27T15:57:52.000-02:00</date>
<code>DA75C974-4907-4CCA-87B3-23C7CD4CB859</code>
<reference>7087c39c-8b97-4165-b618-abc35621e50e</reference>
<type>1</type>
<status>3</status>
<lastEventDate>2018-12-27T15:59:14.000-02:00</lastEventDate>
<paymentMethod>
<type>1</type>
<code>101</code>
</paymentMethod>
<grossAmount>59.90</grossAmount>
<discountAmount>0.00</discountAmount>
<creditorFees>
<installmentFeeAmount>0.00</installmentFeeAmount>
<intermediationRateAmount>0.40</intermediationRateAmount>
<intermediationFeeAmount>2.99</intermediationFeeAmount>
</creditorFees>
<netAmount>56.51</netAmount>
<extraAmount>0.00</extraAmount>
<escrowEndDate>2019-01-10T15:59:14.000-02:00</escrowEndDate>
<installmentCount>12</installmentCount>
<itemCount>1</itemCount>
<items>
<item>
<id>33374</id>
<description>Plano Premium</description>
<quantity>1</quantity>
<amount>59.90</amount>
</item>
</items>
</transaction>
(I removed some unnecessary fields like sender
, shipping
, gatewaySystem
and primaryReceiver
to not pollute the text area much.)
As can be seen, there is no field with the total value, and the field that would contain the additional value relating to the installment equals 0.
I believe it is 0 because the value of the installments is added to be paid by the buyer (instead of being included in the value defined by the seller).
Following is an image of the payment made (in sandbox):
Accordingtothiscomment( link ) of a member of the PagSeguro Team:
The value returned in the
<installmentFeeAmount>
field refers to the rates of installments that the seller will assume.PagSeguro does not provide the added value with the installment rates of the buyer, since it is an agreement between the buyer and the operator.
How would you issue the invoice in the total amount paid? How is it done by other developers who use the PagSeguro API?
Unless the note is issued in the gross amount sent to PagSeguro (without the additions), as I saw in that message in a forum:
The answer I had from PagSeguro is that the note should be made in value of R $ 30.00 (in this example) because this is the gross amount passed on to store and that will appear in the service invoice that PagSeguro will send the store.
( Link: #
I can not confirm the veracity of the post, and I did not contact PagSeguro, but seeing that they do not return the installment amount, is the most reasonable alternative I see.
The other alternative would be to always add 1 hardcoded when the payout is per ticket and when credit card calculates the total amount based on the number of installments and the gross amount (hoping for the rate never to change). However, this solution is far from ideal and can generate long-term values.
Thus:
1) Would you have any way to get the total value paid by the buyer in PagSeguro?
2) A invoice can be issued in the gross amount sent to PagSeguro (no installment / ticket additions)?