Skip to content

Commit 8be2d04

Browse files
committed
Allow request with customerId.
Add customerId to validation.
1 parent e4b4027 commit 8be2d04

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Message/AuthorizeRequest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ public function getData()
3737
// special validation
3838
if ($this->getPaymentMethodToken()) {
3939
$data['paymentMethodToken'] = $this->getPaymentMethodToken();
40-
} elseif($this->getToken()) {
40+
} elseif ($this->getToken()) {
4141
$data['paymentMethodNonce'] = $this->getToken();
42+
} elseif ($this->getCustomerId()) {
43+
$data['customerId'] = $this->getCustomerId();
4244
} else {
43-
throw new InvalidRequestException("The token (payment nonce) or paymentMethodToken field should be set.");
45+
throw new InvalidRequestException("The token (payment nonce), paymentMethodToken or customerId field should be set.");
4446
}
4547

4648
// Remove null values

0 commit comments

Comments
 (0)