/
Purchase information

Purchase information


  • compra: the purchase itself, with costumer information and total amount.

  • compra detalle: the purchased items (campaigns or products) and the prices for each.

  • pago: payment made to cancel the purchase. A purchase may have many associated payments. I.e.: The user may choose to pay by credit card and the credit card is rejected, then he chooses to pay via bank deposit. In this case, the same purchase has two associated payments. All payments must be for the total amount, and it only allows a new payment if none of the above is accepted. It prevents the user to make a double payment.

  • pago_response: payment gateway response, containing the response status (accepted / rejected / etc). The same payment can have many responses. I.e.: PayPal sends a synchronous response when redirecting to e-planning, and a few seconds later it sends an asynchronous resopnse directly from PayPal servers, to confirm the purchase. It also may occur that, if the user tries with several credit cards, the payment gateway will send a response for each attempt.

  • pago_response_detalle: additional variables sent by the payment gateway. They are particular for each payment gateway and may include, for instance, the payment mode or authorization code.

  • anunciante: if the purchse was performed by and advertiser, all the information for that advertiser is indicated here. If not, the following parameter is indicated:

  • agencia: Data from the agency which performed the purchase.

Regarding the advertiser and agency, only one of them is indicated, and always one must be indicated. Furthermore, if available, the address from the agency or advertiser is added.

Regarding the status, both the purchase and the payment or payment-response has a status attribute. It uses the following logic: the purchase is created as “pending”. When the user selects the payment mode, it will also be created as “pending”. These statuses will only change when a response arrives. If it is a positive response, both the purchase and the payment will be set as “approved” or “confirmed”. On the other hand, it it's a negative response, the payment will be set as “denied” and the purchase will remain as “pending”, since a future payment can be done. If, after certain time the purchase still remains as “pending”, it will be set as “voided”.

URL: /admin/adnet/pub/admin/compras.html?op=vd&o=xml

Mandatory parameters:
- compra_id: purchase ID, which can be obtained through the purchase listing.

Response:

It contains a list of objects <compra>.  The identifier is specified through compra_id attribute and the data presented are the following:
  • moneda_id: purchase currency – See potential values in Currency annex
  • importe: total amount of the purchase
  • fecha_alta: creation date
  • estado: See annex  Purchase status
  • usuario_id: user ID of the advertiser who made the purchase
  • anunciante_id: advertiser ID who made the purchase
  • detalles: lobjects purchased-details listing, each one with the following attributes:
    -importe: item amount
    -iva: item tax
    -moneda_id: currency ID
    -If it is a campaign:
          -pauta_id: purchased campaign ID
          -packaventa_id: selected pack by the user
    -If it is a product:
          -dsmproductoconf_id: purchased item ID. It can be used to gain all the item available information.
    -If it is a combo:
          -dsmcomboconf_id: purchased combo ID. It can be used to gain all the combo available information.
  • pagos: payed objects listing, each one with the following attributes:
    -estado: payment status – See Payment status annex
    -pago_id: payment ID
    -sistema_pago_id: payment gateway ID – See Payment Gateway annex
    -fecha_alta: fpayment date decided by the user.
    -responses: objects respose listing, each one with the following attributes:
           -pago_response_id: ID
           -client_ip: user IP or payment gateway server ID, from which the response was received.
           -estado de la Respuesta: See Payment status annex
           -tipo: indicates if the response was synchronous (s), that is if the response came form the user, or asynchronous (a), that the response came from the payment gateway server.
           -detalles: attributes sent by the payment gateway in its response. They are specific from each payment gateway. Every attribute consists in a detail object with the following fields:
                       -clave: attribute name
                       -valor: attribute value
    -anunciante: advertiser information
            -agencia_id: agency ID associated to the advertiser (optional)
            -industria_id. Industry code
            -nombre: advertiser name
            -observaciones: comments
            -custom_id: customized identifier
            -razon_social: company name
            -tipo_persona: 0 for a person, or 1 for a company name
           -tax_id: tax identifier (example: VAT, NIT, RUT or others)
           -tax_status_id: taxpayers type – See posible values on Taxpayers Types Annex
           -The following parameters are included within the same advertiser temporarily, but will be removed in later versions:
                      -cargo: user’s position
                      -fecha_nacimiento: birth date
                      -nro_documento: ID number
                     -tipodoc_id: ID types (see ID Types Annex)
    -agencia: agency information
            -nombre: agency’s name
            -observaciones: comments
            -custom_id: customized identifier
            -url: website electronic address
    -domicilio: address information (from the advertiser or agency)
            -direccion: street name and number
            -ciudad: city
            -cp: postal code (optional)
            -region: state, region or province
            -pais: country
