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

Added ability to change endpoint urls #16

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4daf2f7
Added ability to change endpoint urls
3dgroup May 31, 2016
49d9807
changed opening brace to new lines
3dgroup May 31, 2016
4b467bc
updated closing brace position
3dgroup May 31, 2016
d6d40ee
Added Realex PayandShop.com default values
3dgroup Jun 2, 2016
31cf30b
changed formatting and removed comments
3dgroup Jun 6, 2016
ec574a3
removed commented line
3dgroup Jul 11, 2016
4a8f35b
xml text node coding problem bugfix
Oct 7, 2016
746a6fe
replace tabs to 4 spaces
Oct 11, 2016
0f14eb8
tidy changes
Oct 11, 2016
8543016
RemoteAbstractRequest Amount node currency attribute value convert wa…
Oct 12, 2016
6abd1d3
added space after comma
Oct 12, 2016
be85459
added Redirect features
3dgroup Jun 15, 2017
a7c887c
Merge remote-tracking branch 'refs/remotes/digitickets/master'
3dgroup Jun 15, 2017
a0c0b24
format code
3dgroup Jun 16, 2017
ddef3d6
cs fixer update
3dgroup Jun 16, 2017
c40724a
Format fix's
3dgroup Jun 16, 2017
dc32d8e
more formatting
3dgroup Jun 16, 2017
8b929e4
formatting issue
3dgroup Jun 16, 2017
53e342d
formatting
3dgroup Jun 16, 2017
bad47ad
format issue
3dgroup Jun 16, 2017
0802aab
Multi line format issue
3dgroup Jun 16, 2017
948b737
formatting
3dgroup Jun 16, 2017
3b83247
formatting issue
3dgroup Jun 16, 2017
71ecb9a
formatting last attempt
3dgroup Jun 16, 2017
d270e3c
Code Tidy
3dgroup Apr 16, 2018
cab2de2
Merge remote-tracking branch 'refs/remotes/digitickets/master'
3dgroup Apr 16, 2018
4072174
Merge remote-tracking branch 'origin/master'
3dgroup Apr 16, 2018
6a9b41e
Rename response.php to Response.php
3dgroup May 18, 2020
6e6e542
Add script timeout
3dgroup Oct 15, 2020
3a45694
Merge branch 'digitickets:master' into master
3dgroup Apr 22, 2022
d534dac
Update dataVaultResponse.php
3dgroup May 5, 2022
1e71f28
Update RedirectCompleteStoreCardRequest.php
3dgroup May 5, 2022
23333f8
Update RemoteAbstractRequest.php
3dgroup Aug 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Omnipay/Realex/Message/AuthRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/
class AuthRequest extends RemoteAbstractRequest
{
protected $endpoint = 'https://epage.payandshop.com/epage-remote.cgi';

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not make more sense to leave the endpoint property in place, and allow the setter and getter to set it/access it? Also by removing it will break the existing Global Iris driver, which extends these requests (see https://github.com/coatesap/omnipay-global-iris/blob/master/src/Omnipay/GlobalIris/Message/AuthRequest.php for example). If there is no real reason to remove it, I'd rather not have to remove/upgrade/lock down the Global Iris driver...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sort of agree with this implementation. This makes it possible to inject the parameters at the configuration stage (as per the merchant ID etc). Obviously the omnipay interfaces need to be adhered to so this results in not being able to explicitly pass the endpoint other than in the params.

public function getCavv()
{
Expand Down Expand Up @@ -161,6 +160,10 @@ protected function createResponse($data)

public function getEndpoint()
{
return $this->endpoint;
return $this->getParameter('AuthEndpoint');
}
public function setAuthEndpoint($value)
{
return $this->setParameter('AuthEndpoint', $value);
}
}
7 changes: 5 additions & 2 deletions src/Omnipay/Realex/Message/CreateCardRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

class CreateCardRequest extends RemoteAbstractRequest
{
protected $endpoint = 'https://epage.payandshop.com/epage-remote-plugins.cgi';

public function getCustomerRef()
{
Expand Down Expand Up @@ -97,6 +96,10 @@ protected function createResponse($data)

public function getEndpoint()
{
return $this->endpoint;
return $this->getParameter('AuthEndpoint');
}
public function setAuthEndpoint($value)
{
return $this->setParameter('AuthEndpoint', $value);
}
}
7 changes: 5 additions & 2 deletions src/Omnipay/Realex/Message/CreateCustomerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class CreateCustomerRequest extends RemoteAbstractRequest
{
protected $endpoint = 'https://epage.payandshop.com/epage-remote-plugins.cgi';

public function getCustomerRef()
{
Expand Down Expand Up @@ -119,6 +118,10 @@ protected function createResponse($data)

public function getEndpoint()
{
return $this->endpoint;
return $this->getParameter('AuthEndpoint');
}
public function setAuthEndpoint($value)
{
return $this->setParameter('AuthEndpoint', $value);
}
}
7 changes: 5 additions & 2 deletions src/Omnipay/Realex/Message/DeleteCardRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

class DeleteCardRequest extends RemoteAbstractRequest
{
protected $endpoint = 'https://epage.payandshop.com/epage-remote-plugins.cgi';

public function getCustomerRef()
{
Expand Down Expand Up @@ -71,6 +70,10 @@ protected function createResponse($data)

public function getEndpoint()
{
return $this->endpoint;
return $this->getParameter('AuthEndpoint');
}
public function setAuthEndpoint($value)
{
return $this->setParameter('AuthEndpoint', $value);
}
}
7 changes: 5 additions & 2 deletions src/Omnipay/Realex/Message/EnrolmentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
class EnrolmentRequest extends RemoteAbstractRequest
{
protected $endpoint = 'https://epage.payandshop.com/epage-3dsecure.cgi';

/**
* Get the XML registration string to be sent to the gateway
Expand Down Expand Up @@ -122,6 +121,10 @@ protected function createResponse($data)

public function getEndpoint()
{
return $this->endpoint;
return $this->getParameter('3dSecureEndpoint');
}
public function setAuthEndpoint($value)
{
return $this->setParameter('3dSecureEndpoint', $value);
}
}
7 changes: 5 additions & 2 deletions src/Omnipay/Realex/Message/FetchTransactionRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
class FetchTransactionRequest extends RemoteAbstractRequest
{
protected $endpoint = 'https://epage.payandshop.com/epage-remote.cgi';

/**
* Get the XML registration string to be sent to the gateway
Expand Down Expand Up @@ -69,6 +68,10 @@ protected function createResponse($data)

public function getEndpoint()
{
return $this->endpoint;
return $this->getParameter('3dSecureEndpoint');
}
public function setAuthEndpoint($value)
{
return $this->setParameter('3dSecureEndpoint', $value);
}
}
7 changes: 5 additions & 2 deletions src/Omnipay/Realex/Message/RefundRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
class RefundRequest extends RemoteAbstractRequest
{
protected $endpoint = 'https://epage.payandshop.com/epage-remote.cgi';

public function getTransactionReference()
{
Expand Down Expand Up @@ -138,6 +137,10 @@ protected function createResponse($data)

public function getEndpoint()
{
return $this->endpoint;
return $this->getParameter('AuthEndpoint');
}
public function setAuthEndpoint($value)
{
return $this->setParameter('AuthEndpoint', $value);
}
}
8 changes: 6 additions & 2 deletions src/Omnipay/Realex/Message/SavedAuthRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
class SavedAuthRequest extends RemoteAbstractRequest
{
protected $endpoint = 'https://epage.payandshop.com/epage-remote.cgi';
// protected $endpoint = 'https://epage.payandshop.com/epage-remote.cgi';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this line is no longer used, it should be removed rather than commented out.


public function getCavv()
{
Expand Down Expand Up @@ -154,6 +154,10 @@ protected function createResponse($data)

public function getEndpoint()
{
return $this->endpoint;
return $this->getParameter('SecureDataVaultEndpoint');
}
public function setAuthEndpoint($value)
{
return $this->setParameter('SecureDataVaultEndpoint', $value);
}
}
8 changes: 5 additions & 3 deletions src/Omnipay/Realex/Message/UpdateCardRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

class UpdateCardRequest extends RemoteAbstractRequest
{
protected $endpoint = 'https://epage.payandshop.com/epage-remote-plugins.cgi';

public function getCustomerRef()
{
return $this->getParameter('customerRef');
Expand Down Expand Up @@ -97,6 +95,10 @@ protected function createResponse($data)

public function getEndpoint()
{
return $this->endpoint;
return $this->getParameter('SecureDataVaultEndpoint');
}
public function setAuthEndpoint($value)
{
return $this->setParameter('SecureDataVaultEndpoint', $value);
}
}
8 changes: 5 additions & 3 deletions src/Omnipay/Realex/Message/UpdateCustomerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

class UpdateCustomerRequest extends RemoteAbstractRequest
{
protected $endpoint = 'https://epage.payandshop.com/epage-remote-plugins.cgi';

public function getCustomerRef()
{
return $this->getParameter('customerRef');
Expand Down Expand Up @@ -119,6 +117,10 @@ protected function createResponse($data)

public function getEndpoint()
{
return $this->endpoint;
return $this->getParameter('SecureDataVaultEndpoint');
}
public function setAuthEndpoint($value)
{
return $this->setParameter('SecureDataVaultEndpoint', $value);
}
}
9 changes: 5 additions & 4 deletions src/Omnipay/Realex/Message/VerifySigRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
*/
class VerifySigRequest extends RemoteAbstractRequest
{
protected $endpoint = 'https://epage.payandshop.com/epage-remote.cgi';


/**
* Decode our previously-encoded Merchant Data
*
Expand Down Expand Up @@ -126,7 +123,11 @@ protected function createResponse($data)

public function getEndpoint()
{
return $this->endpoint;
return $this->getParameter('SecureDataVaultEndpoint');
}
public function setAuthEndpoint($value)
{
return $this->setParameter('SecureDataVaultEndpoint', $value);
}

/**
Expand Down
8 changes: 5 additions & 3 deletions src/Omnipay/Realex/Message/VoidRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
*/
class VoidRequest extends RemoteAbstractRequest
{
protected $endpoint = 'https://epage.payandshop.com/epage-remote.cgi';

public function getTransactionReference()
{
return $this->getParameter('pasRef');
Expand Down Expand Up @@ -97,6 +95,10 @@ protected function createResponse($data)

public function getEndpoint()
{
return $this->endpoint;
return $this->getParameter('SecureDataVaultEndpoint');
}
public function setAuthEndpoint($value)
{
return $this->setParameter('SecureDataVaultEndpoint', $value);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should getters/setters not be using lower-camel-case parameter names to match the defaults defined in RemoteGateway.php? I'm not sure if the parameter bag is case-insenstive, but it would seem to make sense to be consistent with the other getters/setters...

}
}
38 changes: 37 additions & 1 deletion src/Omnipay/Realex/RemoteGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function getDefaultParameters()
'merchantId' => '',
'account' => '',
'secret' => '',
'3dSecure' => 0
'3dSecure' => 0,
'authEndpoint'=>'https://epage.payandshop.com/epage-remote.cgi',
'secureDataVaultEndpoint'=>'https://epage.payandshop.com/epage-remote-plugins.cgi',
'3dSecureEndpoint'=>'https://epage.payandshop.com/epage-3dsecure.cgi'
);
}

Expand Down Expand Up @@ -150,4 +153,37 @@ public function updateCustomer(array $parameters = array())
{
return $this->createRequest('\Omnipay\Realex\Message\UpdateCustomerRequest', $parameters);
}

/**
* Setup service endpoint links for different realex service providers
*/
public function setAuthEndpoint($value)
{
return $this->setParameter('AuthEndpoint', $value);
}

public function getAuthEndpoint()
{
return $this->getParameter('AuthEndpoint');
}

public function setSecureDataVaultEndpoint($value)
{
return $this->setParameter('SecureDataVaultEndpoint', $value);
}

public function getSecureDataVaultEndpoint()
{
return $this->getParameter('SecureDataVaultEndpoint');
}

public function set3DSecureEndpoint($value)
{
return $this->setParameter('3dSecureEndpoint', $value);
}

public function get3DSecureEndpoint()
{
return $this->getParameter('3dSecureEndpoint');
}
}