Actualizaciones al API


Su versión del API controla el funcionamiento de los diferentes recursos o endpoints del API y la información contenida en la respuesta al invocar dichos recursos (por ejemplo: las propiedades que acompañan a la respuesta o los parámetros que se envían para cada una de las peticiones, etc).

La versión (del API) que usa actualmente, fue establecida en nuestro sistema cuando se registró por primera vez. Si decide cambiar a una nueva versión del API, nuestro equipo se asegura que el cambio no afecte su código actual y que sea totalmente funcional para versiones anteriores.

En las nuevas versiones del API se pueden encontrar mejoras en cuanto a rendimiento, nuevas funcionalidades, así como otros atributos que ofrecen una respuesta más completa al invocar o hacer una petición a alguno de los recursos.

A continuación se describen las actualizaciones para la versión mas reciente del API.

Crear un Cargo - 16/Jun/15

  • Cambio del nombre de parámetros que se envían cuando se crea un cargo.

curl -H "Accept: application/compropago" \
-H "Content-type: application/json" \
-u 23976112561d20: \
-X POST \
-d '{
  "order_id": "SMGCURL1",
  "order_price": 75.0,
  "order_name": "SAMSUNG GOLD CURL",
  "image_url": "https://test.amazon.com/5f4373",
  "customer_name":"Alejandra Leyva",
  "customer_email": "noreply@compropago.com",
  "payment_type": "SEVEN_ELEVEN",
  "currency": "MXN"
}' https://api.compropago.com/v1/charges
curl -H "Accept: application/compropago" \
-H "Content-type: application/json" \
-u 23976112561d20: \
-X POST \
-d '{
  "product_id": "SMGCURL1",
  "product_price": 75.0,
  "product_name": "SAMSUNG GOLD CURL",
  "image_url": "https://test.amazon.com/5f4373",
  "customer_name": "Alejandra Leyva",
  "customer_email": "noreply@compropago.com",
  "payment_type": "SEVEN_ELEVEN"
}' https://api.compropago.com/v1/charges

  • La respuesta que se obtiene al crear un cargo presenta modificaciones en algunos de los nombres de sus atributos, así como información adicional.

    • La propiedad status se cambió a type.
    • El atributo created se cambió a created_at y regresa la fecha en formato de segundos.
    • El atributo exp_date se cambió a expires_at y regresa la fecha en formato de segundos.
    • El atributo live_mode se cambió a livemode, que indica si el cargo fue realizado en modo de pruebas regresando un valor false y si está en modo activo regresando un valor true.
    • Se agrego el campo accepted_at que en el caso de la creación de las ordenes siempre sera tendra el valor de null, sin hembargo hace referencia a la fecha de aprovación de un cargo y esta en formato de segundos.
    • Se agrego el campo amount que contendra el monto total de la orden
    • Se agrego el campo currency que indica la divisa en la cual se cobrara la orden.
    • Se agregaron los sigientes campos al objeto order_info:
      • payment_method: tipo de pago (cash hace referencia a pago en efectivo).
      • store: establecimiento en cual se debera realizar el pago.
      • country: país en el que aplica el cobro.
      • image_url: imagen del producto u orden.
      • success_url: url definida para exito en la generación de la orden.
      • failure_url: url definida en caso de fallo en la orden.
    • Se agrego el campo customer que contendra los siguientes campos:
      • customer_name: nombre del cliente.
      • customer_email: correo del cliente.
      • customer_phone: teléfono del cliente.

{
  "id": "ch_fe92a1a5-abec-49e3-877c-5024c1464dc3",
  "short_id": "asdqw23",
  "type": "charge.pending",
  "object": "charge",
  "created_at": 1424024955774,
  "accepted_at": null,
  "expires_at": 1424024065774,
  "paid": false,
  "amount": 150.00,
  "livemode": true,
  "currency": "mxn",
  "refunded": false,
  "fee": 7.50,
  "fee_details": {
    "amount": 7.50,
    "currency": "mxn",
    "type": "compropago_fee",
    "application": null,
    "amount_refunded": 0,
    "tax": 0.94
  },
  "order_info": {
    "order_id": "SMGCURL1",
    "order_price": 150.00,
    "order_name": "SAMSUNG GOLD CURL",
    "payment_method": "cash",
    "store": "SEVEN_ELEVEN",
    "country": "MX",
    "image_url": null,
    "success_url": null,
    "failed_url": null,
    "exchange": {
      "rate": 1,
      "request": 1485224234,
      "origin_amount": "150.0",
      "final_amount": "150.0",                   
      "origin_currency": "MXN",
      "final_currency": "MXN",
      "exchange_id": null 
    }             
  },
  "customer": {
    "customer_name": "Alejandra Leyva",
    "customer_email": "noreply@compropago.com",
    "customer_phone": "2221515801"
  },
  "instructions":{
    "description": "Para que el pago sea valido debes pagar ...",
    "step_1": "Ir a la caja 7Eleven ...",
    "step_2": "Solicitar deposito ...",
    "step_3": "Deposite la cantidad ...",
    "note_extra_comition": "Las tiendas 7Eleven cobran en caja una comisión de 7 pe..",
    "note_expiration_date": "Orden válida antes de 01/10/2013",
    "note_confirmation": "Tu pago será confirmado a través de SMS y email",
    "details":{
      "payment_amount": "75.0",
      "payment_store": "SEVEN_ELEVEN",
      "amount": "75.0",
      "store": "SEVEN_ELEVEN",
      "bank_account_number": "xxxx xxxx xxxx xxxx",
      "company_reference_name": "ComproPago",
      "company_reference_number": "",
      "company_bank_number": "",
      "order_reference_number": "",
      "bank_account_holder_name": "ComproPago SAPI de CV",
      "bank_reference": "",
      "bank_name": "Banorte"
    }
  },
  "api_version": "1.1",
}
{
  "id": "ch_0991dd38-e408-4f27",
  "short_id": "00927c",
  "object": "charge",
  "status": "pending",
  "created": "1436979650",
  "paid": false,
  "live_mode": true,
  "order_info": {
    "order_id": "IB18S",
    "order_name": "Samsung Galaxy Gold",
    "order_price": 75.0,0
    "image_url": "",
    "exchange": {
      "rate": 1,
      "request": 1485224234, 
      "origin_amount": "75.0",         
      "final_amount": "75.0",                    
      "origin_currency": "MXN",
      "final_currency": "MXN",
      "exchange_id": null
    }
  },
  "fee_details": {
    "amount": "5.18",
    "tax": "0.83",
    "tax_percent": "16",
    "currency": "mxn",
    "type": "compropago_fee",
    "description": "Horarios de Compropago",
    "amount_refunded": 0
  },
  "instructions":{
    "description": "Para que el pago sea valido debes pagar ...",
    "step_1": "Ir a la caja 7Eleven ...",
    "step_2": "Solicitar deposito ...",
    "step_3": "Deposite la cantidad ...",
    "note_extra_comition": "Las tiendas 7Eleven cobran en caja una comisión de 7 pe..",
    "note_expiration_date": "Orden válida antes de 01/10/2013",
    "note_confirmation": "Tu pago será confirmado a través de SMS y email",
    "details":{
      "payment_amount": "75.0",
      "payment_store": "SEVEN_ELEVEN",
      "amount": "75.0",
      "store": "SEVEN_ELEVEN",
      "bank_account_number": "xxxx xxxx xxxx xxxx",
      "company_reference_name": "ComproPago",
      "company_reference_number": "",
      "company_bank_number": "",
      "order_reference_number": "",
      "bank_account_holder_name": "ComproPago SAPI de CV",
      "bank_reference": "",
      "bank_name": "Banorte"
    }
  },
  "api_version": "1.1",
}

  • Es importante tomar en cuenta lo siguiente:

    • Para pagos en SEVEN_ELEVEN, TELECOMM, WOOLWORTH, DEL_SOL, EXTRA, CIRCULO_K se maneja un convenio y una referencia.
    • Para el caso de OXXO, FARMACIA_ESQUIVAR, ELEKTRA, CASA_LEY, PITICO, FARMACIA_ABC si se maneja el campo bank_account_number donde viene el numero de tarjeta, ya que en estas opciones se proporcionan tarjetas a los clientes para que puedan realizar su pago y en bank_name viene el banco al que pertenece dicha tarjeta.
    • Para el caso de BANAMEX, BANCOMER, BANCOPPEL, BANORTE, SCOTIABANK, SANTANDER, INBURSA se maneja un pago referenciado a cuenta.
{
  "id": "ch_fe92a1a5-abec-49e3-877c-5024c1464dc3",
  "short_id": "asdqw23",
  "type": "charge.pending",
  "object": "charge",
  "created_at": 1424024955774,
  "accepted_at": null,
  "expires_at": 1424024065774,
  "paid": false,
  "amount": 150.00,
  "livemode": true,
  "currency": "mxn",
  "refunded": false,
  "fee": 7.50,
  "fee_details": {
    "amount": 7.50,
    "currency": "mxn",
    "type": "compropago_fee",
    "application": null,
    "amount_refunded": 0,
    "tax": 0.94
  },
  "order_info": {
    "order_id": "SMGCURL1",
    "order_price": 150.00,
    "order_name": "SAMSUNG GOLD CURL",
    "payment_method": "cash",
    "store": "SEVEN_ELEVEN",
    "country": "MX",
    "image_url": null,
    "success_url": null,
    "failed_url": null,
    "exchange": {
      "rate": 1,
      "request": 1485224234,
      "origin_amount": "150.0",
      "final_amount": "150.0",                   
      "origin_currency": "MXN",
      "final_currency": "MXN",
      "exchange_id": null 
    }             
  },
  "customer": {
    "customer_name": "Alejandra Leyva",
    "customer_email": "noreply@compropago.com",
    "customer_phone": "2221515801"
  },
  "instructions": {
    "description": "Para que el pago sea valido debes pagar ...",
    "step_1": "Solicite un pago en 7Eleven al Convenio Banorte: ...",
    "step_2": "Destinatario: ComproPago.  Referencia: ...",
    "step_3": "Deposite la cantidad exacta de: ...",
    "note_extra_comition": "Las tiendas 7Eleven cobran en caja una comisión de $8.00...",
    "note_expiration_date": "Orden válida antes de 14/12/2016, en caso de vencimiento...",
    "note_confirmation": "Tu pago será confirmado a través de SMS y correo electronico...",
    "details": {
      "payment_amount": "75.0",
      "payment_store": "SEVEN_ELEVEN",
      "amount": "75.0",
      "store": "SEVEN_ELEVEN",
      "bank_account_number": "xxxx xxxx xxxx xxxx",
      "company_reference_name": "ComproPago",
      "company_reference_number": "2955",
      "company_bank_number": "2955",
      "order_reference_number": "17580127",
      "bank_account_holder_name": "ComproPago SAPI de CV",
      "bank_reference": "17580127",
      "bank_name": "Banorte"
    }
  },
  "api_version": "1.1",
}
{
  "id": "ch_fe92a1a5-abec-49e3-877c-5024c1464dc3",
  "short_id": "asdqw23",
  "type": "charge.pending",
  "object": "charge",
  "created_at": 1424024955774,
  "accepted_at": null,
  "expires_at": 1424024065774,
  "paid": false,
  "amount": 150.00,
  "livemode": true,
  "currency": "mxn",
  "refunded": false,
  "fee": 7.50,
  "fee_details": {
    "amount": 7.50,
    "currency": "mxn",
    "type": "compropago_fee",
    "application": null,
    "amount_refunded": 0,
    "tax": 0.94
  },
  "order_info": {
    "order_id": "SMGCURL1",
    "order_price": 150.00,
    "order_name": "SAMSUNG GOLD CURL",
    "payment_method": "cash",
    "store": "SEVEN_ELEVEN",
    "country": "MX",
    "image_url": null,
    "success_url": null,
    "failed_url": null,
    "exchange": {
      "rate": 1,
      "request": 1485224234,
      "origin_amount": "150.0",
      "final_amount": "150.0",                   
      "origin_currency": "MXN",
      "final_currency": "MXN",
      "exchange_id": null 
    }             
  },
  "customer": {
    "customer_name": "Alejandra Leyva",
    "customer_email": "noreply@compropago.com",
    "customer_phone": "2221515801"
  },
  "instructions":{
    "description": "Para que el pago sea válido debes pagar la cantidad exacta de $9.0",
    "step_1": "Ir a la caja 7Eleven de 8:00 am a 8:00 pm",
    "step_2": "Solicitar depósito bancario al número: Scotiabank 5579 2090 9025 5362",
    "step_3": "Deposite la cantidad exacta de: $9.0",
    "note_extra_comition": "Las tiendas 7Eleven cobran en caja una comisión de $9.00...",
    "note_expiration_date": "Orden válida antes de 14/12/2016, en caso de vencimiento...",
    "note_confirmation": "Tu pago será confirmado a través de SMS y correo electronico...",
    "details":{
      "payment_amount": "75.0",
      "payment_store": "SEVEN_ELEVEN",
      "amount": "75.0",
      "store": "SEVEN_ELEVEN",
      "bank_account_number": "5579 2090 9025 5362",
      "company_reference_name": "ComproPago",
      "company_reference_number": "",
      "company_bank_number": "",
      "order_reference_number": "8834A6",
      "bank_account_holder_name": "ComproPago SAPI de CV",
      "bank_reference": "8834A6",
      "bank_name": "Banorte"
    }
  },
  "api_version": "1.1",
}
{
  "id": "ch_fe92a1a5-abec-49e3-877c-5024c1464dc3",
  "short_id": "asdqw23",
  "type": "charge.pending",
  "object": "charge",
  "created_at": 1424024955774,
  "accepted_at": null,
  "expires_at": 1424024065774,
  "paid": false,
  "amount": 150.00,
  "livemode": true,
  "currency": "mxn",
  "refunded": false,
  "fee": 7.50,
  "fee_details": {
    "amount": 7.50,
    "currency": "mxn",
    "type": "compropago_fee",
    "application": null,
    "amount_refunded": 0,
    "tax": 0.94
  },
  "order_info": {
    "order_id": "SMGCURL1",
    "order_price": 150.00,
    "order_name": "SAMSUNG GOLD CURL",
    "payment_method": "cash",
    "store": "SEVEN_ELEVEN",
    "country": "MX",
    "image_url": null,
    "success_url": null,
    "failed_url": null,
    "exchange": {
      "rate": 1,
      "request": 1485224234,
      "origin_amount": "150.0",
      "final_amount": "150.0",                   
      "origin_currency": "MXN",
      "final_currency": "MXN",
      "exchange_id": null 
    }             
  },
  "customer": {
    "customer_name": "Alejandra Leyva",
    "customer_email": "noreply@compropago.com",
    "customer_phone": "2221515801"
  },
  "instructions":{
    "description": "Para que el pago sea válido debes pagar la cantidad exacta de $9.0",
    "step_1": "Solicite un Depósito Referenciado en ventanilla de una sucursal BanCoppel",
    "step_2": "Destinatario: ComproPago SAPI de CV.Cuenta:120 0000 1978.Referencia: cd381a",
    "step_3": "Deposite la cantidad exacta de: $9.0",
    "note_extra_comition": "",
    "note_expiration_date": "Orden válida antes de 14/12/2016, en caso de vencimiento...",
    "note_confirmation": "Tu pago será confirmado a través de SMS y correo electronico...",
    "details":{
      "payment_amount": "75.0",
      "payment_store": "Coppel",
      "amount": "75.0",
      "store": "7Eleven",
      "bank_account_number": "",
      "company_reference_name": "ComproPago",
      "company_reference_number": "101 2087 7572",
      "company_bank_number": "101 2087 7572",
      "order_reference_number": "CD381A",
      "bank_account_holder_name": "ComproPago SAPI de CV",
      "bank_reference": "CD381A",
      "bank_name": "BanCoppel"
    }
  },
  "api_version": "1.1",
}

