Skip to content
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

Missing values in sign_params when using service 4012 #11

Open
whysthatso opened this issue Dec 14, 2016 · 1 comment
Open

Missing values in sign_params when using service 4012 #11

whysthatso opened this issue Dec 14, 2016 · 1 comment

Comments

@whysthatso
Copy link

using: ipizza 2.0.1
hey,
the scenario: using authentication service of lhv

when creating a request for service 4011 all is well

> Ipizza::Provider::Lhv.new.authentication_request
#<Ipizza::AuthenticationRequest:0x00561258b4c538
 @extra_params={"VK_ENCODING"=>"UTF-8", "VK_LANG"=>nil},
 @service_url="https://www.lhv.ee/banklink",
 @sign_params=
  {"VK_SERVICE"=>4011,
   "VK_VERSION"=>"008",
   "VK_SND_ID"=>"SOME OÜ",
   "VK_RETURN"=>"https://www.example.com/endpoint",
   "VK_DATETIME"=>"2016-12-14T16:24:01+0200",
   "VK_RID"=>nil,
   "VK_REPLY"=>"3012",
   "VK_MAC"=>
    "XyrU7R9m2jK5q/Q9iiJ9ZJrhEhHExgwqgY+SPvjt10/1oRAcZWi5Jz1...."}>

however, when forcing service 4012 with additional params, the resulting sign_params is missing the crucial VK_REC_ID (bank's id, which i also tried to add to the configuration yaml to no avail), and the VK_NONCE. For some reason only VK_RID got merged from that hash.

> Ipizza::Provider::Lhv.new.authentication_request( 4012, { vk_nonce: '1' , vk_rid: '1'})
#<Ipizza::AuthenticationRequest:0x00561258b03540
 @extra_params={"VK_ENCODING"=>"UTF-8", "VK_LANG"=>nil},
 @service_url="https://www.lhv.ee/banklink",
 @sign_params=
  {"VK_SERVICE"=>4012,
   "VK_VERSION"=>"008",
   "VK_SND_ID"=>"SOME OÜ",
   "VK_RETURN"=>"https://www.example.com/endpoint",
   "VK_DATETIME"=>"2016-12-14T16:27:12+0200",
   "VK_RID"=>"1",
   "VK_MAC"=>
    "VI3AyDMkEjgIfGQqgZmjK6h4Z8eyA3wxrLhnp1jt9e5xU6u..."}>

it's pretty weird, as the case statement in provider/base.rb seems pretty straight forward.

am i missing anything?

Add:
initializer in my rails app under config/initializers/banklink.rb:
Ipizza::Config.load_from_file Rails.root.join('config', 'banklink.yml')

config yml: like the example from readme, only addition:
rec_id: LHV
but that did nothing

@whysthatso
Copy link
Author

@tanelj as you introduced this pattern, maybe you're the right one to talk to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant