ruby_ufebs 0.2.6 → 0.2.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5f30732a0da06a8bad33e326d405eb468331971
4
- data.tar.gz: 4ee7038d9e92074ddcdf108e1ae11fc90b8a170e
3
+ metadata.gz: cfda05f80c87fccdeb6bb3ef58fb6373d0fec16f
4
+ data.tar.gz: e4036b13cd0851a7e1cb6d2af85f75e3ce70b7b5
5
5
  SHA512:
6
- metadata.gz: f0481fd69b73f32bfd7b09c118a18a3dae7d49e3bfe8d1fe1ebee9a0a503acb475c40fc904147e0d284a0f71488b9608413c5ca20493dd42002225f05b22ea19
7
- data.tar.gz: ce5c5806ade72b46dea1ff6130af374847691213d99b1f4041a252ed9df5007ee8e2192a6959218295352532c73ef1a2c6b9055dca37894bad8a6bde50877d35
6
+ metadata.gz: 920239aaf564f57ca1e678fa6b2737718ce4cbd12ab8bd2e9766c1bd7f193027c48f90c580d799edf88e9191a78fa27b6da9ad8ede6d0ed99dd490203de9bc06
7
+ data.tar.gz: 0866099ff25bf804d0b16ce11d69ff2d56ad1b190d52c61f919c84fe5947775ed3b1812f0c2731282c302408dc8ea92e946cbccb4681fcb084bc70f19c5bf5bc
@@ -3,57 +3,21 @@ require_relative '../entities/session'
3
3
 
4
4
  module Ufebs
5
5
  module Documents
6
- class Package
6
+ class PackageResponse
7
7
  include HappyMapper
8
8
  register_namespace 'ed', "urn:cbr-ru:ed:v2.0"
9
- tag 'PacketEPD'
9
+ tag 'PacketESID'
10
10
  namespace 'ed'
11
11
 
12
- attribute :ed_date, String, tag: 'EDDate'
13
12
  attribute :ed_author, String, tag: 'EDAuthor'
13
+ attribute :ed_creation_time, String, tag: 'EDCreationTime'
14
+ attribute :ed_date, String, tag: 'EDDate'
15
+ attribute :ed_no, String, tag: 'EDNo'
14
16
  attribute :ed_receiver, String, tag: 'EDReceiver'
15
- attribute :number, String, tag: 'EDNo'
16
- attribute :quantity, String, tag: 'EDQuantity'
17
- attribute :sum, String, tag: 'Sum'
18
- attribute :system_code, String, tag: 'SystemCode'
19
17
 
20
- has_many :payment_orders, Ufebs::Documents::PaymentOrder
18
+ has_many :payment_responses, Ufebs::Documents::PaymentResponse
21
19
  has_one :session, ::Ufebs::Entities::Session, tag: 'Session', state_when_nil: false
22
-
23
- def initialize(payment_orders=[], params = {})
24
- @payment_orders = payment_orders
25
- @ed_date = Date.parse(params.fetch(:ed_date){Time.now}.to_s).strftime('%Y-%m-%d')
26
- @ed_author = params[:ed_author]
27
- @ed_receiver = params[:ed_receiver]
28
- @number = params[:number]
29
- @quantity = params[:quantity] || payment_orders.size
30
- @sum = params[:sum]
31
- @system_code = '01'
32
- super()
33
- end
34
-
35
- def to_xml(encoding: 'UTF-8')
36
- super(Nokogiri::XML::Builder.new(:encoding => encoding)).to_xml
37
- end
20
+ has_one :initial_packet, ::Ufebs::Entities::InitialPacket, tag: 'InitialPacketED', state_when_nil: false
38
21
  end
39
22
  end
40
23
  end
