Skip to content

Proposal - add NotifiyRequest functions to AbstractResponse #245

@eileenmcnaughton

Description

@eileenmcnaughton

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions