@@ -19,7 +19,7 @@ def timestamp
1919 def_delegators :client , :host_id , :user_id , :partner_id
2020
2121 def root
22- " ebicsRequest"
22+ ' ebicsRequest'
2323 end
2424
2525 def body
@@ -34,75 +34,78 @@ def header
3434
3535 def auth_signature
3636 Nokogiri ::XML ::Builder . new do |xml |
37- xml . AuthSignature {
38- xml . send ( 'ds:SignedInfo' ) {
39- xml . send ( 'ds:CanonicalizationMethod' , '' , Algorithm : " http://www.w3.org/TR/2001/REC-xml-c14n-20010315" )
40- xml . send ( 'ds:SignatureMethod' , '' , Algorithm : " http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" )
41- xml . send ( 'ds:Reference' , '' , URI : "#xpointer(//*[@authenticate='true'])" ) {
42- xml . send ( 'ds:Transforms' ) {
43- xml . send ( 'ds:Transform' , '' , Algorithm : " http://www.w3.org/TR/2001/REC-xml-c14n-20010315" )
44- }
45- xml . send ( 'ds:DigestMethod' , '' , Algorithm : " http://www.w3.org/2001/04/xmlenc#sha256" )
37+ xml . AuthSignature do
38+ xml . send ( 'ds:SignedInfo' ) do
39+ xml . send ( 'ds:CanonicalizationMethod' , '' , Algorithm : ' http://www.w3.org/TR/2001/REC-xml-c14n-20010315' )
40+ xml . send ( 'ds:SignatureMethod' , '' , Algorithm : ' http://www.w3.org/2001/04/xmldsig-more#rsa-sha256' )
41+ xml . send ( 'ds:Reference' , '' , URI : "#xpointer(//*[@authenticate='true'])" ) do
42+ xml . send ( 'ds:Transforms' ) do
43+ xml . send ( 'ds:Transform' , '' , Algorithm : ' http://www.w3.org/TR/2001/REC-xml-c14n-20010315' )
44+ end
45+ xml . send ( 'ds:DigestMethod' , '' , Algorithm : ' http://www.w3.org/2001/04/xmlenc#sha256' )
4646 xml . send ( 'ds:DigestValue' , '' )
47- }
48- }
47+ end
48+ end
4949 xml . send ( 'ds:SignatureValue' , '' )
50- }
50+ end
5151 end . doc . root
5252 end
5353
5454 def to_transfer_xml
5555 Nokogiri ::XML ::Builder . new do |xml |
56- xml . send ( root , 'xmlns:ds' => 'http://www.w3.org/2000/09/xmldsig#' , 'xmlns' => 'urn:org:ebics:H004' , 'Version' => 'H004' , 'Revision' => '1' ) {
57- xml . header ( authenticate : true ) {
58- xml . static {
56+ xml . send ( root , 'xmlns:ds' => 'http://www.w3.org/2000/09/xmldsig#' , 'xmlns' => client . urn_schema ,
57+ 'Version' => client . version , 'Revision' => '1' ) do
58+ xml . header ( authenticate : true ) do
59+ xml . static do
5960 xml . HostID host_id
6061 xml . TransactionID transaction_id
61- }
62- xml . mutable {
62+ end
63+ xml . mutable do
6364 xml . TransactionPhase 'Transfer'
6465 xml . SegmentNumber ( 1 , lastSegment : true )
65- }
66- }
66+ end
67+ end
6768 xml . parent . add_child ( auth_signature )
68- xml . body {
69- xml . DataTransfer {
69+ xml . body do
70+ xml . DataTransfer do
7071 xml . OrderData encrypted_order_data
71- }
72- }
73- }
72+ end
73+ end
74+ end
7475 end . to_xml ( save_with : Nokogiri ::XML ::Node ::SaveOptions ::AS_XML , encoding : 'utf-8' )
7576 end
7677
7778 def to_receipt_xml
7879 Nokogiri ::XML ::Builder . new do |xml |
79- xml . send ( root , 'xmlns:ds' => 'http://www.w3.org/2000/09/xmldsig#' , 'xmlns' => 'urn:org:ebics:H004' , 'Version' => 'H004' , 'Revision' => '1' ) {
80- xml . header ( authenticate : true ) {
81- xml . static {
80+ xml . send ( root , 'xmlns:ds' => 'http://www.w3.org/2000/09/xmldsig#' , 'xmlns' => client . urn_schema ,
81+ 'Version' => client . version , 'Revision' => '1' ) do
82+ xml . header ( authenticate : true ) do
83+ xml . static do
8284 xml . HostID host_id
8385 xml . TransactionID ( transaction_id )
84- }
85- xml . mutable {
86+ end
87+ xml . mutable do
8688 xml . TransactionPhase 'Receipt'
87- }
88- }
89+ end
90+ end
8991 xml . parent . add_child ( auth_signature )
90- xml . body {
91- xml . TransferReceipt ( authenticate : true ) {
92+ xml . body do
93+ xml . TransferReceipt ( authenticate : true ) do
9294 xml . ReceiptCode 0
93- }
94- }
95- }
95+ end
96+ end
97+ end
9698 end . to_xml ( save_with : Nokogiri ::XML ::Node ::SaveOptions ::AS_XML , encoding : 'utf-8' )
9799 end
98100
99101 def to_xml
100102 Nokogiri ::XML ::Builder . new do |xml |
101- xml . send ( root , 'xmlns:ds' => 'http://www.w3.org/2000/09/xmldsig#' , 'xmlns' => 'urn:org:ebics:H004' , 'Version' => 'H004' , 'Revision' => '1' ) {
103+ xml . send ( root , 'xmlns:ds' => 'http://www.w3.org/2000/09/xmldsig#' , 'xmlns' => client . urn_schema ,
104+ 'Version' => client . version , 'Revision' => '1' ) do
102105 xml . parent . add_child ( header )
103106 xml . parent . add_child ( auth_signature )
104107 xml . parent . add_child ( body )
105- }
108+ end
106109 end . to_xml ( save_with : Nokogiri ::XML ::Node ::SaveOptions ::AS_XML , encoding : 'utf-8' )
107110 end
108111end
0 commit comments