Verificar Cargo - 16/Jun/15

Cambio a la respuesta de verificación de un cargo.

  • El atributo created cambio a created_at y regresa la fecha en formato de segundos.
  • Se agrego atributo failure_url al objeto order_info
  • Se agrego atributo created_at y regresa la fecha en formato de segundos.
  • Se agrego atributo expires_at y regresa la fecha en formato de segundos.
  • Se agrego el campo short_id que tendra el folio de la orden.
  • Se eliminaron los siguientes atributos:
    • captured
    • failure_message
    • failure_code
    • amount_refunded
    • description
    • dispute

{
  "id": "ch_fe92a1a5-abec-49e3-877c-5024c1464dc3",
  "short_id": "asdqw23",
  "type": "charge.pending",
  "object": "charge",
  "created_at": 1424024955774,
  "accepted_at": null,
  "expires_at": 1424024065774,
  "paid": false,
  "amount": 150.00,
  "livemode": true,
  "currency": "mxn",
  "refunded": false,
  "fee": 7.50,
  "fee_details": {
    "amount": 7.50,
    "currency": "mxn",
    "type": "compropago_fee",
    "application": null,
    "amount_refunded": 0,
    "tax": 0.94
  },
  "order_info": {
    "order_id": "SMGCURL1",
    "order_price": 150.00,
    "order_name": "SAMSUNG GOLD CURL",
    "payment_method": "cash",
    "store": "SEVEN_ELEVEN",
    "country": "MX",
    "image_url": null,
    "success_url": null,
    "failed_url": null,
    "exchange": {
      "rate": 1,
      "request": 1485224234,
      "origin_amount": "150.0",
      "final_amount": "150.0",                   
      "origin_currency": "MXN",
      "final_currency": "MXN",
      "exchange_id": null 
    }             
  },
  "customer": {
    "customer_name": "Alejandra Leyva",
    "customer_email": "noreply@compropago.com",
    "customer_phone": "2221515801"
  },
  "api_version": "1.1"
}
{
  "id": "ch_fe92a1a5-abec-49e3-877c-5024c1464dc3",
  "type": "charge.pending",
  "object": "charge",
  "created": "1424024955774",
  "paid": true,
  "amount": "150.00",
  "livemode": true,
  "currency": "mxn",
  "refunded": false,
  "fee": "7.50",
  "fee_details": {
    "amount": "7.50",
    "currency": "mxn",
    "type": "compropago_fee",
    "description": "Honorarios de ComproPago",
    "application": null,
    "amount_refunded": 0,
    "tax": "0.944" 
  },
  "order_info": {
    "order_id": "SMGCURL1",
    "order_price": "150.00",
    "order_name": "SAMSUNG GOLD CURL",
    "payment_method": "cash",
    "store": "SEVEN_ELEVEN",
    "country": "MX",
    "image_url": "https://test.amazon.com/5f4373",
    "success_url": "",
    "exchange": {
      "rate": 1,
      "request": 1485224234,
      "origin_amount": "75.0",
      "final_amount": "75.0",
      "origin_currency": "MXN",
      "final_currency": "MXN",
      "exchange_id": null 
    }
  },
  "customer": {
    "customer_name": "Alejandra Leyva",
    "customer_email": "noreply@compropago.com",
    "customer_phone": "2221515801" 
  },
  "captured": true,
  "failure_message": null,
  "failure_code": null,
  "amount_refunded": 0,
  "description": "Estado del pago - ComproPago",
  "dispute": null,
  "api_version": "1.1" 
}

Instrucciones SMS - 16/Jun/15

Cambio la respuesta que se recibe al enviar un sms.

  • Se regresa en el objeto data un objeto de tipo charge con sus respectivas propiedades id y short_id.

{
  "type": "sms.success",
  "object": "event",
  "data": {
    "object": {
      "id": "ch_f4172ff7-9125-4206-99c7-151480",
      "object": "charge",
      "short_id": "04c651" 
    }
  }
}
{
  "type": "charge_sms.success",
  "object": "event",
  "payment": {
    "id": "f4172ff7-9125-4206-99c7-151480",
    "short_id": "04c651" 
  }
}

Webhooks - 10/Jun/17

Cambio la respuesta del objeto Webhook.

{
  "id": "ch_fe92a1a5-abec-49e3-877c-5024c1464dc3",
  "short_id": "asdqw23",
  "type": "charge.pending",
  "object": "charge",
  "created_at": 1424024955774,
  "accepted_at": null,
  "expires_at": 1424024065774,
  "paid": false,
  "amount": 150.00,
  "livemode": true,
  "currency": "mxn",
  "refunded": false,
  "fee": 7.50,
  "fee_details": {
    "amount": 7.50,
    "currency": "mxn",
    "type": "compropago_fee",
    "application": null,
    "amount_refunded": 0,
    "tax": 0.94
  },
  "order_info": {
    "order_id": "SMGCURL1",
    "order_price": 150.00,
    "order_name": "SAMSUNG GOLD CURL",
    "payment_method": "cash",
    "store": "SEVEN_ELEVEN",
    "country": "MX",
    "image_url": null,
    "success_url": null,
    "failed_url": null,
    "exchange": {
      "rate": 1,
      "request": 1485224234,
      "origin_amount": "150.0",
      "final_amount": "150.0",                   
      "origin_currency": "MXN",
      "final_currency": "MXN",
      "exchange_id": null 
    }             
  },
  "customer": {
    "customer_name": "Alejandra Leyva",
    "customer_email": "noreply@compropago.com",
    "customer_phone": "2221515801"
  },
  "api_version": "1.1"
}
{
  "id": "ch_fe92a1a5-abec-49e3-877c-5024c1464dc3",
  "type": "charge.pending",
  "object": "charge",
  "created": "1424024955774",
  "paid": true,
  "amount": "150.00",
  "livemode": true,
  "currency": "mxn",
  "refunded": false,
  "fee": "7.50",
  "fee_details": {
    "amount": "7.50",
    "currency": "mxn",
    "type": "compropago_fee",
    "description": "Honorarios de ComproPago",
    "application": null,
    "amount_refunded": 0,
    "tax": "0.944" 
  },
  "order_info": {
    "order_id": "FBIPC5",
    "order_price": "1000.00",
    "order_name": "Nokia 5520",
    "payment_method": "cash",
    "store": "SEVEN_ELEVEN",
    "country": "MX",
    "image_url": "https://test.amazon.com/5f4373",
    "success_url": "https://mystore.com/success-url",
    "exchange": {
      "rate": 1,
      "request": 1485224234,
      "origin_amount": "75.0",     
      "final_amount": "75.0",                
      "origin_currency": "MXN",
      "final_currency": "MXN",
      "exchange_id": null,
    }
  },
  "customer": {
    "customer_name": "Alejandra Leyva",
    "customer_email": "noreply@compropago.com",
    "customer_phone": "2221515801" 
  },
  "captured": true,
  "failure_message": null,
  "failure_code": null,
  "amount_refunded": 0,
  "description": "Estado del pago - ComproPago",
  "dispute": null,
  "api_version": "1.1"
}