Skip to content

Commit

Permalink
Issue #4 switch to new Opayo URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
judgej committed Nov 20, 2023
1 parent 2582d9c commit 0d9ed80
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ for example Guzzle (7+ or 6+HTTPlug adapter), curl or another PSR-7 library.
You can use this library as a PSR-7 message generator/consumer, or go a level down and handle all the
data through arrays - both are supported.

This library is fairly old, so a bit kludgy in places, but should improve over time.
> This package has been updated to use the new Elavon URLs, that will be mandatory from March 2024.
## Package Development

The Sage Pay Integration payment gateway is a RESTful API run by by [Sage Pay](https://sagepay.com/).
You can [apply for an account here](https://www.opayo.co.uk/apply?partner_id=3F7A4119-8671-464F-A091-9E59EB47B80C)
(my partner link).
The Opayo Pi payment gateway is a RESTful API run by by [Elavon](https://developer.elavon.com/products/opayo/v1/api-reference).

> You can [apply for an account here](https://www.opayo.co.uk/apply?partner_id=3F7A4119-8671-464F-A091-9E59EB47B80C)
(partner link).

From v3.0.0 this package is being rebranded for Opayo, gets a new composer name, and a new base namespace.

Expand Down Expand Up @@ -184,7 +185,7 @@ use Academe\Opayo\Pi\Request\CreateCardIdentifier;

// Create a card indentifier on the API.
// Note the MMYY order is most often used for GB gateways like Sage Pay. Many European
// gateways tend to go MSN first, i.e. YYMM.
// gateways tend to go most significant number (MSN) first, i.e. YYMM.
// $endpoint, $auth and $session_key from before:

$cardIdentifierRequest = new CreateCardIdentifier(
Expand Down
4 changes: 2 additions & 2 deletions src/Model/Endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class Endpoint
* @var array The endpoint URL templates, one for each mode.
*/
protected $urls_templates = [
1 => 'https://pi-live.sagepay.com/api/{version}{resource}',
2 => 'https://pi-test.sagepay.com/api/{version}{resource}',
1 => 'https://live.opayo.eu.elavon.com/api/{version}{resource}',
2 => 'https://sandbox.opayo.eu.elavon.com/api/{version}{resource}',
];

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Request/CreateCardIdentifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* With the right PCI compliance, the details could be captured
* by the merchant site and sent direct to SagePay server-to-server,
* similat to how Sage Pay Direct would.
* similar to how Sage Pay Direct would.
*/

use Academe\Opayo\Pi\Model\Auth;
Expand Down Expand Up @@ -143,7 +143,7 @@ public function jsonSerializePeek()
* This request does not use the HTTP Basic Auth, but the temporary session
* key token instead. This is because it will accessible to end users, and
* the secure integration key and password cannot be exposed here.
*
*
* @return array
*/
public function getAuthHeaders()
Expand Down
5 changes: 3 additions & 2 deletions src/Request/CreatePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class CreatePayment extends AbstractRequest
const APPLY_3D_SECURE_USEMSPSETTING = 'UseMSPSetting'; // 0
const APPLY_3D_SECURE_FORCE = 'Force'; // 1
const APPLY_3D_SECURE_DISABLE = 'Disable'; // 2
// @deprecated removed from the API spec 2023-10-26
const APPLY_3D_SECURE_FORCEIGNORINGRULES = 'ForceIgnoringRules'; // 3

/**
Expand Down Expand Up @@ -291,7 +292,7 @@ public static function getApply3DSecures()
* @param ShippingAddress $shippingAddress
* @return Transaction
*/
public function withShippingAddress(ShippingAddress $shippingAddress)
public function withShippingAddress(AddressInterface $shippingAddress)
{
$copy = clone $this;
$copy->shippingAddress = $shippingAddress;
Expand All @@ -302,7 +303,7 @@ public function withShippingAddress(ShippingAddress $shippingAddress)
* @param ShippingRecipient $shippingRecipient
* @return Transaction
*/
public function withShippingRecipient(ShippingRecipient $shippingRecipient)
public function withShippingRecipient(PersonInterface $shippingRecipient)
{
$copy = clone $this;
$copy->shippingRecipient = $shippingRecipient;
Expand Down
3 changes: 3 additions & 0 deletions src/Request/Model/PersonInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* Value object used to define details for a person.
*/

/**
* @method withFieldPrefix(string $prefix) self
*/
interface PersonInterface extends \JsonSerializable
{
}

0 comments on commit 0d9ed80

Please sign in to comment.