From c00bf54835e55dc678aab97a818578b309ce1568 Mon Sep 17 00:00:00 2001 From: Gareth Edwards Date: Thu, 14 Feb 2019 09:35:40 +0200 Subject: [PATCH] Make Email optional and mobile required (#10) * Make Email optional and mobile required * Also fix malformed xml issue --- src/Gateway.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Gateway.php b/src/Gateway.php index d0bc88e..a457a73 100644 --- a/src/Gateway.php +++ b/src/Gateway.php @@ -101,7 +101,7 @@ public function getCallbackUrl() } /** - * @param string $email + * @param string $phoneNumber * @param string $reference * @param string $description * @param float $amount @@ -109,12 +109,12 @@ public function getCallbackUrl() * @param string $type * @param string|null $firstName * @param string|null $lastName - * @param string|null $phoneNumber + * @param string|null $email * * @return string */ public function getUrl( - string $email, + string $phoneNumber, string $reference, string $description, float $amount, @@ -122,7 +122,7 @@ public function getUrl( string $type = 'MERCHANT', string $firstName = null, string $lastName = null, - string $phoneNumber = null + string $email = null ): string { $emailNode = $email ? 'Email="' . $email . '"' : null; $xml = ' @@ -135,8 +135,8 @@ public function getUrl( Type="' . $type . '" Reference="' . $reference . '" FirstName="' . $firstName . '" - LastName="' . $lastName . '"' . - $emailNode . ' + LastName="' . $lastName . '" + ' . $emailNode . ' PhoneNumber="' . $phoneNumber . '" xmlns="' . $this::XMLNS . '" />';