Skip to content

Commit

Permalink
Merge branch 'feature/additionalWalletData' into v3
Browse files Browse the repository at this point in the history
  • Loading branch information
sbuche committed Nov 23, 2021
2 parents c5c2eeb + 2954421 commit 1a92eed
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Data/PaymentData/WalletData.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class WalletData extends PaymentData {
protected $walletOwnerFirstName;
/** @var string */
protected $walletOwnerLastName;
/** @var string */
protected $walletOwnerCountryCode;

/**
* @return string
Expand Down Expand Up @@ -111,4 +113,20 @@ public function setWalletOwnerLastName($walletOwnerLastName)
$this->walletOwnerLastName = $walletOwnerLastName;
}

/**
* @return string
*/
public function getWalletOwnerCountryCode()
{
return $this->walletOwnerCountryCode;
}

/**
* @param string $walletOwnerCountryCode
*/
public function setWalletOwnerCountryCode($walletOwnerCountryCode)
{
$this->walletOwnerCountryCode = $walletOwnerCountryCode;
}

}
24 changes: 24 additions & 0 deletions src/Data/Result/WalletData.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ class WalletData extends ResultData {
*/
protected $walletOwnerLastName;

/**
* @var string
*/
protected $walletOwnerCountryCode;

/**
* @return string
*/
Expand Down Expand Up @@ -113,6 +118,21 @@ public function setWalletOwnerLastName($walletOwnerLastName)
$this->walletOwnerLastName = $walletOwnerLastName;
}

/**
* @return string
*/
public function getWalletOwnerCountryCode()
{
return $this->walletOwnerCountryCode;
}

/**
* @param string $walletOwnerCountryCode
*/
public function setWalletOwnerCountryCode($walletOwnerCountryCode)
{
$this->walletOwnerCountryCode = $walletOwnerCountryCode;
}

/**
* @return array
Expand All @@ -132,6 +152,10 @@ public function toArray() {
$result['walletOwnerLastName'] = $this->walletOwnerLastName;
}

if (!empty($this->walletOwnerCountryCode)) {
$result['walletOwnerCountryCode'] = $this->walletOwnerCountryCode;
}

return $result;
}

Expand Down
4 changes: 4 additions & 0 deletions src/Json/JsonGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ protected function createPaymentData($paymentData){
if (!empty($paymentData->getWalletOwnerLastName())) {
$data['walletData']['walletOwnerLastName'] = $paymentData->getWalletOwnerLastName();
}

if (!empty($paymentData->getWalletOwnerCountryCode())) {
$data['walletData']['walletOwnerCountryCode'] = $paymentData->getWalletOwnerCountryCode();
}
}

return $data;
Expand Down
1 change: 1 addition & 0 deletions src/Json/JsonParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ protected function parseReturnData($returnData) {
$walletData->setWalletType($this->arrGet($returnData, 'walletType'));
$walletData->setWalletOwnerFirstName($this->arrGet($returnData, 'walletOwnerFirstName'));
$walletData->setWalletOwnerLastName($this->arrGet($returnData, 'walletOwnerLastName'));
$walletData->setWalletOwnerCountryCode($this->arrGet($returnData, 'walletOwnerCountryCode'));

return $walletData;

Expand Down
3 changes: 3 additions & 0 deletions src/Xml/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,9 @@ protected function parseReturnData(\DOMNode $node) {
case 'walletOwnerLastName':
$walletData->setWalletOwnerLastName($child->nodeValue);
break;
case 'walletOwnerCountryCode':
$walletData->setWalletOwnerCountryCode($child->nodeValue);
break;
default:
break;
}
Expand Down

0 comments on commit 1a92eed

Please sign in to comment.