Response example:
<compra anunciante_id='15981' agencia_id=”” compra_id='264' estado='3' fecha_alta='0000-00-00 00:00:00' importe='200.0000' moneda_id='1' usuario_id='1765'>
    <detalles>
<detalle importe='200.0000' iva='0.0000' moneda_id='1' packventa_id='13' pauta_id='11642'/>
</detalles>
<anunciante agencia_id=”” cargo=”” custom_id=”” fecha_nacimiento=”” industria_id=”” nombre=”Test” nro_documento=”” observaciones=”” razon_social=”Test SA” tax_id=”” tax_status_id=”” tipo_persona=”0” tipodoc=”” url=”http://www.test.com/”>
    <domicilio ciudad=”Lanus” cp=”4324” direccion=”Avda Hip Yrigoyen 443” pais=”Argentina” region=”Buenos Aires”/>
</anunciante>
    <pagos>
<pago estado='1' fecha_alta='2009-05-11 14:58:26' pago_id='281' sistema_pago_id='6'/>
<pago estado='1' fecha_alta='2009-05-11 15:10:11' pago_id='282' sistema_pago_id='6'/>
    <pago estado='3' fecha_alta='2009-05-11 15:21:37' pago_id='283' sistema_pago_id='6'>
    <responses>
    <response client_ip='6476' estado='3' fecha='2009-05-11 15:22:05' pago_response_id='75' tipo='a'>
   <detalles>
            <detalle clave='a 2' valor='' />
            <detalle clave='business' valor='paypal_1203160933_biz@caraytech.com' />
            <detalle clave='charset' valor='windows-1252' />
            <detalle clave='first_name' valor='Test' />
            <detalle clave='item_name1' valor='paypal' />
            <detalle clave='item_number1' valor='42e755e4c8c4d11460b97bcdb722f97f3bc4a56f9112be14' />
            <detalle clave='last_name' valor='User' />
            <detalle clave='mc_currency' valor='USD' />
            <detalle clave='mc_fee' valor='0.45' />
            <detalle clave='mc_gross' valor='5.26' />
            <detalle clave='mc_gross_1' valor='5.26' />
            <detalle clave='mc_handling' valor='0.00' />
            <detalle clave='mc_handling1' valor='0.00' />
            <detalle clave='mc_shipping' valor='0.00' />
            <detalle clave='mc_shipping1' valor='0.00' />
            <detalle clave='notify_version' valor='2.8' />
            <detalle clave='num_cart_items' valor='1' />
            <detalle clave='o' valor='html' />
            <detalle clave='option_name1_1' valor='924c6c8a090558e4881fbc0b892ee22b7aae513d4e886aa9' />
            <detalle clave='option_selection1_1' valor='' />
            <detalle clave='order_id' valor='42e755e4c8c4d11460b97bcdb722f97f3bc4a56f9112be14' />
            <detalle clave='payer_email' valor='paypal_1203161213_per@caraytech.com' />
            <detalle clave='payer_id' valor='Z53HD4PAK5T2C' />
            <detalle clave='payer_status' valor='verified' />
            <detalle clave='payment_date' valor='12:02:19 Jun 18, 2009 PDT' />
            <detalle clave='payment_fee' valor='0.45' />
            <detalle clave='payment_gross' valor='5.26' />
            <detalle clave='payment_status' valor='Completed' />
            <detalle clave='payment_type' valor='instant' />
            <detalle clave='protection_eligibility' valor='Ineligible' />
            <detalle clave='quantity1' valor='1' />
            <detalle clave='receiver_email' valor='paypal_1203160933_biz@caraytech.com' />
            <detalle clave='receiver_id' valor='N9DX3KG4TZWCA' />
            <detalle clave='residence_country' valor='US' />
            <detalle clave='tax' valor='0.00' />
            <detalle clave='tax1' valor='0.00' />
            <detalle clave='test_ipn' valor='1' />
            <detalle clave='transaction_subject' valor='Shopping Cart' />
            <detalle clave='txn_id' valor='5KA8878298448953W' />
            <detalle clave='txn_type' valor='cart' />
            <detalle clave='verify_sign' valor='AzdrjT9lkqchJ-IVRZ9LrAPFO6OiACo7QyLH6P.XB7qraMV9i4O1Y9Tz' />
          </detalles>
</response>
</responses>
</pago>
</pagos>
</compra>