En este artículo mostramos como obtener la información del pago realizado por el comprador en la venta.
Esta información la obtenemos mediante los siguiente Endpoint que tenemos disponible dentro de nuestro Servicios de Integración de Multivende.
Obtener la información del pago de una venta
- Get checkout: Adicional a obtener los detalles de una venta, tales como datos del cliente y facturación puedes encontrar los detalles del pago consultando el campo "CheckoutPayments" aquí podrás visualizar los métodos de pago utilizados en la venta.
Ejemplo Response:
"CheckoutPayments": [
{
"_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
"code": "xxxxxxxxxxx",
"amount": 59600,
"amountPaid": 59600,
"change": 0,
"paymentStatus": "completed",
"authorizationCode": null,
"detail": null,
"status": "created",
"verificationStatus": "verified",
"cardNumber": null,
"installments": 1,
"datePaid": null,
"dateVerificated": null,
"createdAt": "2021-05-10T18:31:28.000Z",
"updatedAt": "2021-05-10T18:51:23.000Z",
"CreatedById": null,
"UpdatedById": null,
"CheckoutId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
"PaymentMethodId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
"CurrencyId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
"MerchantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
"PaymentMethod": {
"_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
"tags": "{\n \"requiresTransaction\": false\n }",
"code": "_payment_methods_online_payment",
"name": "PAYMENT_METHODS.Online_payment.Name",
"description": "PAYMENT_METHODS.Online_payment.Description",
"position": 12,
"status": "created",
"createdAt": null,
"updatedAt": null,
"codeTranslated": "Pago en línea"
},
"CheckoutPaymentLinks": [
{
"_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
"externalId": "xxxxxxxxxxx",
"transactionId": "xxxxxxxxxxx",
"externalContent": "",
"synchronizationStatus": "synchronized",
"status": "created",
"createdAt": "2021-05-10T18:31:28.000Z",
"updatedAt": "2021-05-10T18:31:28.000Z",
"CreatedById": null,
"UpdatedById": null,
"MarketplaceConnectionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
"MerchantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
"CheckoutPaymentId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"
}
]
}
]
Métodos de Pago
- Get checkout payment methods: Se detallan los métodos de pago asociados a la cuenta del Merchant, enviando dentro del Request el MerchantId se listará el ID del método de pago, nombre, descripción, entre otros. Los cuales son estándar para todos los merchants de Multivende y puedes dejarlos preconfigurados al realizar la integración para homologarlos con los de la aplicación.
Ejemplo Response
[
{
"_id": "a4135228-a10c-11e6-bfdf-2c56dc130c0d",
"tags": "{\n \"requiresTransaction\": false\n}",
"code": "_payment_methods_cash",
"name": "PAYMENT_METHODS.Cash.Name",
"description": "PAYMENT_METHODS.Cash.Description",
"position": 0,
"status": "created",
"createdAt": null,
"updatedAt": null
},
{
"_id": "0f5b5e2f-a10d-11e6-bfdf-2c56dc130c0d",
"tags": "{\n \"requiresTransaction\": true\n}",
"code": "_payment_methods_credit_card",
"name": "PAYMENT_METHODS.Credit_card.Name",
"description": "PAYMENT_METHODS.Credit_card.Description",
"position": 1,
"status": "created",
"createdAt": null,
"updatedAt": null
},
{
"_id": "a41369d7-a10c-11e6-bfdf-2c56dc130c0d",
"tags": "{\n \"requiresTransaction\": true\n}",
"code": "_payment_methods_debit_card",
"name": "PAYMENT_METHODS.Debit_card.Name",
"description": "PAYMENT_METHODS.Debit_card.Description",
"position": 2,
"status": "created",
"createdAt": null,
"updatedAt": null
},
]
Actualizar información del pago de una venta
- Update checkout payment: Te permite actualizar los detalles de un pago, no es obligatorio enviar todos los campos del cuerpo. Solo se deben enviar aquellos que necesitan ser actualizados.
Los valores permitidos para enviar dentro del campo “verificationStatus” es "verified" o "pending"
Ejemplo Request:
curl --location -g --request PUT '{{base_url}}/api/checkout-payments/{{checkout_payment_id}}' \
--header 'Authorization: Bearer {{access_token}}' \
--data '{
"verificationStatus": "pending",
"authorizationCode": 12345,
"detail": "detail",
"cardNumber": 1234567,
"installments": 12
}'
Ejemplo Response
{
"_id": "d14833f3-f8c0-4287-a7ba-ee375fabfc2b",
"code": "14514653588",
"amount": 4990,
"amountPaid": 4990,
"change": 0,
"paymentStatus": "completed",
"authorizationCode": 12345,
"detail": "detail",
"status": "created",
"verificationStatus": "pending",
"cardNumber": 1234567,
"installments": 12,
"datePaid": null,
"dateVerificated": null,
"createdAt": "2021-04-19T16:44:58.000Z",
"updatedAt": "2021-11-10T19:23:07.000Z",
"CreatedById": null,
"UpdatedById": "644e493e-b3fa-4639-946e-7b47b90ad6f6",
"CheckoutId": "60a813c9-a16f-4215-949f-d64fda865f24",
"PaymentMethodId": "7a2f09c3-f7a2-11e7-96a2-2c56dc130c0d",
"PaymentGatewayId": null,
"CurrencyId": "5e402b2b-bb2e-46fd-9bda-8dd9f62d3a31",
"MerchantId": "156bd2c4-13b9-46c0-9e91-349ec8cfeab8"
}
Si tienes dudas sobre este tema contáctanos a través de api@multivende.com y estaremos felices de ayudarte.
Equipo Integraciones API Multivende