UNPKG

@nomadfypg/nomadfy-sdk

Version:

Software Development Kit (SDK), written in TypeScript, in order to perform integrations with various existing payment gateways.

2,242 lines (2,234 loc) 54.8 kB
var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); // src/index.ts var index_exports = {}; __export(index_exports, { AWSSecretManagerService: () => AWSSecretManagerService, Assinatura: () => Assinatura, Associandocartaocomocomprador: () => Associandocartaocomocomprador, AtualizandodocumentosdeumacontaWeepay: () => AtualizandodocumentosdeumacontaWeepay, Bancos: () => Bancos, ContasAgregadas: () => ContasAgregadas, Criandocomprador: () => Criandocomprador, CriarAssinatura: () => CriarAssinatura, CriarcontaVoluti: () => CriarcontaVoluti, Criartokendecartao: () => Criartokendecartao, DeletarCliente: () => DeletarCliente, EJWTAction: () => EJWTAction, ERestMethod: () => ERestMethod, Emissaodeboleto: () => Emissaodeboleto, Emissaodeboletocomsplit: () => Emissaodeboletocomsplit, ListarMcc: () => ListarMcc, ListartransacaoporId: () => ListartransacaoporId, Listartransacoes: () => Listartransacoes, Pix: () => Pix, TransaOdecartOtokenizado: () => TransaOdecartOtokenizado, Transacaodecartaodecredito: () => Transacaodecartaodecredito, TransferNciasInternas: () => TransferNciasInternas, Transferencias: () => Transferencias, buildApiEndpoint: () => buildApiEndpoint, destroy: () => destroy, get: () => get, options: () => options, patch: () => patch, performRequest: () => performRequest, post: () => post, put: () => put }); module.exports = __toCommonJS(index_exports); // src/common/http/definitions.ts var ERestMethod = /* @__PURE__ */ function(ERestMethod2) { ERestMethod2["GET"] = "get"; ERestMethod2["PUT"] = "put"; ERestMethod2["POST"] = "post"; ERestMethod2["PATCH"] = "patch"; ERestMethod2["DELETE"] = "delete"; ERestMethod2["OPTIONS"] = "options"; return ERestMethod2; }({}); // src/common/http/requests.ts var import_axios = __toESM(require("axios")); async function performRequest({ url, method, payload, options: options2 }) { try { const methodCallableMap = { [ERestMethod.GET]: import_axios.default.get, [ERestMethod.PUT]: import_axios.default.put, [ERestMethod.POST]: import_axios.default.post, [ERestMethod.PATCH]: import_axios.default.patch, [ERestMethod.DELETE]: import_axios.default.delete, [ERestMethod.OPTIONS]: import_axios.default.options }; const callable = methodCallableMap[method]; if (callable === void 0) { throw new Error(` Method ${method} not supported. Choices are ${ERestMethod}`); } const methodsWithPayload = [ ERestMethod.PUT, ERestMethod.POST, ERestMethod.PATCH ]; const response = methodsWithPayload.some((item) => method === item) ? await callable(url, payload, options2) : await callable(url, options2); if (![ 200, 201, 202, 203, 204, 205 ].includes(response.status)) { throw new Error(` Request failed with status ${response.status}: ${JSON.stringify(response.data)}`); } return { result: response.data }; } catch (error) { const isErrorInstance = error instanceof Error; return { errors: [ { type: isErrorInstance ? error.name : "UNKNOWN", message: isErrorInstance ? error.message : "An unknown exception has occurred" } ] }; } } __name(performRequest, "performRequest"); async function get({ url, options: options2 }) { return await performRequest({ url, options: options2, method: ERestMethod.GET }); } __name(get, "get"); async function destroy({ url, options: options2 }) { return await performRequest({ url, options: options2, method: ERestMethod.DELETE }); } __name(destroy, "destroy"); async function options({ url, options: options2 }) { return await performRequest({ url, options: options2, method: ERestMethod.OPTIONS }); } __name(options, "options"); async function post({ url, payload, options: options2 }) { return await performRequest({ url, method: ERestMethod.POST, payload, options: options2 }); } __name(post, "post"); async function put({ url, payload, options: options2 }) { return await performRequest({ url, method: ERestMethod.PUT, payload, options: options2 }); } __name(put, "put"); async function patch({ url, payload, options: options2 }) { return await performRequest({ url, method: ERestMethod.PATCH, payload, options: options2 }); } __name(patch, "patch"); // src/services/common/endpoints.ts function buildApiEndpoint(sequence, apiResources, endpoint = "") { for (const seqEndpoint of sequence) { const filteredResources = apiResources.filter((item) => item.endpoint === seqEndpoint.trim().toLowerCase()); if (filteredResources.length > 0) { sequence.splice(0, 1); const filteredResource = filteredResources[0]; endpoint += `/${filteredResource.endpoint}${filteredResource.version ? "/" + filteredResource.version : ""}`; if (filteredResource.resources !== void 0 && filteredResource.resources.length > 0) endpoint = buildApiEndpoint(sequence, filteredResource.resources, endpoint); } } return endpoint; } __name(buildApiEndpoint, "buildApiEndpoint"); // src/services/security/aws/implementation.ts var import_client_secrets_manager = require("@aws-sdk/client-secrets-manager"); var _AWSSecretManagerService = class _AWSSecretManagerService { constructor(awsRegion) { __publicField(this, "smClient"); this.smClient = new import_client_secrets_manager.SecretsManagerClient({ region: awsRegion }); } async fetchSecrets(secretName) { try { const response = await this.smClient.send(new import_client_secrets_manager.GetSecretValueCommand({ SecretId: secretName })); return JSON.parse(response.SecretString || ""); } catch (error) { throw error; } } }; __name(_AWSSecretManagerService, "AWSSecretManagerService"); var AWSSecretManagerService = _AWSSecretManagerService; // src/services/security/jwt/interfaces.ts var EJWTAction = /* @__PURE__ */ function(EJWTAction2) { EJWTAction2["CREATE"] = "create"; EJWTAction2["DECODE"] = "decode"; EJWTAction2["VERIFY"] = "verify"; return EJWTAction2; }({}); // src/services/security/jwt/implementation.ts var import_crypto = __toESM(require("crypto")); // src/services/voluti/definitions/schemas.ts var Assinatura = { body: { title: "AssinaturaRequest", required: [ "customer", "plan", "creditCard" ], type: "object", properties: { customer: { title: "Customer3", required: [ "countryCode", "state", "type", "name", "email", "phoneNumber", "document", "postalCode", "addressLine1", "number", "neighborhood", "city" ], type: "object", properties: { countryCode: { type: "string", examples: [ "BR" ] }, state: { type: "string", examples: [ "PR" ] }, type: { type: "string", examples: [ "F" ] }, name: { type: "string", examples: [ "RICARDO ANZOlin" ] }, email: { type: "string", examples: [ "ricardoanzolin@gmail.com" ] }, phoneNumber: { type: "string", examples: [ "(46) 98409-8444" ] }, document: { type: "string", examples: [ 6262486984 ] }, postalCode: { type: "string", examples: [ "85501286" ] }, addressLine1: { type: "string", examples: [ "RUA ITABIRA" ] }, number: { type: "string", examples: [ "1505" ] }, neighborhood: { type: "string", examples: [ "CENTRO" ] }, city: { type: "string", examples: [ "PATO BRANCO" ] } } }, plan: { title: "Plan1", required: [ "planId" ], type: "object", properties: { planId: { type: "string", examples: [ "ea812be703e044249ee4594bc55fd0d0" ] } } }, creditCard: { title: "CreditCard", required: [ "CardNumber", "Holder", "Mounth", "Year", "SecurityCode", "ExpirationDate", "Type" ], type: "object", properties: { CardNumber: { type: "string", examples: [ "4539003370725497" ] }, Holder: { type: "string", examples: [ "RICARDO ANZOLIn" ] }, Mounth: { type: "string", examples: [ 5 ] }, Year: { type: "string", examples: [ "2022" ] }, SecurityCode: { type: "string", examples: [ "123" ] }, ExpirationDate: { type: "string", examples: [ "05 / 2022" ] }, Type: { type: "string", examples: [ "C" ] } } } }, $schema: "https://json-schema.org/draft/2020-12/schema" }, response: { "200": { type: "object", properties: {} } } }; var Associandocartaocomocomprador = { body: { title: "AssociandocartaocomocompradorRequest", required: [ "token", "customer" ], type: "object", properties: { token: { type: "string", examples: [ "bc3b691788114a069cd772f89ccf8a47" ] }, customer: { type: "string", examples: [ "1c7774ae25a648dd89337f1e958c1250" ] } }, $schema: "https://json-schema.org/draft/2020-12/schema" }, response: { "200": { type: "object", properties: {} } } }; var AtualizandodocumentosdeumacontaWeepay = { formData: { required: [ "filename", "name" ], type: "object", properties: { filename: { type: "string" }, name: { type: "string", examples: [ "identificacao" ] } }, contentMediaType: "application/x-www-form-urlencoded", $schema: "https://json-schema.org/draft/2020-12/schema" }, response: { "200": { type: "object", properties: {} } } }; var Bancos = { response: { "200": { type: "object", properties: {} } } }; var ContasAgregadas = { response: { "200": { type: "object", properties: {} } } }; var Criandocomprador = { body: { title: "CriandocompradorRequest", required: [ "name", "email", "phoneNumber", "document", "description", "type", "addressLine1", "addressLine2", "neighborhood", "city", "state", "postalCode", "countryCode" ], type: "object", properties: { name: { type: "string", examples: [ "Ricardo Anzolin" ] }, email: { type: "string", examples: [ "ricardoanzolin@gmail.com" ] }, phoneNumber: { type: "string", examples: [ "(46) 98409-8444" ] }, document: { type: "string", examples: [ "16233840015" ] }, description: { type: [ "string", "null" ] }, type: { type: "string", examples: [ "F" ] }, addressLine1: { type: "string", examples: [ "Rua Itabira, 1505 - AP 202" ] }, addressLine2: { type: [ "string", "null" ] }, neighborhood: { type: "string", examples: [ "Centro" ] }, city: { type: "string", examples: [ "Pato Branco" ] }, state: { type: "string", examples: [ "PR" ] }, postalCode: { type: "string", examples: [ "85501286" ] }, countryCode: { type: "string", examples: [ "BR" ] } }, $schema: "https://json-schema.org/draft/2020-12/schema" }, response: { "200": { type: "object", properties: {} } } }; var CriarAssinatura = { body: { title: "CriarAssinaturaRequest", required: [ "customer", "plan", "creditCard" ], type: "object", properties: { customer: { title: "Customer2", required: [ "countryCode", "state", "type", "document", "name", "postalCode", "city", "addressLine1", "neighborhood", "addressLine2", "email", "phoneNumber" ], type: "object", properties: { countryCode: { type: "string", examples: [ "BR" ] }, state: { type: "string", examples: [ "PR" ] }, type: { type: "string", examples: [ "F" ] }, document: { type: "string", examples: [ 6262486984 ] }, name: { type: "string", examples: [ "RICARDO ANZOLIn" ] }, postalCode: { type: "string", examples: [ "85501286" ] }, city: { type: "string", examples: [ "PATO BRANCO" ] }, addressLine1: { type: "string", examples: [ "RUA ITABIRA" ] }, neighborhood: { type: "string", examples: [ "CENTRO" ] }, addressLine2: { type: "integer", contentEncoding: "int32", examples: [ 1505 ] }, email: { type: "string", examples: [ "ricardoanzolin@gmail.com" ] }, phoneNumber: { type: "string", examples: [ "(46) 98409-8444" ] } } }, plan: { title: "Plan", required: [ "id", "name", "amount", "setupAmount", "interval", "frequency", "description", "gracePeriod", "tolerancePeriod", "duration", "currency", "planId", "createdAt", "updatedAt", "seller" ], type: "object", properties: { id: { type: "integer", contentEncoding: "int32", examples: [ 23 ] }, name: { type: "string", examples: [ "Plano novo" ] }, amount: { type: "string", examples: [ "5" ] }, setupAmount: { type: "string", examples: [ "0" ] }, interval: { type: "integer", contentEncoding: "int32", examples: [ 1 ] }, frequency: { type: "string", examples: [ "monthly" ] }, description: { type: "string", examples: [ "Teste de novo plano" ] }, gracePeriod: { type: "integer", contentEncoding: "int32" }, tolerancePeriod: { type: "integer", contentEncoding: "int32" }, duration: { type: "integer", contentEncoding: "int32", examples: [ 3 ] }, currency: { type: "string", examples: [ "0" ] }, planId: { type: "string", examples: [ "0d2067e5cf384e94980ad7ca5a1a5047" ] }, createdAt: { type: "string", examples: [ "2021-09-17T17:00:39.272Z" ] }, updatedAt: { type: "string", examples: [ "2021-09-17T17:00:39.272Z" ] }, seller: { title: "Seller", required: [ "id", "name", "email", "phoneNumber", "website", "description", "statementDescriptor", "document", "type", "addressLine1", "addressLine2", "neighborhood", "city", "state", "postalCode", "countryCode", "mcc", "sellerId", "isActive", "isFactoring", "createdAt", "updatedAt", "meta", "paymentGatewayStatus", "paymentGatewayStatusDescription", "logo", "webhookUrl", "secretKey", "enabledForAnticipation", "factoringBalance", "anticipationFee", "cardAnticipationAuto", "enabledToUsePaymentLink" ], type: "object", properties: { id: { type: "integer", contentEncoding: "int32", examples: [ 178 ] }, name: { type: "string", examples: [ "Weepay Pagamentos" ] }, email: { type: "string", examples: [ "ricardo@weepay.com.br" ] }, phoneNumber: { type: "string", examples: [ "46984098444" ] }, website: { type: [ "string", "null" ] }, description: { type: [ "string", "null" ] }, statementDescriptor: { type: "string", examples: [ "Weepay Pagamentos" ] }, document: { type: "string", examples: [ "30385259000169" ] }, type: { type: "string", examples: [ "J" ] }, addressLine1: { type: "string", examples: [ "Rua L\xEDdio Oltramari" ] }, addressLine2: { type: "string", examples: [ "1628" ] }, neighborhood: { type: "string", examples: [ "Fraron" ] }, city: { type: "string", examples: [ "Pato Branco" ] }, state: { type: "string", examples: [ "PR" ] }, postalCode: { type: "string", examples: [ "85503381" ] }, countryCode: { type: "string", examples: [ "BR" ] }, mcc: { type: "string", examples: [ "106" ] }, sellerId: { type: "string", examples: [ "ad351910c2944e46ad7701553e1373c9" ] }, isActive: { type: "boolean", examples: [ true ] }, isFactoring: { type: "boolean" }, createdAt: { type: "string", examples: [ "2021-02-25T15:51:57.279Z" ] }, updatedAt: { type: "string", examples: [ "2021-02-25T15:58:41.659Z" ] }, meta: { type: [ "string", "null" ] }, paymentGatewayStatus: { type: "integer", contentEncoding: "int32", examples: [ 2 ] }, paymentGatewayStatusDescription: { type: "string", examples: [ "Aprovado" ] }, logo: { type: [ "string", "null" ] }, webhookUrl: { type: [ "string", "null" ] }, secretKey: { type: "string", examples: [ "MzAzODUyNTkwMDAxNjk=" ] }, enabledForAnticipation: { type: "boolean", examples: [ true ] }, factoringBalance: { type: "string", examples: [ "0" ] }, anticipationFee: { type: "string", examples: [ "0" ] }, cardAnticipationAuto: { type: "boolean" }, enabledToUsePaymentLink: { type: "boolean" } } } } }, creditCard: { title: "CreditCard", required: [ "CardNumber", "Holder", "Mounth", "Year", "SecurityCode", "ExpirationDate", "Type" ], type: "object", properties: { CardNumber: { type: "string", examples: [ "5355474563026324" ] }, Holder: { type: "string", examples: [ "RICARDO ANZOlin" ] }, Mounth: { type: "string", examples: [ "11" ] }, Year: { type: "string", examples: [ "2024" ] }, SecurityCode: { type: "string", examples: [ "639" ] }, ExpirationDate: { type: "string", examples: [ "11/24" ] }, Type: { type: "string", examples: [ "C" ] } } } }, $schema: "https://json-schema.org/draft/2020-12/schema" }, response: { "200": { type: "object", properties: {} } } }; var CriarcontaVoluti = { body: { title: "CriarcontaVolutiRequest", required: [ "name", "email", "phoneNumber", "website", "description", "statementDescriptor", "document", "type", "addressLine1", "addressLine2", "neighborhood", "city", "state", "postalCode", "countryCode", "mcc", "checkingAccount", "autoTransfer" ], type: "object", properties: { name: { type: "string", examples: [ "Nair e Beatriz Restaurante Ltda" ] }, email: { type: "string", examples: [ "qualidade@isabelleesebastiaofinanceirame.com.br" ] }, phoneNumber: { type: [ "string", "null" ] }, website: { type: [ "string", "null" ] }, description: { type: [ "string", "null" ] }, statementDescriptor: { type: [ "string", "null" ] }, document: { type: "string", examples: [ "47312220000114" ] }, type: { type: "string", examples: [ "J" ] }, addressLine1: { type: "string", examples: [ "Travessa Bortot" ] }, addressLine2: { type: "string", examples: [ "N\xFAmero 105" ] }, neighborhood: { type: "string", examples: [ "Santa Terezinha" ] }, city: { type: "string", examples: [ "Pato Branco" ] }, state: { type: "string", examples: [ "PR" ] }, postalCode: { type: "string", examples: [ "85506050" ] }, countryCode: { type: "string", examples: [ "BR" ] }, mcc: { type: "string", examples: [ "106" ] }, checkingAccount: { title: "CheckingAccount", required: [ "type", "customer", "holderName", "document", "description", "agency", "accountNumber", "isActive", "bank" ], type: "object", properties: { type: { type: "string", examples: [ "J" ] }, customer: { type: [ "string", "null" ] }, holderName: { type: "string", examples: [ "Nair e Beatriz Restaurante Ltda" ] }, document: { type: "string", examples: [ "47312220000114" ] }, description: { type: [ "string", "null" ] }, agency: { type: "string", examples: [ 737 ] }, accountNumber: { type: "string", examples: [ "244351" ] }, isActive: { type: "boolean", examples: [ true ] }, bank: { title: "Bank", required: [ "id", "name", "code" ], type: "object", properties: { id: { type: "integer", contentEncoding: "int32", examples: [ 17 ] }, name: { type: "string", examples: [ "Nair e Beatriz Restaurante Ltda" ] }, code: { type: "string", examples: [ "748" ] } } } } }, autoTransfer: { type: "boolean", examples: [ true ] } }, $schema: "https://json-schema.org/draft/2020-12/schema" }, response: { "200": { type: "object", properties: {} } } }; var Criartokendecartao = { body: { title: "CriartokendecartaoRequest", required: [ "holder_name", "expiration_month", "expiration_year", "security_code", "card_number" ], type: "object", properties: { holder_name: { type: "string", examples: [ "Jo\xE3o Silva" ] }, expiration_month: { type: "string", examples: [ 3 ] }, expiration_year: { type: "string", examples: [ "2018" ] }, security_code: { type: "string", examples: [ "123" ] }, card_number: { type: "string", examples: [ "5201561050024014" ] } }, $schema: "https://json-schema.org/draft/2020-12/schema" }, response: { "200": { type: "object", properties: {} } } }; var DeletarCliente = { response: { "200": { type: "object", properties: {} } } }; var Emissaodeboleto = { body: { title: "EmissaodeboletoRequest", required: [ "type", "acceptBillet", "acceptPaymentAfterExpiration", "acceptDiscount", "customer", "discountLimitDate", "lateFeeType", "interestType", "discountType", "lateFeeAmount", "lateFeeStartAt", "interestAmount", "interestStartAt", "discountAmount", "installments", "installment", "frequency", "paymentLimitDate", "daysBeforeExpiration", "amount", "dueDate", "description", "chargeViews", "currentInstallmentNumber" ], type: "object", properties: { type: { type: "string", examples: [ "UNIQUE" ] }, acceptBillet: { type: "boolean", examples: [ true ] }, acceptPaymentAfterExpiration: { type: "boolean" }, acceptDiscount: { type: "boolean" }, customer: { title: "Customer", required: [ "name", "email", "phoneNumber", "document", "description", "type", "addressLine1", "addressLine2", "neighborhood", "city", "state", "postalCode", "countryCode" ], type: "object", properties: { name: { type: "string", examples: [ "Ricardo Anzolin" ] }, email: { type: "string", examples: [ "ricardoanzolin@gmail.com" ] }, phoneNumber: { type: "string", examples: [ "(46) 98409-8444" ] }, document: { type: "string", examples: [ "48808171043" ] }, description: { type: [ "string", "null" ], examples: [ "Ref. Servi\xE7os Prestados." ] }, type: { type: "string", examples: [ "UNIQUE" ] }, addressLine1: { type: "string", examples: [ "Travessa Bortot" ] }, addressLine2: { type: [ "string", "null" ] }, neighborhood: { type: "string", examples: [ "Santa Terezinha" ] }, city: { type: "string", examples: [ "Pato Branco" ] }, state: { type: "string", examples: [ "PR" ] }, postalCode: { type: "string", examples: [ "85506050" ] }, countryCode: { type: "string", examples: [ "BR" ] } } }, discountLimitDate: { type: "integer", contentEncoding: "int32" }, lateFeeType: { type: "integer", contentEncoding: "int32" }, interestType: { type: "integer", contentEncoding: "int32" }, discountType: { type: "integer", contentEncoding: "int32" }, lateFeeAmount: { type: "integer", contentEncoding: "int32" }, lateFeeStartAt: { type: "string", examples: [ "2020-10-02T16:31:51.000Z" ] }, interestAmount: { type: "integer", contentEncoding: "int32" }, interestStartAt: { type: "string", examples: [ "2020-10-02T16:31:51.000Z" ] }, discountAmount: { type: "integer", contentEncoding: "int32" }, installments: { type: "integer", contentEncoding: "int32", examples: [ 1 ] }, installment: { type: "integer", contentEncoding: "int32", examples: [ 1 ] }, frequency: { type: "integer", contentEncoding: "int32", examples: [ 30 ] }, paymentLimitDate: { type: "integer", contentEncoding: "int32", examples: [ 3 ] }, daysBeforeExpiration: { type: "integer", contentEncoding: "int32", examples: [ 5 ] }, amount: { type: "integer", contentEncoding: "int32", examples: [ 300 ] }, dueDate: { type: "string", examples: [ "2020-09-30T16:31:51.000Z" ] }, description: { type: "string", examples: [ "Ref. Servi\xE7os Prestados." ] }, chargeViews: { type: "array", items: { type: "string" }, description: "" }, currentInstallmentNumber: { type: "integer", contentEncoding: "int32", examples: [ 1 ] } }, $schema: "https://json-schema.org/draft/2020-12/schema" }, response: { "200": { type: "object", properties: {} } } }; var Emissaodeboletocomsplit = { body: { title: "EmissaodeboletocomsplitRequest", required: [ "type", "acceptBillet", "acceptPaymentAfterExpiration", "acceptDiscount", "customer", "discountLimitDate", "lateFeeType", "interestType", "discountType", "lateFeeAmount", "interestAmount", "discountAmount", "installments", "installment", "frequency", "paymentLimitDate", "daysBeforeExpiration", "amount", "dueDate", "description", "chargeViews", "currentInstallmentNumber", "split_rules" ], type: "object", properties: { type: { type: "string", examples: [ "UNIQUE" ] }, acceptBillet: { type: "boolean", examples: [ true ] }, acceptPaymentAfterExpiration: { type: "boolean" }, acceptDiscount: { type: "boolean" }, customer: { title: "Customer1", required: [ "name", "email", "phoneNumber", "document", "description", "type", "addressLine1", "addressLine2", "neighborhood", "city", "state", "postalCode", "countryCode", "createdAt", "updatedAt", "meta", "birthdate" ], type: "object", properties: { name: { type: "string", examples: [ "Ricardo Anzolin" ] }, email: { type: "string", examples: [ "ricardoanzolin@gmail.com" ] }, phoneNumber: { type: "string", examples: [ "(46) 98409-8444" ] }, document: { type: "string", examples: [ "48808171043" ] }, description: { type: [ "string", "null" ], examples: [ "Ref. Servi\xE7os Prestados." ] }, type: { type: "string", examples: [ "UNIQUE" ] }, addressLine1: { type: "string", examples: [ "Travessa Bortot" ] }, addressLine2: { type: [ "string", "null" ] }, neighborhood: { type: "string", examples: [ "Santa Terezinha" ] }, city: { type: "string", examples: [ "Pato Branco" ] }, state: { type: "string", examples: [ "PR" ] }, postalCode: { type: "string", examples: [ "85506050" ] }, countryCode: { type: "string", examples: [ "BR" ] }, createdAt: { type: "string", examples: [ "2020-05-02T22:10:21.815Z" ] }, updatedAt: { type: "string", examples: [ "2020-05-02T22:10:21.815Z" ] }, meta: { type: [ "string", "null" ] }, birthdate: { type: [ "string", "null" ] } } }, discountLimitDate: { type: "integer", contentEncoding: "int32" }, lateFeeType: { type: "integer", contentEncoding: "int32" }, interestType: { type: "integer", contentEncoding: "int32" }, discountType: { type: "integer", contentEncoding: "int32" }, lateFeeAmount: { type: "integer", contentEncoding: "int32" }, interestAmount: { type: "integer", contentEncoding: "int32" }, discountAmount: { type: "integer", contentEncoding: "int32" }, installments: { type: "integer", contentEncoding: "int32", examples: [ 1 ] }, installment: { type: "integer", contentEncoding: "int32", examples: [ 1 ] }, frequency: { type: "integer", contentEncoding: "int32", examples: [ 30 ] }, paymentLimitDate: { type: "integer", contentEncoding: "int32", examples: [ 3 ] }, daysBeforeExpiration: { type: "integer", contentEncoding: "int32", examples: [ 5 ] }, amount: { type: "integer", contentEncoding: "int32", examples: [ 300 ] }, dueDate: { type: "string", examples: [ "2020-08-22T16:31:51.000Z" ] }, description: { type: "string", examples: [ "Ref. Servi\xE7os Prestados." ] }, chargeViews: { type: "array", items: { type: "string" }, description: "" }, currentInstallmentNumber: { type: "integer", contentEncoding: "int32", examples: [ 1 ] }, split_rules: { type: "array", items: { title: "SplitRule", required: [ "recipient", "liable", "charge_processing_fee", "percentage", "amount" ], type: "object", properties: { recipient: { type: "string", examples: [ "2a6c24106b514059acd0b919459ffc96" ] }, liable: { type: "integer", contentEncoding: "int32", examples: [ 1 ] }, charge_processing_fee: { type: "integer", contentEncoding: "int32" }, percentage: { type: "integer", contentEncoding: "int32" }, amount: { type: "integer", contentEncoding: "int32", examples: [ 300 ] } } }, description: "" } }, $schema: "https://json-schema.org/draft/2020-12/schema" }, response: { "200": { type: "object", properties: {} } } }; var ListarMcc = { response: { "200": { type: "object", properties: {} } } }; var ListartransacaoporId = { metadata: { allOf: [ { type: "object", properties: { "Content-Type": { const: "application/json", type: "string", examples: [ "application/json" ], $schema: "https://json-schema.org/draft/2020-12/schema" } }, required: [ "Content-Type" ] } ] }, response: { "200": { type: "object", properties: {} } } }; var Listartransacoes = { metadata: { allOf: [ { type: "object", properties: { sort: { type: "string", examples: [ "created_at:desc" ], $schema: "https://json-schema.org/draft/2020-12/schema" }, limit: { type: "integer", contentEncoding: "int32", examples: [ 100 ], $schema: "https://json-schema.org/draft/2020-12/schema" }, offset: { type: "integer", contentEncoding: "int32", examples: [ 0 ], $schema: "https://json-schema.org/draft/2020-12/schema" }, page: { type: "integer", contentEncoding: "int32", examples: [ 1 ], $schema: "https://json-schema.org/draft/2020-12/schema" }, "date_range[lte]": { type: "integer", contentEncoding: "int32", examples: [ 1598842799 ], $schema: "https://json-schema.org/draft/2020-12/schema" }, "date_range[gte]": { type: "integer", contentEncoding: "int32", examples: [ 1597028400 ], $schema: "https://json-schema.org/draft/2020-12/schema" }, "amount_range[gte]": { type: "integer", contentEncoding: "int32", examples: [ 0 ], $schema: "https://json-schema.org/draft/2020-12/schema" } }, required: [ "sort", "limit", "offset", "page", "date_range[lte]", "date_range[gte]", "amount_range[gte]" ] }, { type: "object", properties: { "Content-Type": { const: "application/json", type: "string", examples: [ "application/json" ], $schema: "https://json-schema.org/draft/2020-12/schema" } }, required: [ "Content-Type" ] } ] }, response: { "200": { type: "object", properties: {} } } }; var Pix = { body: { title: "PixRequest", required: [ "description", "amount" ], type: "object", properties: { description: { type: "string", examples: [ "Venda com Pix" ] }, amount: { type: "integer", contentEncoding: "int32", examples: [ 5 ] } }, $schema: "https://json-schema.org/draft/2020-12/schema" }, response: { "200": { type: "object", properties: {} } } }; var TransaOdecartOtokenizado = { body: { title: "TransaodecartotokenizadoRequest", required: [ "source", "on_behalf_of", "customer", "description", "statement_descriptor", "payment_type" ], type: "object", properties: { source: { title: "Source", required: [ "amount", "currency", "type", "usage", "card" ], type: "object", properties: { amount: { type: "string", examples: [ "350" ] }, currency: { type: "string", examples: [ "BRL" ] }, type: { type: "string", examples: [ "card" ] }, usage: { type: "string", examples: [ "single_use" ] }, card: { title: "Card", required: [ "id" ], type: "object", properties: { id: { type: "string", examples: [ "9f857bf9d34d4466abbddf1bb61744a2" ] } } } } }, on_behalf_of: { type: "string", examples: [ "6522c0e75626462ea7319ccdf761cce4" ] }, customer: { type: "string", examples: [ "1c7774ae25a648dd89337f1e958c1250" ] }, description: { type: "string", examples: [ "Uma descri\xE7\xE3o br