Skip to content

Commit

Permalink
Update Live and Test URLs as per Opayo requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Burchell committed Nov 3, 2023
1 parent 2925574 commit aaf8a90
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ abstract class AbstractRequest extends OmnipayAbstractRequest implements Constan
/**
* @var string Endpoint base URLs.
*/
protected $liveEndpoint = 'https://live.sagepay.com/gateway/service';
protected $testEndpoint = 'https://test.sagepay.com/gateway/service';
protected $liveEndpoint = 'https://live.opayo.eu.elavon.com/gateway/service';
protected $testEndpoint = 'https://sandbox.opayo.eu.elavon.com/gateway/service';

/**
* Convenience method to switch iframe mode on or off.
Expand Down
4 changes: 2 additions & 2 deletions src/Message/Form/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class Response extends AbstractResponse implements RedirectResponseInterface, Co
/**
* @var string Endpoint base URLs.
*/
protected $liveEndpoint = 'https://live.sagepay.com/gateway/service/vspform-register.vsp';
protected $testEndpoint = 'https://test.sagepay.com/gateway/service/vspform-register.vsp';
protected $liveEndpoint = 'https://live.opayo.eu.elavon.com/gateway/service/vspform-register.vsp';
protected $testEndpoint = 'https://sandbox.opayo.eu.elavon.com/gateway/service/vspform-register.vsp';