41
-
42
- # <?xml version="1.0" encoding="WINDOWS-1251"?>
43
- # <PacketESID xmlns="urn:cbr-ru:ed:v2.0" EDAuthor="4583001999" EDCreationTime="13:33:08" EDDate="2018-02-23" EDNo="1070230" EDReceiver="4525420000">
44
- # <dsig:SigValue xmlns:dsig="urn:cbr-ru:dsig:v1.1">MIIBaQYJKoZIhvcNAQcCoIIBWjCCAVYCAQExDjAMBggqhQMHAQECAgUAMAsGCSqGSIb3DQEHATGCATIwggEuAgEBMGAwTDELMAkGA1UEBhMCUlUxCzAJBgNVBAgTAjAwMQ8wDQYDVQQHEwZSVEdTQlIxDTALBgNVBAoTBEdDS0kxEDAOBgNVBAMTB0FETUlOQ0ECEEBQFMCd4KlDNKW6RlhblsQwDAYIKoUDBwEBAgIFAKBpMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTE4MDIyNzEzMzIzMlowLwYJKoZIhvcNAQkEMSIEIPretuTeA+Uosyhj6ROUT66yYTuZF+aaXclhxXXKmPxdMAwGCCqFAwcBAQEBBQAEQD/Ah3zv5DZv13fsX1Pcqd3Z7YFls14j+4rnYkrRuU31oR1clc4YUG1Lg71Hrp7q/uErXapd33FrjKyxO7Dvfxo=</dsig:SigValue>
45
- # <InitialPacketED EDAuthor="4525420000" EDDate="2018-02-23" EDNo="5"/>
46
- # <Session>
47
- # <SessionID>6</SessionID>
48
- # </Session>
49
- # <ED206 Acc="30101810945250000420" BICCorr="044525000" CorrAcc="40101810845250010102" DC="1" EDAuthor="4583001999" EDDate="2018-02-23" EDNo="1070231" EDReceiver="4525420000" Sum="381" SystemCode="01" TransDate="2018-02-23" TransTime="13:33:08">
50
- # <AccDoc AccDocDate="2018-02-23" AccDocNo="441"/>
51
- # <EDRefID EDAuthor="4525420000" EDDate="2018-02-23" EDNo="6"/>
52
- # <ProcessingDetails CreditDate="2018-02-23" DebitDate="2018-02-23"/>
53
- # </ED206>
54
- # <ED206 Acc="30101810945250000420" BICCorr="044525000" CorrAcc="40101810045250010041" DC="1" EDAuthor="4583001999" EDDate="2018-02-23" EDNo="1070232" EDReceiver="4525420000" Sum="680700" SystemCode="01" TransDate="2018-02-23" TransTime="13:33:08">
55
- # <AccDoc AccDocDate="2018-02-23" AccDocNo="459"/>
56
- # <EDRefID EDAuthor="4525420000" EDDate="2018-02-23" EDNo="7"/>
57
- # <ProcessingDetails CreditDate="2018-02-23" DebitDate="2018-02-23"/>
58
- # </ED206>
59
- # </PacketESID>
@@ -0,0 +1,20 @@
1
+ module Ufebs
2
+ module Entities
3
+ class InitialPacket
4
+ include HappyMapper
5
+ register_namespace 'ed', 'urn:cbr-ru:ed:v2.0'
6
+ namespace 'ed'
7
+ tag 'InitialPacketED'
8
+
9
+ attribute :ed_no, String, tag: 'EDNo'
10
+ attribute :ed_date, String, tag: 'EDDate'
11
+ attribute :ed_author, String, tag: 'EDAuthor'
12
+
13
+ def initialize(params = {})
14
+ params.each do |key, value|
15
+ instance_variable_set("@#{key}".to_sym, value)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
data/lib/ufebs/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RubyUfebs
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
data/lib/ufebs.rb CHANGED
@@ -167,7 +167,8 @@ module Ufebs
167
167
  def ED205(params)
168
168
  end
169
169
 
170
- def packetESID
170
+ def packetESID(params)
171
+ Ufebs::Documents::PackageResponse.parse(params)
171
172
  end
172
173
 
173
174
  def validate(doc)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_ufebs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Burdaev
@@ -435,6 +435,7 @@ files:
435
435
  - lib/ufebs/entities/ed_field_list.rb
436
436
  - lib/ufebs/entities/ed_reestr_info.rb
437
437
  - lib/ufebs/entities/ed_ref_id.rb
438
+ - lib/ufebs/entities/initial_packet.rb
438
439
  - lib/ufebs/entities/participant.rb
439
440
  - lib/ufebs/entities/processing_details.rb
440
441
  - lib/ufebs/entities/session.rb