Skip to content

Commit

Permalink
HZTL-3329: Handle null email (#9)
Browse files Browse the repository at this point in the history
* Handle null email

* Update Gateway.php

* Update src/Gateway.php

Co-Authored-By: vusile <[email protected]>
  • Loading branch information
vusile authored Feb 6, 2019
1 parent 207d21f commit 8772095
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public function getUrl(
string $lastName = null,
string $phoneNumber = null
): string {
$emailNode = $email ? 'Email="' . $email . '"' : null;
$xml = '<?xml version="1.0" encoding="utf-8"?>
<PesapalDirectOrderInfo
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand All @@ -134,8 +135,8 @@ public function getUrl(
Type="' . $type . '"
Reference="' . $reference . '"
FirstName="' . $firstName . '"
LastName="' . $lastName . '"
Email="' . $email . '"
LastName="' . $lastName . '"' .
$emailNode . '
PhoneNumber="' . $phoneNumber . '"
xmlns="' . $this::XMLNS . '" />';

Expand Down

0 comments on commit 8772095

Please sign in to comment.