Skip to content

Commit

Permalink
Merge pull request Redocly#7 from KUBBESA/eCommerce
Browse files Browse the repository at this point in the history
Adding eCommerce cancel and create documentation
  • Loading branch information
rjaramillo21 authored Apr 24, 2024
2 parents f387dd0 + b61bcf6 commit acc10b7
Show file tree
Hide file tree
Showing 2 changed files with 266 additions and 23 deletions.
231 changes: 215 additions & 16 deletions crediviva.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -658,12 +658,104 @@ paths:
- api_key:
- "leer: desembolso"
- "escribir: desembolso"
/integrations/e-commerce/orders:
post:
tags:
- e-Commerce
summary: Crear orden
description: "Este recurso crea una orden."
operationId: e-commerce-orders-create
requestBody:
$ref: "#/components/requestBodies/eCommerceOrdersCreateOrder"
responses:
"200":
description: Operación exitosa
content:
application/json:
schema:
$ref: "#/components/schemas/eCommerceOrdersCreateResponse"
"400":
description: Sin autenticación
content:
application/json:
schema:
$ref: "#/components/schemas/eCommerceOrdersCreateResponse400"
"401":
description: Sin autenticación
content:
application/json:
schema:
$ref: "#/components/schemas/eCommerceOrdersResponse401"
"403":
description: Sin autorización
content:
application/json:
schema:
$ref: "#/components/schemas/eCommerceOrdersResponse403"
"500":
description: Error de Servidor
content:
application/json:
schema:
$ref: "#/components/schemas/eCommerceOrdersResponse500"
security:
- API-Key:
- "Escritura: Crear una orden"
/integrations/e-commerce/orders/cancel:
post:
tags:
- e-Commerce
summary: Cancelar orden
description: "Este recurso cancela una orden."
operationId: e-commerce-orders-cancel
requestBody:
$ref: "#/components/requestBodies/eCommerceOrdersCancel"
responses:
"200":
description: Operación exitosa
content:
application/json:
schema:
$ref: "#/components/schemas/eCommerceOrdersCancelResponse"
"400":
description: Sin autenticación
content:
application/json:
schema:
$ref: "#/components/schemas/eCommerceOrdersCancelResponse400"
"401":
description: Sin autenticación
content:
application/json:
schema:
$ref: "#/components/schemas/eCommerceOrdersResponse401"
"403":
description: Sin autorización
content:
application/json:
schema:
$ref: "#/components/schemas/eCommerceOrdersResponse403"
"404":
description: Orden no encontrada
content:
application/json:
schema:
$ref: "#/components/schemas/eCommerceOrdersResponse404"
"500":
description: Error de Servidor
content:
application/json:
schema:
$ref: "#/components/schemas/eCommerceOrdersResponse500"
security:
- API-Key:
- "Escritura: Cancelar una orden"
/integrations/e-commerce/orders/status:
post:
tags:
- e-Commerce
summary: Status de transacción
description: "Este recurso retorna el estado de una transacción."
summary: Estado de la orden
description: "Este recurso retorna el estado de una orden."
operationId: e-commerce-orders-status
requestBody:
$ref: "#/components/requestBodies/eCommerceOrdersStatus"
Expand All @@ -685,28 +777,28 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/eCommerceOrdersStatusResponse401"
$ref: "#/components/schemas/eCommerceOrdersResponse401"
"403":
description: Sin autorización
content:
application/json:
schema:
$ref: "#/components/schemas/eCommerceOrdersStatusResponse403"
$ref: "#/components/schemas/eCommerceOrdersResponse403"
"404":
description: Transacción no encontrada
content:
application/json:
schema:
$ref: "#/components/schemas/eCommerceOrdersStatusResponse404"
$ref: "#/components/schemas/eCommerceOrdersResponse404"
"500":
description: Error de Servidor
content:
application/json:
schema:
$ref: "#/components/schemas/eCommerceOrdersStatusResponse500"
$ref: "#/components/schemas/eCommerceOrdersResponse500"
security:
- API-Key:
- "Lectura: Estado de transacción"
- "Lectura: Ver Estado de una orden"
components:
schemas:
qrResponse:
Expand Down Expand Up @@ -1446,53 +1538,146 @@ components:
enum:
- ACTIVO
- INACTIVO
e-commerce-orders-status:
eCommerceOrdersStatus:
type: object
required:
- externalOrderId
properties:
externalOrderId:
type: string
description: ID único externo de la transacción del comercio
description: ID único externo de la orden del comercio
example: "123456-ABCDE"
eCommerceOrdersStatusResponse:
type: object
properties:
externalOrderId:
type: string
example: 123456-ABCDE
status:
type: string
enum:
- ACTIVE
- APPROVED
- CANCELLED
- EXPIRED
- PENDING
- IN_PROGRESS
- REJECTED
eCommerceOrdersStatusResponse400:
type: object
properties:
message:
type: string
example: "Parámetro externalOrderId no suministrado"
eCommerceOrdersStatusResponse401:
eCommerceOrdersCreate:
type: object
required:
- amount
- commerceId
- externalOrderId
- callbackUrl
- callbackBody
properties:
amount:
type: number
description: Monto total de la orden.
example: 100
commerceId:
type: string
description: ID del comercio.
example: "123ABC"
externalOrderId:
type: string
description: ID único externo de la orden del comercio
example: "123456-ABCDE"
callbackUrl:
type: string
description: Callback URL de notificación de eventos
example: "https://example.com/event"
callbackBody:
type: string
description: Payload para el callback URL
example: { id: "externalOrderId", event: "success" }
eCommerceOrdersCreateResponse:
type: object
properties:
commerce:
type: string
example: "123ABC"
externalOrderId:
type: string
example: "123456-ABCDE"
amount:
type: number
example: 100
status:
type: string
example: "IN_PROGRESS"
redirectUrl:
type: string
example: "https://client.crediviva.com.pa/integrations/123ABC/orders/123456-ABCDE"
eCommerceOrdersCreateResponse400:
type: object
properties:
message:
type: string
example: "Parámetro externalOrderId no suministrado"
eCommerceOrdersCancel:
type: object
required:
- commerceId
- externalOrderId
properties:
commerceId:
type: string
description: ID del comercio.
example: "123ABC"
externalOrderId:
type: string
description: ID único externo de la orden del comercio
example: "123456-ABCDE"
eCommerceOrdersCancelResponse:
type: object
properties:
commerce:
type: string
example: "123ABC"
externalOrderId:
type: string
example: "123456-ABCDE"
amount:
type: number
example: 100
status:
type: string
example: "CANCELLED"
cancelledBy:
type: string
example: "E-COMMERCE"
eCommerceOrdersCancelResponse400:
type: object
properties:
message:
type: string
example: "Parámetro externalOrderId no suministrado"
eCommerceOrdersResponse401:
type: object
properties:
message:
type: string
example: "API-Key no suministrado"
eCommerceOrdersStatusResponse403:
eCommerceOrdersResponse403:
type: object
properties:
message:
type: string
example: "Acceso denegado"
eCommerceOrdersStatusResponse404:
eCommerceOrdersResponse404:
type: object
properties:
message:
type: string
example: "Transacción no encontrada"
eCommerceOrdersStatusResponse500:
example: "Orden no encontrada"
eCommerceOrdersResponse500:
type: object
properties:
message:
Expand All @@ -1506,13 +1691,27 @@ components:
description: QR
title: "Request Body"
$ref: "#/components/schemas/Qr"
eCommerceOrdersCreateOrder:
content:
application/json:
schema:
description: e-commerce-orders-create
title: "Request Body"
$ref: "#/components/schemas/eCommerceOrdersCreate"
eCommerceOrdersCancel:
content:
application/json:
schema:
description: e-commerce-orders-cancel
title: "Request Body"
$ref: "#/components/schemas/eCommerceOrdersCancel"
eCommerceOrdersStatus:
content:
application/json:
schema:
description: e-commerce-orders-status
title: "Request Body"
$ref: "#/components/schemas/e-commerce-orders-status"
$ref: "#/components/schemas/eCommerceOrdersStatus"
invoice:
content:
application/json:
Expand Down
Loading

0 comments on commit acc10b7

Please sign in to comment.