Foro
En SuccessUrl no se puede obtener los datos de la transaccion con charge_id
Hola, cuando se realiza un pago con tarjeta, en mi acción SuccessUrl obtengo los datos de la orden con https://developers.conekta.com/reference/getorderbyid eso me devuelve el json que pongo más adelante, donde se ve que el estatus del pago es pagado, pero si en el SuccessUrl intento obtener los datos de la transacción con https://developers.conekta.com/reference/gettransactions filtrándolas por charge_id no encuentra ninguna transacción, entre 10 y 15 segundos después que fui redirigido a SuccessUrl se recibe el webhook charge.paid, en este punto si consulto la transacción ya obtiene los datos.
La pregunta es porque no puedo obtener los datos de la transacción en el SuccessUrl cuando la orden ya está pagada sin tener que esperar al webhook charge.paid???
{
"livemode": false,
"amount": 248000,
"currency": "MXN",
"payment_status": "paid",
"amount_refunded": 0,
"split_payment": null,
"customer_info": {
"email": "[email protected]",
"phone": "8331111111",
"name": "Omar",
"corporate": false,
"customer_id": "cus_2udimhRFsexircbTr",
"object": "customer_info",
"customer_custom_reference": "1"
},
"shipping_contact": null,
"channel": {
"segment": "Checkout",
"checkout_request_id": "f5b577bd-436d-4df7-8636-9cf2a47fd8cf",
"checkout_request_type": "HostedPayment",
"id": "channel_2vRmEC2hBihm19dxA"
},
"fiscal_entity": null,
"checkout": {
"id": "f5b577bd-436d-4df7-8636-9cf2a47fd8cf",
"name": "Curso",
"livemode": false,
"emails_sent": 0,
"success_url": "https://localhost:5001/s/p/conekta-payment-status",
"failure_url": "https://localhost:5001/s/p/conekta-payment-status",
"payments_limit_count": null,
"paid_payments_count": 0,
"sms_sent": 0,
"status": "Issued",
"type": "HostedPayment",
"recurrent": false,
"starts_at": 1707976800,
"expires_at": 1708017281,
"allowed_payment_methods": [ "card", "bank_transfer", "cash" ],
"exclude_card_networks": [],
"needs_shipping_contact": false,
"monthly_installments_options": [ 3, 6 ],
"monthly_installments_enabled": true,
"redirection_time": 30,
"force_3ds_flow": false,
"plan_id": null,
"metadata": {},
"can_not_expire": false,
"object": "checkout",
"is_redirect_on_failure": true,
"slug": "f5b577bd436d4df786369cf2a47fd8cf",
"url": "https://pay.conekta.com/checkout/f5b577bd436d4df786369cf2a47fd8cf"
},
"object": "order",
"id": "ord_2vRmEC2hBihm19dx9",
"metadata": {
"customer_IDCuenta": "1"
},
"is_refundable": true,
"processing_mode": null,
"created_at": 1708009911,
"updated_at": 1708009922,
"line_items": {
"object": "list",
"has_more": false,
"total": 2,
"data": [
{
"name": "Libro",
"description": "Libro",
"unit_price": 59000,
"quantity": 1,
"sku": null,
"tags": null,
"brand": null,
"type": null,
"object": "line_item",
"id": "line_item_2vRmEC2hBihm19dx6",
"parent_id": "ord_2vRmEC2hBihm19dx9",
"metadata": {},
"antifraud_info": {}
},
{
"name": "Curso",
"description": "Curso",
"unit_price": 162931,
"quantity": 1,
"sku": null,
"tags": null,
"brand": null,
"type": null,
"object": "line_item",
"id": "line_item_2vRmEC2hBihm19dx5",
"parent_id": "ord_2vRmEC2hBihm19dx9",
"metadata": {},
"antifraud_info": {}
}
]
},
"shipping_lines": null,
"tax_lines": {
"object": "list",
"has_more": false,
"total": 1,
"data": [
{
"description": "IVA",
"amount": 26069,
"object": "tax_line",
"id": "tax_lin_2vRmEC2hBihm19dx7",
"parent_id": "ord_2vRmEC2hBihm19dx9",
"metadata": null
}
]
},
"discount_lines": null,
"charges": {
"object": "list",
"has_more": false,
"total": 1,
"data": [
{
"id": "65ce29c1ceda440027dc7fc1",
"livemode": false,
"created_at": 1708009921,
"currency": "MXN",
"failure_code": null,
"failure_message": null,
"monthly_installments": null,
"device_fingerprint": "dc9b091a8d4dbe14352e0fe46016147e",
"channel": {
"segment": "Checkout",
"checkout_request_id": "f5b577bd-436d-4df7-8636-9cf2a47fd8cf",
"checkout_request_type": "HostedPayment",
"id": "channel_2vRmEKjXAWxV56LwQ"
},
"payment_method": {
"name": "omar",
"exp_month": "12",
"exp_year": "30",
"auth_code": "196595",
"object": "card_payment",
"type": "credit",
"normalized_device_fingerprint": null,
"last4": "5100",
"brand": "mastercard",
"issuer": "banorte_pr",
"account_type": "BANORTE",
"contract_id": null,
"country": "MX",
"fraud_score": null,
"fraud_indicators": [],
"token_id": "tok_2vRmEKGe1Hd1EsFiA",
"antifraud_is_self_service_rules": false
},
"object": "charge",
"description": "Payment from order",
"is_refundable": true,
"reference_id": null,
"status": "paid",
"amount": 248000,
"paid_at": 1708009922,
"customer_id": "cus_2udimhRFsexircbTr",
"order_id": "ord_2vRmEC2hBihm19dx9",
"customer_custom_reference": "1",
"refunds": null
}
]
}
}