-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refacts building headers #153
Conversation
Hi @jplot, I see the value in this refactoring and the idea behind. My main issue is having to call the |
Would you rather see something in this style? class Epics::GenericRequest
def header
header_builder = Epics::HeaderBuilder.new(client)
header_builder.nonce = nonce
header_builder.timestamp = timestamp
yield header_builder if block_given?
header_builder.build
end
end
class Epics::AZV < Epics::GenericUploadRequest
def header
super do |header_builder|
header_builder.order_type = 'CD1'
header_builder.order_attribute = 'OZHNN'
header_builder.order_params = ''
header_builder.num_segment = 1
end
end
end |
It does get rid of the init_header method What's the point of initiating the header builder with the client just to assign every other field individually to the object afterwards? |
The idea is to harmonize and centralize header creation and then add ebics 2.4 support. In France, most banks are still on 2.4 |
Oh, I did not question the motivation, just the technical design. I am mostly happy with the current approach. I see the value of the named parameters. It is a breaking change, however it should not be an issue as I do not expect anyone to directly call any of the request classes. I think I need to sleep over that. I assume this will help with the additional changes you have in mind for supporting EBICS 2.4? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I think we should try to get consistent in the different order types
A solution for simplifying the construction of order parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Please consider applying your changes from jplot@a396543. I think that would make it less surprising to use the HeaderRequest
class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double checked the generated headers to the previous version and they look identical
No description provided.