pepijn / omni_kassa

Easier Rabobank OmniKassa payments
MIT License
9 stars 7 forks source link

Response code 90 #6

Closed tombruijn closed 10 years ago

tombruijn commented 10 years ago

In omni_kassa/response.rb response code 90 is handled as a pending response. However in the documentation I received from Rabobank ("Integratiehandleiding Rabo OmniKassa, versie 7.1, april 2014") it is being defined as:

Which seems to be an error response in all cases it is defined (in the manual).

Did something change, did I miss something in the manual that says it should be treated as a pending response?

pepijn commented 10 years ago

Hmmm I think that we received this error sometimes, while nothing was wrong. The OmniKassa-server was temporarily unavailable, as it says in your first example. When it retries later, it works. So that's why it is #pending?. Makes sense?

tombruijn commented 10 years ago

I can't really test to see how it works when naturally throwing an 90 response code. If I make it throw response code 90, through one of the CC options and making the last two numbers of the card 90, it won't retry the order at a later time, is this supposed to happen?

pepijn commented 10 years ago

Maybe @koenpunt remembers? 8d05798eff69dcc4045cb36b70af72f65d136e75

tombruijn commented 10 years ago

I see it's also the case in the "official" PHP (and .NET) example code Koen mentions in his commit.

// Translate transaction status code
protected function getTransactionStatus($sTransactionCode)
{
  if(in_array($sTransactionCode, array('00'))) // SUCCESS
  {
    return 'SUCCESS';
  }
  elseif(in_array($sTransactionCode, array('60', '90'))) // PENDING
  {
    return 'PENDING';
  }
  elseif(in_array($sTransactionCode, array('97'))) // EXPIRED
  {
    return 'EXPIRED';
  }
  elseif(in_array($sTransactionCode, array('17'))) // CANCELLED
  {
    return 'CANCELLED';
  }

  return 'FAILED';
}

I just don't know if maybe things have changed since then, unlikely, but so far I haven't seen why this would differ from the docs, based on the tests I've done with the test integration. So far, the documented meaning of code 90 doesn't reflect their example code.

pepijn commented 10 years ago

Can we close this issue, or do you still face problems concerning the status codes?

koenpunt commented 10 years ago

I don't know. I don't believe I still have the documentation from that time so I can't compare..

tombruijn commented 10 years ago

I've forked the repo and made a branch that handles response code 90 differently: tombruijn/omni_kassa/tree/response_code_90

I'll run this implementation for now while I'll contact Rabobank support. For now you can close this issue @pepijn. If anything breaks or I get a definitive answer about the response code I'll update this issue or create a new one referencing this one.

pepijn commented 10 years ago

Cool, thanks!

tombruijn commented 10 years ago

So I got a response back from Rabobank OmniKassa, really quickly as well. They said the code examples were not correct and that code 90 is an error code as described in the documentation. They'll update the examples next week or the week after that. I asked to be notified when that happens.

Until then I'll keep handling code 90 as an error code. I've also created pull request #7 to update the OmniKassa::Response class to update the response handling. I hope you'll merge it in, but if you want to wait until the example code is updated I can understand that as well. Please leave it open until the code is updated in the coming weeks.

pepijn commented 10 years ago

I think this it what everyone should be doing then, so I've merged it. Thanks!

pepijn commented 10 years ago

https://github.com/pepijn/omni_kassa/releases/tag/v1.5.0