Skip to content

Commit

Permalink
Update request parameter requirements (#88)
Browse files Browse the repository at this point in the history
Updated the parameter-fields according to the documentation. [Link to documentation](https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/directlink/request-a-new%20order#requestparameters)
Brought up in #87
  • Loading branch information
L00Cyph3r authored and ruben-haegeman committed Apr 30, 2019
1 parent dbe7d39 commit 28d896f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Ogone/AbstractPaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function setEmail($email)

public function setOwnerAddress($owneraddress)
{
if (strlen($owneraddress) > 35) {
if (strlen($owneraddress) > 50) {
throw new InvalidArgumentException("Owner address is too long");
}
$this->parameters['owneraddress'] = $owneraddress;
Expand Down Expand Up @@ -226,6 +226,9 @@ public function setOwnerCountry($ownercountry)
*/
public function setOwnercty($ownercty)
{
if (strlen($ownercty) > 2) {
throw new InvalidArgumentException("Owner country code is too long");
}
if (!preg_match('/^[A-Z]{2}$/', strtoupper($ownercty))) {
throw new InvalidArgumentException("Illegal country code");
}
Expand Down

0 comments on commit 28d896f

Please sign in to comment.