Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Nefukční test #1

Closed
erikdung opened this issue Oct 28, 2016 · 6 comments
Closed

Nefukční test #1

erikdung opened this issue Oct 28, 2016 · 6 comments

Comments

@erikdung
Copy link
Contributor

Ahoj, díky za modul. Na tohle jsem čekal. Bohužel se mi to nedaří zprovoznit demo příklad.
Dostal jsem error:
(node:90107) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Neplatny podpis SOAP zpravy (4)
(node:90107) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@JakubMrozek
Copy link
Owner

JakubMrozek commented Oct 28, 2016

A tohle ti funguje?

const eet = require('eet')
const fs = require('fs')

// privatni klic a certifikat podnikatele
const options = {
  privateKey: fs.readFileSync('./node_modules/eet/test/keys/private.pem'),
  certificate: fs.readFileSync('./node_modules/eet/test/keys/certificate.pem'),
  playground: true
}

// polozky, ktere se posilaji do EET
const items = {
  dicPopl: 'CZ1212121218',
  idPokl: '/5546/RO24',
  poradCis: '0/6460/ZQ42',
  datTrzby: new Date(),
  celkTrzba: 34113,
  idProvoz: '273'
}

// ziskani FIK v Node.js 6+
eet(options, items).then(response => {
  // response.fik
  console.log(response)
})

Pokud ti tohle projde, tak je chyba v certifikátech. Zkontroluj, zda je privátní klíč i certifikát správný.

@JakubMrozek
Copy link
Owner

Jinak testováno na Node.js v6.8.1 a Macu.

@erikdung
Copy link
Contributor Author

tak už jsem našel tu příčinu, u těch klíčů se vygenerují při převodu z .p12 ještě tyto věci
Bag Attributes localKeyID: 79 A6 E8 CF 65 CF 6E D2 D7 B5 F3 B4 9F 53 9C F5 76 BE E0 F6 Key Attributes: <No Attributes>
Když jsem to smazal z těch klíčů, tak to funguje. Možná je dobré to napsat také do sekce, kde máš
ten návod na převod z .p12 na .pem :)
Díky za pomoc 👍

@JakubMrozek
Copy link
Owner

Aha, díky, doplním to tam při příštím releasu.

@JakubMrozek
Copy link
Owner

Upravena dokumentace.

@janoskaz
Copy link

Demo příklad mi nefunguje, nevypršela platnost klíče/cetifikátu?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants