Selaa lähdekoodia

documentation from tests

glopes 1 kuukausi sitten
vanhempi
sitoutus
5052e7aabd
3 muutettua tiedostoa jossa 209 lisäystä ja 8 poistoa
  1. 0 1
      .test.md.swp
  2. 6 6
      genial-cli
  3. 203 1
      test.md

+ 0 - 1
.test.md.swp

@@ -1 +0,0 @@
-VSCODE/fef9cb0cdb6dc56219374a500da733e28358e09cf9c21299ea547d3b30535eb7

+ 6 - 6
genial-cli

@@ -35,7 +35,7 @@ async function main() {
         await getKey(rest[0]);
         break;
       }
-      case "decodeQrcode": {
+      case "decode": {
         if (rest.length < 1) return fail("Usage: decodeQrcode <qrcode>");
         await decodeQrcode(rest[0]);
         break;
@@ -52,14 +52,14 @@ async function main() {
         break;
       }
       case "paykey": {
-        if (rest.length < 1) return fail("Usage: payInit <pixKey> <value>");
+        if (rest.length < 2) return fail("Usage: payInit <pixKey> <value>");
         await PayInit(rest[0], rest[1]);
         break;
       }
       // done up
       case "qrcodedynamic": {
-        // if (rest.length <2) return fail("Usage: qrcode  <value>");
-        await QrCodeDynamic(rest[1]);
+        if (rest.length < 1) return fail("Usage: qrcode  <value>");
+        await QrCodeDynamic(rest[0]);
         break;
       }
       case "statusIn": {
@@ -309,9 +309,9 @@ async function PayInit(pixKey, value) {
   const url = `${BAAS_URL}/v1/pix/send/initialization`;
   const body = {
     debit: {
-      name: process.env.ACCOUNT2_NAME,
+      name: process.env.ACCOUNT1_NAME,
       agency: 1,
-      account: process.env.ACCOUNT2,
+      account: process.env.ACCOUNT1,
       accountType: "CACC",
     },
     credit: {

+ 203 - 1
test.md

@@ -42,4 +42,206 @@ DEBUG raw: {"key":"c4b4824d-46b9-476f-9496-32bb5cde6324","keyType":"EVP","idPixK
   endToEndId: 'E45246410202511041914itWqQjnOAXx'
 }
 
-## 4
+## 4. Qrcodes
+
+### Static
+
+DEBUG callApi: POST <https://gerador-arquitetura-baas.homolog.api.genial.systems/v1/pix/qrcode-static/>
+DEBUG body: {"accountHolderName":"too easy trading","addressingKey":{"key":"c4b4824d-46b9-476f-9496-32bb5cde6324","type":"EVP"},"account":"980134129","agency":1}
+DEBUG status: 201
+DEBUG raw: {"data":{"textContent":"00020101021126580014br.gov.bcb.pix0136c4b4824d-46b9-476f-9496-32bb5cde63245204000053039865802BR5916too easy trading6009SAO PAULO62290525ee1a3478186b16b801f82e5b56304AFFC","reference":"ee1a3478186b16b801f82e5b5"},"error":null}
+{
+  data: {
+    textContent: '00020101021126580014br.gov.bcb.pix0136c4b4824d-46b9-476f-9496-32bb5cde63245204000053039865802BR5916too easy trading6009SAO PAULO62290525ee1a3478186b16b801f82e5b56304AFFC',
+    reference: 'ee1a3478186b16b801f82e5b5'
+  },
+  error: null
+}
+
+### dynamic
+
+DEBUG callApi: POST <https://gerador-arquitetura-baas.homolog.api.genial.systems/v2/qrcode/dynamic?agency=1&account=980134129>
+DEBUG body: {"items":[{"addressingKey":{"key":"c4b4824d-46b9-476f-9496-32bb5cde6324","type":"EVP"},"accountHolderName":"too easy trading","accountHolderCity":"SAO PAULO","dynamicQRCodeType":"IMMEDIATE","immediate":{"expiration":36000,"paymentValue":{"documentValue":"1","showPaymentValueInQrCode":true},"payerInformation":{"cpfCnpj":"37812511871","name":"gustavo lopes","validatePayerInformation":true},"receiverInformation":{"taxId":"47175222000109","name":"too easy trading","tradeName":"too easy trading"}},"payerRequestInformation":"TESTE SOLICITAÇÃO AO PAYER"}]}
+DEBUG status: 207
+DEBUG raw: {"data":{"items":[{"itemId":"5681b321-59bc-46f9-b3cd-5f09650c6e1b","data":{"textContent":"00020101021226990014br.gov.bcb.pix2577pix-h.bancogenial.com/qrs1/v2/017HLFqfc1cAST8ORNZNJbghAX79XQExJZe1lzLXqskILV352040000530398654041.005802BR5916too easy trading6009SAO PAULO62070503***63046D9D","reference":"6ebff1a5ad244bc8af8da6c9edc3ee8a","qrcodeURL":"https://pix-h.bancogenial.com/qrs1/v2/017HLFqfc1cAST8ORNZNJbghAX79XQExJZe1lzLXqskILV3"},"error":null}]}}
+{
+  data: {
+    items: [
+      {
+        itemId: '5681b321-59bc-46f9-b3cd-5f09650c6e1b',
+        data: {
+          textContent: '00020101021226990014br.gov.bcb.pix2577pix-h.bancogenial.com/qrs1/v2/017HLFqfc1cAST8ORNZNJbghAX79XQExJZe1lzLXqskILV352040000530398654041.005802BR5916too easy trading6009SAO PAULO62070503***63046D9D',
+          reference: '6ebff1a5ad244bc8af8da6c9edc3ee8a',
+          qrcodeURL: 'https://pix-h.bancogenial.com/qrs1/v2/017HLFqfc1cAST8ORNZNJbghAX79XQExJZe1lzLXqskILV3'
+        },
+        error: null
+      }
+    ]
+  }
+}
+
+### decode
+
+DEBUG callApi: GET <https://gerador-arquitetura-baas.homolog.api.genial.systems/v1/pix/qrcode-decode?qrcode=00020101021226990014br.gov.bcb.pix2577pix-h.bancogenial.com%2Fqrs1%2Fv2%2F017HLFqfc1cAST8ORNZNJbghAX79XQExJZe1lzLXqskILV352040000530398654041.005802BR5916too%20easy%20trading6009SAO%20PAULO62070503***63046D9D>
+DEBUG status: 200
+DEBUG raw: {"data":{"qrcodeType":"DYNAMIC","staticQrcodeData":null,"dynamicQrcodeData":{"payloadId":"QRS2-ad0fe11d-fe66-4fc2-a0d1-e82ef6954d98","payloadUrl":"pix-h.bancogenial.com/qrs1/v2/017HLFqfc1cAST8ORNZNJbghAX79XQExJZe1lzLXqskILV3","payload":{"revisao":0,"infoAdicionais":null,"calendario":{"dataDeVencimento":null,"validadeAposVencimento":null,"criacao":"2025-11-04T19:17:27.000Z","apresentacao":"2025-11-04T19:18:41.006Z","expiracao":"36000"},"devedor":{"cpf":"***.125.118-**","nome":"gustavo lopes"},"valor":{"original":"1.00","juros":0.0,"multa":0.0,"desconto":0.0,"final":0.0,"permiteAlteracao":false,"abatimento":null,"modalidadeAlteracao":0,"retirada":null},"txId":"6ebff1a5ad244bc8af8da6c9edc3ee8a","chave":"c4b4824d-46b9-476f-9496-32bb5cde6324","solicitacaoPagador":"TESTE SOLICITAÇÃO AO PAYER","status":"ATIVA"},"pointOfInitiationMethod":12,"country":"BR","currency":"986","value":1.00,"merchantName":"too easy trading","merchantCity":"SAO PAULO","postalCode":null,"reference":"***"},"brCodeArrangements":[{"emvId":26,"gui":"br.gov.bcb.pix"}],"recurrenceData":null},"error":null}
+{
+  data: {
+    qrcodeType: 'DYNAMIC',
+    staticQrcodeData: null,
+    dynamicQrcodeData: {
+      payloadId: 'QRS2-ad0fe11d-fe66-4fc2-a0d1-e82ef6954d98',
+      payloadUrl: 'pix-h.bancogenial.com/qrs1/v2/017HLFqfc1cAST8ORNZNJbghAX79XQExJZe1lzLXqskILV3',
+      payload: {
+        revisao: 0,
+        infoAdicionais: null,
+        calendario: {
+          dataDeVencimento: null,
+          validadeAposVencimento: null,
+          criacao: '2025-11-04T19:17:27.000Z',
+          apresentacao: '2025-11-04T19:18:41.006Z',
+          expiracao: '36000'
+        },
+        devedor: { cpf: '***.125.118-**', nome: 'gustavo lopes' },
+        valor: {
+          original: '1.00',
+          juros: 0,
+          multa: 0,
+          desconto: 0,
+          final: 0,
+          permiteAlteracao: false,
+          abatimento: null,
+          modalidadeAlteracao: 0,
+          retirada: null
+        },
+        txId: '6ebff1a5ad244bc8af8da6c9edc3ee8a',
+        chave: 'c4b4824d-46b9-476f-9496-32bb5cde6324',
+        solicitacaoPagador: 'TESTE SOLICITAÇÃO AO PAYER',
+        status: 'ATIVA'
+      },
+      pointOfInitiationMethod: 12,
+      country: 'BR',
+      currency: '986',
+      value: 1,
+      merchantName: 'too easy trading',
+      merchantCity: 'SAO PAULO',
+      postalCode: null,
+      reference: '***'
+    },
+    brCodeArrangements: [ { emvId: 26, gui: 'br.gov.bcb.pix' } ],
+    recurrenceData: null
+  },
+  error: null
+}
+
+### Pay QRcode
+
+DEBUG callApi: POST <https://gerador-arquitetura-baas.homolog.api.genial.systems/v1/pix/copy-paste>
+DEBUG body: {"qrCodeCopyPaste":"00020101021226990014br.gov.bcb.pix2577pix-h.bancogenial.com/qrs1/v2/017HLFqfc1cAST8ORNZNJbghAX79XQExJZe1lzLXqskILV352040000530398654041.005802BR5916too easy trading6009SAO PAULO62070503***63046D9D","value":1,"debit":{"name":"gustavo lopes","agency":1,"account":"980134153","accountType":"CACC"}}
+DEBUG status: 201
+DEBUG raw: {"data":{"receiver":{"receiverInstitutionISPB":45246410,"receiverTaxId":"47175222000109","addressingKey":"c4b4824d-46b9-476f-9496-32bb5cde6324","endToEndIdQuery":"E45246410202511041919QbJR79O94rt","account":{"branch":"1","accountNumber":"980134129","accountType":"CACC"}},"value":1.0,"additionalInformation":null,"customerInitiationTimestampUTC":"2025-11-04T19:19:27.518766","demandsImmediateReturn":true,"historicComplement":null,"informationAccountHolder":null,"originSystem":"NOVOBAAS","instructionPriority":"HIGH","settlementId":"333036512783139160591765060186960379004","payer":{"account":{"branch":"1","accountNumber":"980134153","accountType":"CACC"},"checkCustomerAccountBalance":true,"name":"gustavo lopes","taxId":"47175222000109"},"instantPaymentId":"019a504f-5218-7b6e-892e-9688bc78d619","eventStatus":{"code":"39","description":"Waiting credit validation"},"endToEndId":"E45246410202511041919QbJR79O94rt","customerDebitMadeByMip":true,"instructionType":"PAGPRI","initiationForm":"QRDN","transactionPurpose":"IPAY"},"error":null}
+{
+  data: {
+    receiver: {
+      receiverInstitutionISPB: 45246410,
+      receiverTaxId: '47175222000109',
+      addressingKey: 'c4b4824d-46b9-476f-9496-32bb5cde6324',
+      endToEndIdQuery: 'E45246410202511041919QbJR79O94rt',
+      account: { branch: '1', accountNumber: '980134129', accountType: 'CACC' }
+    },
+    value: 1,
+    additionalInformation: null,
+    customerInitiationTimestampUTC: '2025-11-04T19:19:27.518766',
+    demandsImmediateReturn: true,
+    historicComplement: null,
+    informationAccountHolder: null,
+    originSystem: 'NOVOBAAS',
+    instructionPriority: 'HIGH',
+    settlementId: '333036512783139160591765060186960379004',
+    payer: {
+      account: { branch: '1', accountNumber: '980134153', accountType: 'CACC' },
+      checkCustomerAccountBalance: true,
+      name: 'gustavo lopes',
+      taxId: '47175222000109'
+    },
+    instantPaymentId: '019a504f-5218-7b6e-892e-9688bc78d619',
+    eventStatus: { code: '39', description: 'Waiting credit validation' },
+    endToEndId: 'E45246410202511041919QbJR79O94rt',
+    customerDebitMadeByMip: true,
+    instructionType: 'PAGPRI',
+    initiationForm: 'QRDN',
+    transactionPurpose: 'IPAY'
+  },
+  error: null
+}
+
+## Cashout hook
+
+{"CustomerDebitMadeByMip":true,"InstantPaymentId":"019a501d-602b-2ecd-fb89-b491050764e3","EndToEndId":"E45246410202511041824BokIzHxYyGG","TimestampUTC":"2025-11-04T18:24:53.802","SettlementId":"63606194888156183904024321187755533674","Value":10.00,"Receiver":{"DebitPsp":{"Ispb":"45246410","Name":"BANCO GENIAL"},"TaxId":"47175222000109","AddressKey":"c4b4824d-46b9-476f-9496-32bb5cde6324","DebitAccount":{"AccountNumber":"980134129","AccountType":"CACC","Branch":"1"}},"Payer":{"DebitPsp":{"Ispb":"45246410","Name":"BANCO GENIAL"},"TaxId":"47175222000109","Name":"gustavo lopes","DebitAccount":{"AccountNumber":"980134153","AccountType":"CACC","Branch":"1"}},"SpiTimestampUTC":"2025-11-04T18:24:54.351","SpiSettlementDate":"2025-11-04","CustomerInitiationTimestampUTC":"2025-11-04T18:24:53.939","MirrorWasActive":true,"OriginalSystem":"NOVOBAAS","RemittanceInformation":null,"MipTransactionType":"INTRA_PSP","DebitEventType":{"Code":1,"Description":"Payment"},"DebitEventStatus":{"Code":"3","Description":"Success"},"DebitRejectionReason":null,"InstructionType":"PAGPRI","InitiationForm":"QRES","TransactionPurpose":"IPAY","InstructionPriority":"HIGH","IsRigthsAndObligationSettlement":false}
+
+## cashin hook
+
+{"instantPaymentId":"019a4e91-848a-d9b2-93f8-f80c63467d8b","endToEndId":"E45246410202511041112GF94KRYQxLI","timestampUTC":"2025-11-04T11:12:30.851","settlementId":"40889575210996621893720030696582324710","receiverReconciliationIdentifier":"612a644318b2a984e3a942555","value":1.00,"receiver":{"psp":{"ispb":"45246410","name":"BANCO GENIAL"},"taxId":"47175222000109","addressKey":"c4b4824d-46b9-476f-9496-32bb5cde6324","account":{"accountNumber":"980134129","accountType":"CACC","branch":"1"}},"payer":{"psp":{"ispb":"45246410","name":"BANCO GENIAL"},"taxId":"47175222000109","name":"gustavo lopes","account":{"accountNumber":"980134153","accountType":"CACC","branch":"1"}},"spiTimestampUTC":"2025-11-04T11:12:31.138","customerInitiationTimestampUTC":"2025-11-04T11:12:30.603","remittanceInformation":"","mipTransactionType":"INTRA_PSP","eventType":{"code":2,"description":"Receipt"},"eventStatus":{"code":3,"description":"Success"},"instructionType":"PAGPRI","initiationForm":"QRES","transactionPurpose":"IPAY","instructionPriority":"HIGH","isRigthsAndObligationSettlement":false,"return":null}
+
+## pay key
+
+### pay init
+
+DEBUG callApi: POST <https://gerador-arquitetura-baas.homolog.api.genial.systems/v1/pix/send/initialization>
+DEBUG body: {"debit":{"name":"too easy trading","agency":1,"account":"980134129","accountType":"CACC"},"credit":{"key":"d78793e5-4b08-4bce-91f6-ec879ea55909"},"value":"10","idempotencyId":"11dfcb3f-da19-4918-88c2-d03198bf8c9b"}
+DEBUG status: 201
+DEBUG raw: {"data":{"key":"d78793e5-4b08-4bce-91f6-ec879ea55909","keyType":"EVP","pspIdentification":"45246410","accountHolder":{"taxId":"***.125.118-**","name":"gustavo lopes"},"status":"ACTIVE","creationDate":"2025-11-04T19:24:06","keyLocallyActive":"true","endToEndId":"E45246410202511041926rCHWKiNkvZP","idempotencyId":"11dfcb3f-da19-4918-88c2-d03198bf8c9b"},"error":null}
+{
+  data: {
+    key: 'd78793e5-4b08-4bce-91f6-ec879ea55909',
+    keyType: 'EVP',
+    pspIdentification: '45246410',
+    accountHolder: { taxId: '***.125.118-**', name: 'gustavo lopes' },
+    status: 'ACTIVE',
+    creationDate: '2025-11-04T19:24:06',
+    keyLocallyActive: 'true',
+    endToEndId: 'E45246410202511041926rCHWKiNkvZP',
+    idempotencyId: '11dfcb3f-da19-4918-88c2-d03198bf8c9b'
+  },
+  error: null
+}
+idempotencyId: 11dfcb3f-da19-4918-88c2-d03198bf8c9b
+
+### pay confirmed
+
+DEBUG callApi: POST <https://gerador-arquitetura-baas.homolog.api.genial.systems/v1/pix/send/confirmed>
+DEBUG body: {"idempotencyId":"11dfcb3f-da19-4918-88c2-d03198bf8c9b","ignorePaymentDuplication":false}
+DEBUG status: 201
+DEBUG raw: {"data":{"receiver":{"receiverInstitutionISPB":45246410,"receiverTaxId":"***.125.118-**","addressingKey":"d78793e5-4b08-4bce-91f6-ec879ea55909","endToEndIdQuery":"E45246410202511041926rCHWKiNkvZP"},"value":10.0,"additionalInformation":null,"customerInitiationTimestampUTC":"2025-11-04T19:26:58.6294321","demandsImmediateReturn":true,"historicComplement":null,"informationAccountHolder":"gustavo lopes","instructionPriority":"HIGH","settlementId":"168977728252806228629684197639728721589","payer":{"checkCustomerAccountBalance":true,"name":"TOO EASY TRADING COMMODITIES","taxId":"47.175.222/0001-09"},"instantPaymentId":"019a5056-35b9-c0f8-0d49-61733bd4dc0a","eventStatus":{"code":"39","description":"Waiting credit validation"},"endToEndId":"E45246410202511041926rCHWKiNkvZP","customerDebitMadeByMip":true,"instructionType":"PAGPRI","initiationForm":"DICT","transactionPurpose":"IPAY"},"error":null}
+Payment confirmed for idempotencyId: 11dfcb3f-da19-4918-88c2-d03198bf8c9b
+{
+  data: {
+    receiver: {
+      receiverInstitutionISPB: 45246410,
+      receiverTaxId: '***.125.118-**',
+      addressingKey: 'd78793e5-4b08-4bce-91f6-ec879ea55909',
+      endToEndIdQuery: 'E45246410202511041926rCHWKiNkvZP'
+    },
+    value: 10,
+    additionalInformation: null,
+    customerInitiationTimestampUTC: '2025-11-04T19:26:58.6294321',
+    demandsImmediateReturn: true,
+    historicComplement: null,
+    informationAccountHolder: 'gustavo lopes',
+    instructionPriority: 'HIGH',
+    settlementId: '168977728252806228629684197639728721589',
+    payer: {
+      checkCustomerAccountBalance: true,
+      name: 'TOO EASY TRADING COMMODITIES',
+      taxId: '47.175.222/0001-09'
+    },
+    instantPaymentId: '019a5056-35b9-c0f8-0d49-61733bd4dc0a',
+    eventStatus: { code: '39', description: 'Waiting credit validation' },
+    endToEndId: 'E45246410202511041926rCHWKiNkvZP',
+    customerDebitMadeByMip: true,
+    instructionType: 'PAGPRI',
+    initiationForm: 'DICT',
+    transactionPurpose: 'IPAY'
+  },
+  error: null
+}