Module: Ufebs
- Extended by:
- Ufebs
- Included in:
- Ufebs
- Defined in:
- lib/ufebs.rb,
lib/ufebs/configuration.rb,
lib/ufebs/entities/bank.rb,
lib/ufebs/fields/header.rb,
lib/ufebs/entities/acc_doc.rb,
lib/ufebs/requests/receipt.rb,
lib/ufebs/documents/package.rb,
lib/ufebs/entities/participant.rb,
lib/ufebs/requests/test_request.rb,
lib/ufebs/requests/group_request.rb,
lib/ufebs/documents/payment_order.rb,
lib/ufebs/requests/package_request.rb,
lib/ufebs/entities/departmental_info.rb,
lib/ufebs/entities/processing_details.rb
Defined Under Namespace
Modules: Documents, Entities, Fields, Requests Classes: Configuration
Instance Method Summary collapse
- #configuration ⇒ Object
-
#configure(&block) ⇒ Object
Конфигурация.
-
#ED101(params) ⇒ Ufebs::Documents::PaymentOrder+
Создание XML по формату ED101(Платежное поручение).
- #ED210(params) ⇒ Object
-
#ED211(params) ⇒ Object
Создание/Парсинг выписки ED211 ed211 = Ufebs::Requests::Receipt.new( number: ‘8’, ed_date: ‘2003-04-14’, ed_author: ‘4525545000’, ed_receiver: ‘4525000000’, abstract_date: Date.today, abstract_kind: ‘1’, acc: ‘30101810945250000420’, bic: ‘044525000’, end_time: ‘00:47:07’, enter_bal: ‘72619100’, inquiry_session: ‘0’, last_movet_date: Date.today, out_bal: ‘72619100’, rtgs_unconfirmed_ed: ‘0’ ).
- #ED218(params) ⇒ Object
- #ED243(params) ⇒ Object
- #ED244 ⇒ Object
-
#ED999(params) ⇒ Object
XML запрос-зонд.
- #namespace ⇒ Object
- #PackedEPD(payment_eds, params) ⇒ Object
- #validate(doc) ⇒ Object
- #validation_schema ⇒ Object
Instance Method Details
#configuration ⇒ Object
16 17 18 |
# File 'lib/ufebs.rb', line 16 def configuration @configuration ||= Configuration.new end |
#configure(&block) ⇒ Object
Конфигурация
21 22 23 |
# File 'lib/ufebs.rb', line 21 def configure(&block) block.call(configuration) end |
#ED101(params) ⇒ Ufebs::Documents::PaymentOrder+
Создание XML по формату ED101(Платежное поручение)
138 139 140 |
# File 'lib/ufebs.rb', line 138 def ED101(params) params.is_a?(Hash) ? Ufebs::Documents::PaymentOrder.new(params) : Ufebs::Documents::PaymentOrder.parse(params) end |
#ED210(params) ⇒ Object
41 42 |
# File 'lib/ufebs.rb', line 41 def ED210(params) end |
#ED211(params) ⇒ Object
Создание/Парсинг выписки ED211 ed211 = Ufebs::Requests::Receipt.new(
number: '8',
ed_date: '2003-04-14',
ed_author: '4525545000',
ed_receiver: '4525000000',
abstract_date: Date.today,
abstract_kind: '1',
acc: '30101810945250000420',
bic: '044525000',
end_time: '00:47:07',
enter_bal: '72619100',
inquiry_session: '0',
last_movet_date: Date.today,
out_bal: '72619100',
rtgs_unconfirmed_ed: '0'
)
64 65 66 |
# File 'lib/ufebs.rb', line 64 def ED211(params) params.is_a?(Hash) ? Ufebs::Requests::Receipt.new(params) : Ufebs::Requests::Receipt.parse(params) end |
#ED218(params) ⇒ Object
71 72 |
# File 'lib/ufebs.rb', line 71 def ED218(params) end |
#ED243(params) ⇒ Object
68 69 |
# File 'lib/ufebs.rb', line 68 def ED243(params) end |
#ED244 ⇒ Object
74 75 |
# File 'lib/ufebs.rb', line 74 def ED244 end |
#ED999(params) ⇒ Object
XML запрос-зонд
37 38 39 |
# File 'lib/ufebs.rb', line 37 def ED999(params) Ufebs::Requests::TestRequest.new(params) end |
#namespace ⇒ Object
12 13 14 |
# File 'lib/ufebs.rb', line 12 def namespace "urn:cbr-ru:ed:v2.0".freeze end |
#PackedEPD(payment_eds, params) ⇒ Object
142 143 144 |
# File 'lib/ufebs.rb', line 142 def PackedEPD(payment_eds, params) Ufebs::Documents::Package.new(payment_eds, params) end |
#validate(doc) ⇒ Object
146 147 148 149 150 151 152 153 154 155 |
# File 'lib/ufebs.rb', line 146 def validate(doc) doc = Nokogiri::XML(doc) if doc.is_a?(String) errors = [] validation_schema.validate(doc).each do |error| errors << error. puts error. end errors.empty? end |
#validation_schema ⇒ Object
25 26 27 28 29 30 |
# File 'lib/ufebs.rb', line 25 def validation_schema @validation ||= begin validation = Nokogiri::XML(File.read(configuration.schemas), configuration.schemas) Nokogiri::XML::Schema.from_document(validation) end end |