Skip to content

Commit

Permalink
Merge pull request #86 from white-nl/feat/add-cardtoken
Browse files Browse the repository at this point in the history
Add cardToken to order and payment request
  • Loading branch information
barryvdh committed Jun 28, 2022
2 parents 8fc858e + d1efcdc commit e4d7a17
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Message/Request/CreateOrderRequest.php
Expand Up @@ -127,6 +127,23 @@ public function setSequenceType($value)
return $this->setParameter('sequenceType', $value);
}

/**
* @return string
*/
public function getCardToken()
{
return $this->getParameter('cardToken');
}

/**
* @param string $value
* @return $this
*/
public function setCardToken($value)
{
return $this->setParameter('cardToken', $value);
}

/**
* Alias for lines
*
Expand Down Expand Up @@ -199,6 +216,10 @@ public function getData()
$data['payment']['sequenceType'] = $sequenceType;
}

if ($cardToken = $this->getCardToken()) {
$data['payment']['cardToken'] = $cardToken;
}

return array_filter($data);
}

Expand Down
21 changes: 21 additions & 0 deletions src/Message/Request/PurchaseRequest.php
Expand Up @@ -116,6 +116,23 @@ public function setSequenceType($value)
return $this->setParameter('sequenceType', $value);
}

/**
* @return string
*/
public function getCardToken()
{
return $this->getParameter('cardToken');
}

/**
* @param string $value
* @return $this
*/
public function setCardToken($value)
{
return $this->setParameter('cardToken', $value);
}

/**
* @return string
*/
Expand Down Expand Up @@ -185,6 +202,10 @@ public function getData()
$data['mandateId'] = $mandateId;
}

if ($cardToken = $this->getCardToken()) {
$data['cardToken'] = $cardToken;
}

return $data;
}

Expand Down

0 comments on commit e4d7a17

Please sign in to comment.