/**
* Always a redirect, so not yet successful.
Expand Down
4 changes: 2 additions & 2 deletions tests/DirectGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function testAuthorize3dSecure()
$this->assertTrue($response->isRedirect());
$this->assertNull($response->getTransactionReference());
$this->assertNull($response->getMessage());
$this->assertSame('https://test.sagepay.com/Simulator/3DAuthPage.asp', $response->getRedirectUrl());
$this->assertSame('https://sandbox.opayo.eu.elavon.com/Simulator/3DAuthPage.asp', $response->getRedirectUrl());

$redirectData = $response->getRedirectData();
$this->assertSame('065379457749061954', $redirectData['MD']);
Expand Down Expand Up @@ -132,7 +132,7 @@ public function testPurchase3dSecure()
$this->assertTrue($response->isRedirect());
$this->assertNull($response->getTransactionReference());
$this->assertNull($response->getMessage());
$this->assertSame('https://test.sagepay.com/Simulator/3DAuthPage.asp', $response->getRedirectUrl());
$this->assertSame('https://sandbox.opayo.eu.elavon.com/Simulator/3DAuthPage.asp', $response->getRedirectUrl());

$redirectData = $response->getRedirectData();
$this->assertSame('065379457749061954', $redirectData['MD']);
Expand Down
2 changes: 1 addition & 1 deletion tests/FormGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function testAuthorizeSuccess()

// Live (non-test) endpoint.
$this->assertSame(
'https://live.sagepay.com/gateway/service/vspform-register.vsp',
'https://live.opayo.eu.elavon.com/gateway/service/vspform-register.vsp',
$response->getRedirectUrl()
);

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function testDirectPurchase3dSecure()
$this->assertTrue($response->isRedirect());
$this->assertNull($response->getTransactionReference());
$this->assertNull($response->getMessage());
$this->assertSame('https://test.sagepay.com/Simulator/3DAuthPage.asp', $response->getRedirectUrl());
$this->assertSame('https://sandbox.opayo.eu.elavon.com/Simulator/3DAuthPage.asp', $response->getRedirectUrl());

$redirectData = $response->getRedirectData();
$this->assertSame('065379457749061954', $redirectData['MD']);
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/ServerAuthorizeResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function testServerPurchaseSuccess()
$this->assertTrue($response->isRedirect());
$this->assertSame('{"SecurityKey":"IK776BWNHN","VPSTxId":"{1E7D9C70-DBE2-4726-88EA-D369810D801D}","VendorTxCode":"123456"}', $response->getTransactionReference());
$this->assertSame('Server transaction registered successfully.', $response->getMessage());
$this->assertSame('https://test.sagepay.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}', $response->getRedirectUrl());
$this->assertSame('https://sandbox.opayo.eu.elavon.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}', $response->getRedirectUrl());
$this->assertSame('GET', $response->getRedirectMethod());
$this->assertSame([], $response->getRedirectData());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/ServerTokenRegistrationResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function testTokenRegistrationSuccess()
$this->assertTrue($response->isRedirect());
$this->assertSame('{"SecurityKey":"IK776BWNHN","VPSTxId":"{1E7D9C70-DBE2-4726-88EA-D369810D801D}","VendorTxCode":"123456"}', $response->getTransactionReference());
$this->assertSame('Server transaction registered successfully.', $response->getMessage());
$this->assertSame('https://test.sagepay.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}', $response->getRedirectUrl());
$this->assertSame('https://sandbox.opayo.eu.elavon.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}', $response->getRedirectUrl());
$this->assertSame('GET', $response->getRedirectMethod());
$this->assertSame([], $response->getRedirectData());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/SharedAbortRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public function testGetEndpoint()
{
$url = $this->request->getEndpoint();

$this->assertSame('https://test.sagepay.com/gateway/service/abort.vsp', $url);
$this->assertSame('https://sandbox.opayo.eu.elavon.com/gateway/service/abort.vsp', $url);
}
}
2 changes: 1 addition & 1 deletion tests/Message/SharedRefundRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public function testGetEndpoint()
{
$url = $this->request->getEndpoint();

$this->assertSame('https://test.sagepay.com/gateway/service/refund.vsp', $url);
$this->assertSame('https://sandbox.opayo.eu.elavon.com/gateway/service/refund.vsp', $url);
}
}
2 changes: 1 addition & 1 deletion tests/Message/SharedVoidRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ public function testGetEndpoint()
{
$url = $this->request->getEndpoint();

$this->assertSame('https://test.sagepay.com/gateway/service/void.vsp', $url);
$this->assertSame('https://sandbox.opayo.eu.elavon.com/gateway/service/void.vsp', $url);
}
}
2 changes: 1 addition & 1 deletion tests/Mock/DirectPurchase3dSecure.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ VPSProtocol=3.00
Status=3DAUTH
3DSecureStatus=OK
MD=065379457749061954
ACSURL=https://test.sagepay.com/Simulator/3DAuthPage.asp
ACSURL=https://sandbox.opayo.eu.elavon.com/Simulator/3DAuthPage.asp
PAReq=BSkaFwYFFTYAGyFbAB0LFRYWBwsBZw0EGwECEX9YRGFWc08pJCVVKgAANS0KADoZCCAMBnIeOxcWRg0LERdOOTQRDFRdVHNYUgwTMBsBCxABJw4DJHE+ERgPCi8MVC0HIAROCAAfBUk4ER89DD0IWDkvMQ1VdFwoUFgwXVYvbHgvMkdBXXNbQGIjdl1ZUEc1XSwqAAgUUicYBDYcB3I2AjYjIzsn
2 changes: 1 addition & 1 deletion tests/Mock/ServerPurchaseSuccess.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Status=OK
StatusDetail=Server transaction registered successfully.
VPSTxId={1E7D9C70-DBE2-4726-88EA-D369810D801D}
SecurityKey=IK776BWNHN
NextURL=https://test.sagepay.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}
NextURL=https://sandbox.opayo.eu.elavon.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}
2 changes: 1 addition & 1 deletion tests/Mock/ServerPurchaseWithToken.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ Status=OK
StatusDetail=Server transaction registered successfully.
VPSTxId={1E7D9C70-DBE2-4726-88EA-D369810D801D}
SecurityKey=IK776BWNHN
NextURL=https://test.sagepay.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}
NextURL=https://sandbox.opayo.eu.elavon.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}
Token={ABCDEFGH-ABCD-ABCD-ABCD-ABCDEFGHIJKL}
2 changes: 1 addition & 1 deletion tests/Mock/ServerTokenRegistrationSuccess.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Status=OK
StatusDetail=Server transaction registered successfully.
VPSTxId={1E7D9C70-DBE2-4726-88EA-D369810D801D}
SecurityKey=IK776BWNHN
NextURL=https://test.sagepay.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}
NextURL=https://sandbox.opayo.eu.elavon.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}
4 changes: 2 additions & 2 deletions tests/ServerGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function testAuthorizeSuccess()
$this->assertTrue($response->isRedirect());
$this->assertSame('{"SecurityKey":"IK776BWNHN","VPSTxId":"{1E7D9C70-DBE2-4726-88EA-D369810D801D}","VendorTxCode":"123"}', $response->getTransactionReference());
$this->assertSame('Server transaction registered successfully.', $response->getMessage());
$this->assertSame('https://test.sagepay.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}', $response->getRedirectUrl());
$this->assertSame('https://sandbox.opayo.eu.elavon.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}', $response->getRedirectUrl());
}

public function testAuthorizeFailure()
Expand Down Expand Up @@ -145,7 +145,7 @@ public function testPurchaseSuccess()
$this->assertTrue($response->isRedirect());
$this->assertSame('{"SecurityKey":"IK776BWNHN","VPSTxId":"{1E7D9C70-DBE2-4726-88EA-D369810D801D}","VendorTxCode":"123"}', $response->getTransactionReference());
$this->assertSame('Server transaction registered successfully.', $response->getMessage());
$this->assertSame('https://test.sagepay.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}', $response->getRedirectUrl());
$this->assertSame('https://sandbox.opayo.eu.elavon.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}', $response->getRedirectUrl());
}

public function testPurchaseFailure()
Expand Down

0 comments on commit aaf8a90

Please sign in to comment.