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

Proposal - add NotifiyRequest functions to AbstractResponse #245

Open
eileenmcnaughton opened this issue Jan 11, 2021 · 0 comments
Open

Comments

@eileenmcnaughton
Copy link
Contributor

Sagepay requires that after a NotifyRequest is received calls are made back to the mothership. In order to facilitate this it has 3 functions:

  • accept / confirm
  • reject / error
  • invalid

The difference between reject & invalid is a little confusing but putting that aside for now - I think ideally the code that implemets omnipay could to

     $response = $this->gateway->acceptNotification($params)->send();
     $this->loadStoredDataAboutTransaction($response->getTransactionId();
     if ($response->isSuccessful()) {
         
         // do some validation to check it's in the DB & is legit.
         // we also set some params on the gateway from that stored data as accept does a checksum
         // comparison and then....
          $this->gateway->accept();
     }

without having to adapt the code by gateway to see if the method exists. Although Sagepay is a bit of an outlier there are others - for example mercanet has to call confirm() in order to echo the right thing for Mercanet to see the IPN as successful. I also suspect it's likely to become more common over time as the Sagepay one is a bit more secure..

A complication is Sagepay actually returns an instance of a request rather than a response - but I think that is something that should be fixed within sagepay

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