diff --git a/Dockerfile b/Dockerfile index 62f38d7..f2cef5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM public.ecr.aws/docker/library/node:20 as builder +FROM public.ecr.aws/docker/library/node:24 AS builder -# Install OpenJDK-11 +# Install OpenJDK-17 RUN apt-get update && \ apt-get install -y openjdk-17-jre-headless && \ apt-get clean; diff --git a/_build/api.yaml b/_build/api.yaml index 3d49c81..797e190 100644 --- a/_build/api.yaml +++ b/_build/api.yaml @@ -16285,6 +16285,7 @@ components: type: string reason: enum: + - unrecognized - unauthorized - unauthorized_by_client - unrecognized_like_fraud @@ -18965,45 +18966,245 @@ components: example: cus_23874283647 type: string title: customer_info_response - order_tax_response: + discount_lines_data_response: allOf: - - description: create new taxes for an existing order + - allOf: + - description: List of discounts that apply to the order. + properties: + amount: + description: "The amount to be deducted from the total sum of all payments,\ + \ in cents." + example: 500 + format: int64 + minimum: 0 + type: integer + code: + description: Discount code. + example: "123" + type: string + type: + description: "It can be 'loyalty', 'campaign', 'coupon' o 'sign'" + example: loyalty + type: string + required: + - amount + - code + - type + title: order_discount_lines_request + name: order_discount_lines_request + - properties: + id: + description: The discount line id + example: dis_lin_2tQQ58HPgPw7StE8z + type: string + object: + description: The object name + example: discount_line + type: string + parent_id: + description: The order id + example: ord_2tPAmKCEJqh8RE6nY + type: string + required: + - id + - object + - parent_id + title: discount_lines_response + title: discount_lines_data_response + order_discount_lines_response: + allOf: + - description: pagination metadata properties: - amount: - description: The amount to be collected for tax in cents - example: 100 - format: int64 - minimum: 0 - type: integer - description: - description: description or tax's name - example: testing - minLength: 2 + has_more: + description: Indicates if there are more pages to be requested + example: false + type: boolean + object: + description: "Object type, in this case is list" + example: list type: string - metadata: - additionalProperties: true - example: - key: value - maxProperties: 100 - type: object required: - - amount - - description - title: order_tax_request + - has_more + - object + title: pagination metadata + - description: page metadata + properties: + next_page_url: + description: URL of the next page. + example: https://api.conekta.io/resources?limit=10&next=chrg_1 + type: string + nullable: true + previous_page_url: + description: Url of the previous page. + example: https://api.conekta.io/resources?limit=10&previous=chrg_1 + type: string + nullable: true + title: page metadata - properties: - id: - example: tax_lin_2tQ8dC5mg1UADmVPo + data: + items: + $ref: "#/components/schemas/discount_lines_data_response" + type: array + description: List of discounts that are applied to the order + title: order_discount_lines_response + nullable: true + tax_lines_data_response: + allOf: + - allOf: + - description: create new taxes for an existing order + properties: + amount: + description: The amount to be collected for tax in cents + example: 100 + format: int64 + minimum: 0 + type: integer + description: + description: description or tax's name + example: testing + minLength: 2 + type: string + metadata: + additionalProperties: true + example: + key: value + maxProperties: 100 + type: object + required: + - amount + - description + title: order_tax_request + - properties: + id: + example: tax_lin_2tQ8dC5mg1UADmVPo + type: string + object: + example: tax_line + type: string + parent_id: + example: ord_2tPAmKCEJqh8RE6nY + type: string + description: create new taxes for an existing order response + required: + - id + title: order_tax_response + title: tax_lines_data_response + order_tax_lines_response: + allOf: + - description: pagination metadata + properties: + has_more: + description: Indicates if there are more pages to be requested + example: false + type: boolean + object: + description: "Object type, in this case is list" + example: list + type: string + required: + - has_more + - object + title: pagination metadata + - description: page metadata + properties: + next_page_url: + description: URL of the next page. + example: https://api.conekta.io/resources?limit=10&next=chrg_1 type: string + nullable: true + previous_page_url: + description: Url of the previous page. + example: https://api.conekta.io/resources?limit=10&previous=chrg_1 + type: string + nullable: true + title: page metadata + - properties: + data: + items: + $ref: "#/components/schemas/tax_lines_data_response" + type: array + description: List of taxes that are applied to the order + title: order_tax_lines_response + nullable: true + shipping_lines_data_response: + allOf: + - allOf: + - properties: + amount: + description: Shipping amount in cents + example: 100 + format: int64 + minimum: 0 + type: integer + carrier: + description: Carrier name for the shipment + example: FEDEX + type: string + tracking_number: + description: Tracking number can be used to track the shipment + example: TRACK123 + type: string + method: + description: Method of shipment + example: Same day + type: string + metadata: + additionalProperties: true + description: Hash where the user can send additional information for + each 'shipping'. + example: + key: value + maxProperties: 100 + type: object + required: + - amount + title: shipping_request + - properties: + id: + type: string + object: + type: string + parent_id: + type: string + title: shipping_order_response + title: shipping_lines_data_response + order_shipping_lines_response: + allOf: + - description: pagination metadata + properties: + has_more: + description: Indicates if there are more pages to be requested + example: false + type: boolean object: - example: tax_line + description: "Object type, in this case is list" + example: list type: string - parent_id: - example: ord_2tPAmKCEJqh8RE6nY + required: + - has_more + - object + title: pagination metadata + - description: page metadata + properties: + next_page_url: + description: URL of the next page. + example: https://api.conekta.io/resources?limit=10&next=chrg_1 type: string - description: create new taxes for an existing order response - required: - - id - title: order_tax_response + nullable: true + previous_page_url: + description: Url of the previous page. + example: https://api.conekta.io/resources?limit=10&previous=chrg_1 + type: string + nullable: true + title: page metadata + - properties: + data: + items: + $ref: "#/components/schemas/shipping_lines_data_response" + type: array + description: List of shipping costs applied to the order + title: order_shipping_lines_response + nullable: true order_fiscal_entity_address_response: allOf: - description: Address of the fiscal entity @@ -19340,17 +19541,11 @@ components: customer_info: $ref: "#/components/schemas/order_response_customer_info" discount_lines: - description: List of discounts that are applied to the order - items: - $ref: "#/components/schemas/discount_lines_response" - title: order_discount_lines_response - type: array + $ref: "#/components/schemas/order_discount_lines_response" tax_lines: - description: List of taxes that are applied to the order - items: - $ref: "#/components/schemas/order_tax_response" - title: order_tax_lines_response - type: array + $ref: "#/components/schemas/order_tax_lines_response" + shipping_lines: + $ref: "#/components/schemas/order_shipping_lines_response" fiscal_entity: $ref: "#/components/schemas/order_fiscal_entity_response" id: @@ -19481,8 +19676,11 @@ components: type: string type: array expires_at: - description: Unix timestamp of checkout expiration + description: "It is the time when the link will expire. \nIt is expressed\ + \ in seconds since the Unix epoch. The valid range is from 5 minutes to\ + \ 365 days from the creation date.\n" format: int64 + minimum: 1 type: integer failure_url: description: "Redirection url back to the site in case of failed payment,\ @@ -20570,10 +20768,11 @@ components: type: array expires_at: description: "It is the time when the link will expire. \nIt is expressed\ - \ in seconds since the Unix epoch. The valid range is from 10 minutes\ - \ to 365 days from the creation date.\n" + \ in seconds since the Unix epoch. The valid range is from 5 minutes to\ + \ 365 days from the creation date.\n" example: 1680397724 format: int64 + minimum: 1 type: integer monthly_installments_enabled: description: This flag allows you to specify if months without interest @@ -21341,6 +21540,45 @@ components: format: uri type: string title: customer_portal_response + order_tax_response: + allOf: + - description: create new taxes for an existing order + properties: + amount: + description: The amount to be collected for tax in cents + example: 100 + format: int64 + minimum: 0 + type: integer + description: + description: description or tax's name + example: testing + minLength: 2 + type: string + metadata: + additionalProperties: true + example: + key: value + maxProperties: 100 + type: object + required: + - amount + - description + title: order_tax_request + - properties: + id: + example: tax_lin_2tQ8dC5mg1UADmVPo + type: string + object: + example: tax_line + type: string + parent_id: + example: ord_2tPAmKCEJqh8RE6nY + type: string + description: create new taxes for an existing order response + required: + - id + title: order_tax_response ordersUpdateTaxes_request: description: create new taxes for an existing order properties: diff --git a/mocks/conekta_api.json b/mocks/conekta_api.json index 7ab8887..eb5c9a4 100644 --- a/mocks/conekta_api.json +++ b/mocks/conekta_api.json @@ -5709,6 +5709,38 @@ "crudKey": "id", "callbacks": [] }, + { + "uuid": "6f52fe0f-79d8-48f6-bd8b-a07ce48e2a2e", + "body": "{\n \"livemode\": true,\n \"amount\": 10000,\n \"currency\": \"MXN\",\n \"payment_status\": \"expired\",\n \"amount_refunded\": 0,\n \"split_payment\": null,\n \"customer_info\": {\n \"email\": \"fran.mendoza@conekta.com\",\n \"phone\": \"52000000000\",\n \"name\": \" Mendoza\",\n \"corporate\": false,\n \"customer_id\": \"cus_2ywSWuRSRH7J3SbqQ\",\n \"date_of_birth\": null,\n \"national_id\": null,\n \"object\": \"customer_info\",\n \"customer_custom_reference\": null\n },\n \"shipping_contact\": null,\n \"channel\": {\n \"segment\": \"Checkout\",\n \"checkout_request_id\": \"5b337dff-035d-4707-aaad-ce406a2b397a\",\n \"checkout_request_type\": \"HostedPayment\",\n \"original_checkout_request_type\": null,\n \"original_checkout_request_id\": null,\n \"id\": \"channel_2zqnvjdK1zyFYp6c3\"\n },\n \"fiscal_entity\": null,\n \"checkout\": {\n \"id\": \"5b337dff-035d-4707-aaad-ce406a2b397a\",\n \"name\": \"ord-2zqnvjdK1zyFYp6c2\",\n \"livemode\": true,\n \"emails_sent\": 0,\n \"success_url\": \"https://your-domain.com/payment-success\",\n \"failure_url\": \"https://your-domain.com/payment-failure\",\n \"payments_limit_count\": null,\n \"paid_payments_count\": 0,\n \"sms_sent\": 0,\n \"status\": \"Issued\",\n \"type\": \"HostedPayment\",\n \"recurrent\": false,\n \"starts_at\": 1775628000,\n \"expires_at\": 1775887199,\n \"allowed_payment_methods\": [\n \"card\",\n \"bank_transfer\",\n \"apple\",\n \"bnpl\",\n \"pay_by_bank\"\n ],\n \"exclude_card_networks\": [],\n \"needs_shipping_contact\": false,\n \"monthly_installments_options\": [],\n \"monthly_installments_enabled\": false,\n \"redirection_time\": null,\n \"force_3ds_flow\": false,\n \"plan_id\": null,\n \"metadata\": {},\n \"can_not_expire\": false,\n \"three_ds_mode\": null,\n \"max_failed_retries\": null,\n \"object\": \"checkout\",\n \"is_redirect_on_failure\": true,\n \"slug\": \"5b337dff035d4707aaadce406a2b397a\",\n \"url\": \"https://pay.conekta.com/checkout/5b337dff035d4707aaadce406a2b397a\"\n },\n \"object\": \"order\",\n \"id\": \"ord_2zqnvjdK1zyFYp6c2\",\n \"metadata\": {\n \"reuse_customer_clabe\": true\n },\n \"is_refundable\": false,\n \"processing_mode\": null,\n \"created_at\": 1775674562,\n \"updated_at\": 1775887202,\n \"line_items\": {\n \"object\": \"list\",\n \"has_more\": false,\n \"total\": 1,\n \"data\": [\n {\n \"name\": \"Demo Product\",\n \"description\": null,\n \"unit_price\": 10000,\n \"quantity\": 1,\n \"sku\": null,\n \"tags\": null,\n \"brand\": null,\n \"type\": null,\n \"object\": \"line_item\",\n \"id\": \"line_item_2zqnvjdK1zyFYp6bz\",\n \"parent_id\": \"ord_2zqnvjdK1zyFYp6c2\",\n \"metadata\": {},\n \"antifraud_info\": {}\n }\n ]\n },\n \"shipping_lines\": null,\n \"tax_lines\": null,\n \"discount_lines\": null,\n \"charges\": {\n \"object\": \"list\",\n \"has_more\": false,\n \"total\": 1,\n \"data\": [\n {\n \"id\": \"69d6a4cc1a2d4100179067eb\",\n \"livemode\": true,\n \"created_at\": 1775674572,\n \"currency\": \"MXN\",\n \"failure_code\": null,\n \"failure_message\": null,\n \"monthly_installments\": null,\n \"device_fingerprint\": \"883a9048d85140b9b39bd108d118e22b\",\n \"session_id\": \"883a9048d85140b9b39bd108d118e22b\",\n \"channel\": {\n \"segment\": \"Checkout\",\n \"checkout_request_id\": \"5b337dff-035d-4707-aaad-ce406a2b397a\",\n \"checkout_request_type\": \"HostedPayment\",\n \"original_checkout_request_type\": null,\n \"original_checkout_request_id\": null,\n \"id\": \"channel_2zqnvrqZ7eCG3d2Zp\"\n },\n \"payment_method\": {\n \"clabe\": \"734180008033435128\",\n \"bank\": \"FINCO PAY\",\n \"issuing_account_holder_name\": null,\n \"issuing_account_tax_id\": null,\n \"issuing_account_bank\": null,\n \"issuing_account_number\": null,\n \"receiving_account_holder_name\": null,\n \"receiving_account_tax_id\": null,\n \"receiving_account_number\": \"734180008033435128\",\n \"receiving_account_bank\": \"FINCO PAY\",\n \"reference_number\": null,\n \"description\": null,\n \"tracking_code\": null,\n \"executed_at\": null,\n \"payment_attempts\": [],\n \"object\": \"bank_transfer_payment\",\n \"type\": \"spei\",\n \"expires_at\": 1775887199\n },\n \"object\": \"charge\",\n \"description\": \"Payment from order\",\n \"is_refundable\": false,\n \"reference_id\": null,\n \"status\": \"expired\",\n \"amount\": 10000,\n \"paid_at\": null,\n \"customer_id\": \"\",\n \"order_id\": \"ord_2zqnvjdK1zyFYp6c2\",\n \"refunds\": null\n }\n ]\n }\n}", + "latency": 0, + "statusCode": 200, + "label": "successful bank transfer", + "headers": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "bodyType": "INLINE", + "filePath": "", + "databucketID": "", + "sendFileAsBody": false, + "rules": [ + { + "target": "params", + "modifier": "id", + "value": "ord_2zqnvjdK1zyFYp6c2", + "invert": false, + "operator": "equals" + } + ], + "rulesOperator": "OR", + "disableTemplating": false, + "fallbackTo404": false, + "default": false, + "crudKey": "id", + "callbacks": [] + }, { "uuid": "3f56aa58-59fb-434a-a693-371bebd4f24b", "body": "{\n \"livemode\": false,\n \"amount\": 10000,\n \"currency\": \"MXN\",\n \"payment_status\": \"paid\",\n \"amount_refunded\": 0,\n \"split_payment\": null,\n \"customer_info\": {\n \"email\": \"Dominic.Franecki@gmail.com\",\n \"phone\": \"3143159054\",\n \"name\": \"frane amas\",\n \"corporate\": null,\n \"customer_id\": null,\n \"date_of_birth\": null,\n \"national_id\": null,\n \"object\": \"customer_info\"\n },\n \"shipping_contact\": {\n \"receiver\": \"fran carero\",\n \"phone\": \"+573143159054\",\n \"between_streets\": null,\n \"address\": {\n \"street1\": \"av viva\",\n \"street2\": \"ava\",\n \"city\": \"cdmx\",\n \"state\": \"cdmx\",\n \"country\": \"mx\",\n \"residential\": true,\n \"object\": \"shipping_address\",\n \"postal_code\": \"01000\"\n },\n \"id\": \"ship_cont_2znsF4cv7L8sWnRyZ\",\n \"object\": \"shipping_contact\",\n \"created_at\": 1774901374,\n \"metadata\": null\n },\n \"channel\": null,\n \"fiscal_entity\": null,\n \"object\": \"order\",\n \"id\": \"ord_2znsF4cv7L8s3452\",\n \"metadata\": {\n \"test\": \"false\"\n },\n \"is_refundable\": true,\n \"processing_mode\": null,\n \"created_at\": 1774901374,\n \"updated_at\": 1774901374,\n \"line_items\": {\n \"object\": \"list\",\n \"has_more\": false,\n \"total\": 1,\n \"data\": [\n {\n \"name\": \"APOYO URGENTE REFERENCIA\",\n \"description\": null,\n \"unit_price\": 10000,\n \"quantity\": 1,\n \"sku\": \"COL094\",\n \"tags\": null,\n \"brand\": \"CHEDRAUI\",\n \"type\": null,\n \"object\": \"line_item\",\n \"id\": \"line_item_2znsF4cv7L8sWnRyW\",\n \"parent_id\": \"ord_2znsF4cv7L8sWnRya\",\n \"metadata\": {},\n \"antifraud_info\": {}\n }\n ]\n },\n \"shipping_lines\": {\n \"object\": \"list\",\n \"has_more\": false,\n \"total\": 1,\n \"data\": [\n {\n \"amount\": 0,\n \"carrier\": \"fedex\",\n \"method\": null,\n \"tracking_number\": \"4234234\",\n \"object\": \"shipping_line\",\n \"id\": \"ship_lin_2znsF4cv7L8sWnRyX\",\n \"parent_id\": \"ord_2znsF4cv7L8sWnRya\",\n \"metadata\": null\n }\n ]\n },\n \"tax_lines\": null,\n \"discount_lines\": { \"object\": \"list\",\n \"has_more\": false, \n \"total\": 1, \n \"data\": [ \n {\n \"id\": \"dis_lin_2znsJ8YNbNoDDsN3p\",\n \"code\": \"DESC10\",\n \"amount\": 1000,\n \"type\": \"coupon\", \n \"object\": \"discount_line\" \n } \n ]\n } , \n \"charges\": {\n \"object\": \"list\",\n \"has_more\": false,\n \"total\": 1,\n \"data\": [\n {\n \"id\": \"69cad87e5325490001cdd48d\",\n \"livemode\": false,\n \"created_at\": 1774901374,\n \"currency\": \"MXN\",\n \"failure_code\": null,\n \"failure_message\": null,\n \"monthly_installments\": null,\n \"device_fingerprint\": null,\n \"session_id\": null,\n \"channel\": null,\n \"payment_method\": {\n \"name\": \"ñeyueyute nene\",\n \"exp_month\": \"08\",\n \"exp_year\": \"26\",\n \"auth_code\": \"582483\",\n \"object\": \"card_payment\",\n \"type\": \"credit\",\n \"normalized_device_fingerprint\": null,\n \"last4\": \"4242\",\n \"brand\": \"visa\",\n \"issuer\": \"BANAMEX\",\n \"account_type\": \"Credit\",\n \"contract_id\": null,\n \"country\": \"MX\",\n \"fraud_score\": null,\n \"fraud_indicators\": [],\n \"token_id\": \"tok_2znsEnNtewkbkqqCK\",\n \"antifraud_is_self_service_rules\": false,\n \"three_ds_flow_required\": false\n },\n \"object\": \"charge\",\n \"description\": \"Payment from order\",\n \"is_refundable\": true,\n \"reference_id\": null,\n \"status\": \"paid\",\n \"amount\": 10000,\n \"paid_at\": 1774901374,\n \"customer_id\": \"\",\n \"order_id\": \"ord_2znsF4cv7L8sWnRya\",\n \"refunds\": null\n }\n ]\n }\n}", diff --git a/schemas/chargebacks/chargeback_response.yml b/schemas/chargebacks/chargeback_response.yml index cf99ee8..e4a1798 100644 --- a/schemas/chargebacks/chargeback_response.yml +++ b/schemas/chargebacks/chargeback_response.yml @@ -22,6 +22,7 @@ properties: type: string example: "unrecognized" enum: + - unrecognized - unauthorized - unauthorized_by_client - unrecognized_like_fraud diff --git a/schemas/checkouts/checkout.yml b/schemas/checkouts/checkout.yml index 9169a5e..eee3b5e 100644 --- a/schemas/checkouts/checkout.yml +++ b/schemas/checkouts/checkout.yml @@ -27,9 +27,10 @@ properties: type: integer example: 1680397724 format: int64 + minimum: 1 description: | It is the time when the link will expire. - It is expressed in seconds since the Unix epoch. The valid range is from 10 minutes to 365 days from the creation date. + It is expressed in seconds since the Unix epoch. The valid range is from 5 minutes to 365 days from the creation date. monthly_installments_enabled: type: boolean example: true diff --git a/schemas/checkouts/checkout_request.yml b/schemas/checkouts/checkout_request.yml index c3c62b7..6633a98 100644 --- a/schemas/checkouts/checkout_request.yml +++ b/schemas/checkouts/checkout_request.yml @@ -27,8 +27,11 @@ properties: example: ["plan_123", "plan_456"] expires_at: type: integer + minimum: 1 format: int64 - description: "Unix timestamp of checkout expiration" + description: | + It is the time when the link will expire. + It is expressed in seconds since the Unix epoch. The valid range is from 5 minutes to 365 days from the creation date. failure_url: type: string format: uri diff --git a/schemas/orders/order_response.yml b/schemas/orders/order_response.yml index 7586727..5566518 100644 --- a/schemas/orders/order_response.yml +++ b/schemas/orders/order_response.yml @@ -172,17 +172,50 @@ properties: - $ref: order_customer_info_response.yml - $ref: ../customers/customer_info_just_customer_id_response.yml discount_lines: - type: array - title: order_discount_lines_response description: "List of discounts that are applied to the order" - items: - $ref: ../../schemas/orders/discount_lines_response.yml + title: order_discount_lines_response + nullable: true + allOf: + - $ref: ../pagination/pagination.yml + - $ref: ../pagination/page.yml + - type: object + properties: + data: + type: array + items: + title: discount_lines_data_response + allOf: + - $ref: ../../schemas/orders/discount_lines_response.yml tax_lines: - type: array - title: order_tax_lines_response description: "List of taxes that are applied to the order" - items: - $ref: ../../schemas/orders/update_order_tax_response.yml + title: order_tax_lines_response + nullable: true + allOf: + - $ref: ../pagination/pagination.yml + - $ref: ../pagination/page.yml + - type: object + properties: + data: + type: array + items: + title: tax_lines_data_response + allOf: + - $ref: ../../schemas/orders/update_order_tax_response.yml + shipping_lines: + description: "List of shipping costs applied to the order" + title: order_shipping_lines_response + nullable: true + allOf: + - $ref: ../pagination/pagination.yml + - $ref: ../pagination/page.yml + - type: object + properties: + data: + type: array + items: + title: shipping_lines_data_response + allOf: + - $ref: ../../schemas/charges/shipping_order_response.yml fiscal_entity: type: object title: order_fiscal_entity_response