Skip to content

Commit

Permalink
Make Email optional and mobile required (#10)
Browse files Browse the repository at this point in the history
* Make Email optional and mobile required

* Also fix malformed xml issue
  • Loading branch information
lucidlogic authored Feb 14, 2019
1 parent 8772095 commit c00bf54
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,28 +101,28 @@ public function getCallbackUrl()
}

/**
* @param string $email
* @param string $phoneNumber
* @param string $reference
* @param string $description
* @param float $amount
* @param string|null $currency
* @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,
string $currency = null,
string $type = 'MERCHANT',
string $firstName = null,
string $lastName = null,
string $phoneNumber = null
string $email = null
): string {
$emailNode = $email ? 'Email="' . $email . '"' : null;
$xml = '<?xml version="1.0" encoding="utf-8"?>
Expand All @@ -135,8 +135,8 @@ public function getUrl(
Type="' . $type . '"
Reference="' . $reference . '"
FirstName="' . $firstName . '"
LastName="' . $lastName . '"' .
$emailNode . '
LastName="' . $lastName . '"
' . $emailNode . '
PhoneNumber="' . $phoneNumber . '"
xmlns="' . $this::XMLNS . '" />';

Expand Down

0 comments on commit c00bf54

Please sign in to comment.