factpulse 2.0.33 → 2.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -3
- data/Gemfile.lock +1 -1
- data/lib/factpulse/helpers/client.rb +17 -3
- data/lib/factpulse/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bea096152beab1702e0dc8563a51b1444575b3ab10b46faa132c463131da4343
|
|
4
|
+
data.tar.gz: 3ea017cd3b79701bb002780bc5418473de106394ff92db1361078929a6e0c8ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b4b21cadcc71ca317d3e7821be917f70971218cde09c9b2387f81753d23f8744fcf8e31bac878987ed51d76de6f257473b2faa4c147871b855c6e7d40bffae88
|
|
7
|
+
data.tar.gz: 2535bd23ad2f501c80eb7984e975416f77ae14539c0edda187ca3dc3e3152c2f84a22df952bb0a3dfd4f691b287fe9f559b5b53702cc7e3423cb2581577ea01c
|
data/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,7 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
## [2.0.
|
|
10
|
+
## [2.0.34] - 2025-11-29
|
|
11
11
|
|
|
12
12
|
### Added
|
|
13
13
|
- Version initiale du SDK ruby
|
|
@@ -24,5 +24,5 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
24
24
|
- Guide d'authentification JWT
|
|
25
25
|
- Configuration avancée (timeout, proxy, debug)
|
|
26
26
|
|
|
27
|
-
[Unreleased]: https://github.com/factpulse/sdk-ruby/compare/v2.0.
|
|
28
|
-
[2.0.
|
|
27
|
+
[Unreleased]: https://github.com/factpulse/sdk-ruby/compare/v2.0.34...HEAD
|
|
28
|
+
[2.0.34]: https://github.com/factpulse/sdk-ruby/releases/tag/v2.0.34
|
data/Gemfile.lock
CHANGED
|
@@ -364,6 +364,9 @@ module FactPulse
|
|
|
364
364
|
# Télécharge un flux entrant depuis la PDP AFNOR et extrait les métadonnées
|
|
365
365
|
# de la facture vers un format JSON unifié. Supporte Factur-X, CII et UBL.
|
|
366
366
|
#
|
|
367
|
+
# Note: Cet endpoint utilise l'authentification JWT FactPulse (pas OAuth AFNOR).
|
|
368
|
+
# Le serveur FactPulse se charge d'appeler la PDP avec les credentials stockés.
|
|
369
|
+
#
|
|
367
370
|
# @param flow_id [String] Identifiant du flux (UUID)
|
|
368
371
|
# @param include_document [Boolean] Si true, inclut le document en base64
|
|
369
372
|
# @return [Hash] Métadonnées de la facture (fournisseur, montants, dates, etc.)
|
|
@@ -373,9 +376,20 @@ module FactPulse
|
|
|
373
376
|
# puts "Fournisseur: #{facture['fournisseur']['nom']}"
|
|
374
377
|
# puts "Montant TTC: #{facture['montant_ttc']} #{facture['devise']}"
|
|
375
378
|
def obtenir_facture_entrante_afnor(flow_id, include_document: false)
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
+
ensure_authenticated
|
|
380
|
+
uri = URI("#{@api_url}/api/v1/afnor/flux-entrants/#{flow_id}")
|
|
381
|
+
uri.query = "include_document=true" if include_document
|
|
382
|
+
|
|
383
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
384
|
+
http.use_ssl = uri.scheme == 'https'
|
|
385
|
+
http.read_timeout = 60
|
|
386
|
+
|
|
387
|
+
request = Net::HTTP::Get.new(uri)
|
|
388
|
+
request['Authorization'] = "Bearer #{@access_token}"
|
|
389
|
+
|
|
390
|
+
response = http.request(request)
|
|
391
|
+
raise FactPulseValidationError.new("Erreur flux entrant: #{response.code}") unless response.is_a?(Net::HTTPSuccess)
|
|
392
|
+
JSON.parse(response.body) rescue {}
|
|
379
393
|
end
|
|
380
394
|
|
|
381
395
|
# Vérifie la disponibilité du Flow Service AFNOR.
|
data/lib/factpulse/version.rb
CHANGED