Realizar el pago con el SDK de Checkout Transparente

Para completar el pago, deberás consumir nuestro endpoint de POST /Payments desde tu backend usando el token obtenido anteriormente a través del SDK. No olvides agregándole el prefijo "Bearer" a tu API Key para autenticarte, como se muestra en el siguiente ejemplo:

❗️

IMPORTANTE: Esta llamada la tienes que hacer desde tu back-end por seguridad de tus datos.


curl --location 'https://api.payclip.com/payments' \
--header 'Authorization: Bearer 8bef80-f3d1-443f-a054-8e445a8614' \ //Aquí va el prefijo Bearer seguido de tu api key.
--header 'Content-Type: application/json' \
--data-raw '{
    "amount": 0.01,
    "currency": "MXN",
    "description": "Prueba Checkout Transparente",
    "payment_method": {
        "token": "0915e7-f6f-862-89e-0c5d71ae6"
    },
    "customer": {
        "email": "[email protected]",
        "phone": "5555555555"
    }
}'

Respuesta

El siguiente código muestra un ejemplo de una respuesta exitosa de pago:


{
"id": "363330-2ced-4e22-a6db-d652e1b75f",
"amount": 1,
"tip_amount": 0,
"amount_refunded": 0,
"installment_amount": 1,
"installments": 1,
"capture_method": "automatic",
"net_amount": 1,
"paid_amount": 1,
"captured_amount": 1,
"binary_mode": false,
"approved_at": "2024-06-05T17:24:12.591424068Z",
"country": "MX",
"currency": "MXN",
"description":"Descripción de ejemplo",
"external_reference": "",
"customer": {
"address": {
"country": "",
"postal_code": "",
"state": "",
"city": "",
"colony": "",
"street": "",
"number": ""
},
"description": "",
"email": "[email protected]",
"first_name": "",
"identification": {
"id": "",
"type": ""
},
"last_name": "",
"phone": "5555555555"
},
"payment_method": {
"id": "prepaid_visa",
"type": "prepaid_card",
"card": {
"bin": "111111",
"issuer": "CIBANCO PR",
"name": "John Doe",
"country": "MX",
"last_digits": "2222",
"exp_year": "29",
"exp_month": "12"
},
"token": "b4f64a4-fc60-4613-ac79-9b3b0b5bd"
},
"pending_action": {},
"receipt_no": "IC3mzA",
"claims": [],
"refunds": [],
"statement_descriptor": "",
"status": "approved",
"status_detail": {
"code": "AP-PAI01",
"message": "paid"
},
"metadata": {},
"return_url": "",
"webhook_url": "",
"created_at": "2024-06-05T17:24:12.591427708Z",
"version": 0
}



Status Y Status_detail

Al realizar un pago a través del endpoint de POST/payments reibirás los siguientes parámetros:

"status": "approved",
    "status_detail": {
        "code": "AP-PAI01",
        "message": "paid"
    }

En el parámetro “status” encontrarás el estado del pago. Los posibles valores son los siguientes:

  • Approved: El pago fue aprobado.
  • Refunded: El pago fue reembolsado.
  • Cancelled: El pago no prospero desde un estado pendiente o autorizado.
  • Rejected: El pago fue rechazado.
  • Authorized: El pago fue autorizado pero no se ha hecho el cargo.
  • Pending: El pago quedó pendiente de una acción a realizar para que prospere. Ej. Falta la autenticación 3DS.

Dentro del objeto “status_detail” podrás encontrar un código y un mensaje proporcionando más detalles acerca del status del pago.

A continuación se muestra una tabla con todos los posibles códigos y mensajes posibles:

Status

Code

Message

approved

AP-PAI01

Paid

approved

AP-REF01

Partially refunded

refunded

RE-REF01

Refunded

authorized

AU-CAP01

Pending capture

cancelled

CA-AUT01

Cancelled

cancelled

CA-MAN01

Cancelled

cancelled

CA-MER01

Cancelled

rejected

RE-BIN01

Rejected

rejected

RE-ERI03

Rejected

rejected

RE-3DS01

Fail 3DS authentication

rejected

RE-CHI01

Rejected

rejected

RE-ISS01

Not sufficient funds

rejected

RE-ISS02

Do not honour

rejected

RE-ISS03

Restricted card

rejected

RE-ISS04

Reserved for private use

rejected

RE-ISS05

Transaction not permitted to cardholder

rejected

RE-ISS06

Pick-up card

rejected

RE-ISS07

Expired card

rejected

RE-ISS08

Exceeds withdrawal amount limit

rejected

RE-ISS09

Invaliad pin (one time)

rejected

RE-ISS10

Allowable number of pin tries exceeded

rejected

RE-ISS11

Refer to card issuer

rejected

RE-ISS12

Invalid amount

rejected

RE-ISS13

Destination not available (Issuer offline)

rejected

RE-ISS14

Issuer or switch is inoperative

rejected

RE-ISS15

Visa/mc fallback

rejected

RE-ISS16

Invalid card number (no such number)

rejected

RE-ISS17

Invalid merchant

rejected

RE-ISS18

Invalid transaction

rejected

RE-ISS19

Rejected

rejected

RE-ISS20

Rejected

rejected

RE-ISS99

Generic error

pending

PE-EMV01

Waiting emv

pending

PE-SIG01

Waiting signature

pending

PE-3DS01

Waiting 3DS

pending

PE-TIC01

Waiting payment