From b37780f4114e3f5e6e7bd7bba0e03fb0bdfe4a4a Mon Sep 17 00:00:00 2001 From: davesmall9xb <53899998+davesmall9xb@users.noreply.github.com> Date: Thu, 8 Aug 2019 11:14:03 +0100 Subject: [PATCH 1/2] Update AuthorizeRequest.php I've come across an issue with the SendEmail option in Omnipay\SagePay\Message\Form\AuthorizeRequest At https://github.com/thephpleague/omnipay-sagepay/blob/master/src/Message/Form/AuthorizeRequest.php#L127 the SendEmail data is set up, but it's then filtered out because of the mis-match in case sensitivity at https://github.com/thephpleague/omnipay-sagepay/blob/master/src/Message/Form/AuthorizeRequest.php#L29 So $data['SendEmail'] is set up properly but then filtered out because it's not in the $validFields array (the $validFields array contains SendEMail but not SendEmail). I'd propose updating $validFields to allow 'SendEmail' rather than 'SendEMail', but I wanted to check this with the creators of this useful project :) --- src/Message/Form/AuthorizeRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Message/Form/AuthorizeRequest.php b/src/Message/Form/AuthorizeRequest.php index 127fd53..0ecfa13 100644 --- a/src/Message/Form/AuthorizeRequest.php +++ b/src/Message/Form/AuthorizeRequest.php @@ -26,7 +26,7 @@ class AuthorizeRequest extends DirectAuthorizeRequest 'CustomerName' => false, 'CustomerEMail' => false, 'VendorEMail' => false, - 'SendEMail' => false, + 'SendEmail' => false, 'EmailMessage' => false, 'BillingSurname' => true, 'BillingFirstnames' => true, From 46a46dfe7e9126907efce3c887ecc70be21b40f1 Mon Sep 17 00:00:00 2001 From: davesmall9xb <53899998+davesmall9xb@users.noreply.github.com> Date: Mon, 19 Aug 2019 15:13:37 +0100 Subject: [PATCH 2/2] Update AuthorizeRequest.php Fix inversed so that SendEMail and VendorEMail data is passed to Sage Pay (NB this is case sensitive) rather than being filtered out by $validFields --- src/Message/Form/AuthorizeRequest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Message/Form/AuthorizeRequest.php b/src/Message/Form/AuthorizeRequest.php index 0ecfa13..eef3f88 100644 --- a/src/Message/Form/AuthorizeRequest.php +++ b/src/Message/Form/AuthorizeRequest.php @@ -26,7 +26,7 @@ class AuthorizeRequest extends DirectAuthorizeRequest 'CustomerName' => false, 'CustomerEMail' => false, 'VendorEMail' => false, - 'SendEmail' => false, + 'SendEMail' => false, 'EmailMessage' => false, 'BillingSurname' => true, 'BillingFirstnames' => true, @@ -100,7 +100,7 @@ public function getCryptData() } if ($this->getVendorEmail() !== null) { - $data['VendorEmail'] = $this->getVendorEmail(); + $data['VendorEMail'] = $this->getVendorEmail(); } if ($this->getEmailMessage() !== null) { @@ -124,7 +124,7 @@ public function getCryptData() $sendEmail = static::SEND_EMAIL_BOTH; } - $data['SendEmail'] = $this->getSendEmail(); + $data['SendEMail'] = $this->getSendEmail(); } $data['SuccessURL'] = $this->getReturnUrl();