From 13a55bd794686f8f97057511b36677f300f81f55 Mon Sep 17 00:00:00 2001 From: julestex Date: Thu, 14 Apr 2016 16:59:15 +0200 Subject: [PATCH] Add constants for LegalPersonType --- MangoPay/LegalPersonType.php | 11 +++++++++++ demos/users_create.php | 2 +- demos/workflow/scripts/user-create-legal.php | 4 ++-- tests/cases/base.php | 2 +- tests/cases/users.php | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 MangoPay/LegalPersonType.php diff --git a/MangoPay/LegalPersonType.php b/MangoPay/LegalPersonType.php new file mode 100644 index 00000000..a9390de7 --- /dev/null +++ b/MangoPay/LegalPersonType.php @@ -0,0 +1,11 @@ +Name = 'Name Legal Test'; - $legalUser->LegalPersonType = 'BUSINESS'; + $legalUser->LegalPersonType = \MangoPay\LegalPersonType::Business; $legalUser->Email = 'legal@testmangopay.com'; $legalUser->LegalRepresentativeFirstName = "Bob"; $legalUser->LegalRepresentativeLastName = "Briant"; diff --git a/demos/workflow/scripts/user-create-legal.php b/demos/workflow/scripts/user-create-legal.php index 03b08f0d..28e96211 100644 --- a/demos/workflow/scripts/user-create-legal.php +++ b/demos/workflow/scripts/user-create-legal.php @@ -1,7 +1,7 @@ Name = "Name Legal Test"; -$User->LegalPersonType = "BUSINESS"; +$User->LegalPersonType = \MangoPay\LegalPersonType::Business; $User->Email = "legal@testmangopay.com"; $User->LegalRepresentativeFirstName = "Bob"; $User->LegalRepresentativeLastName = "Briant"; @@ -12,4 +12,4 @@ //Display result pre_dump($result); -$_SESSION["MangoPayDemo"]["UserLegal"] = $result->Id; \ No newline at end of file +$_SESSION["MangoPayDemo"]["UserLegal"] = $result->Id; diff --git a/tests/cases/base.php b/tests/cases/base.php index 859f023f..d7650420 100644 --- a/tests/cases/base.php +++ b/tests/cases/base.php @@ -165,7 +165,7 @@ protected function getMatrix() { $user = new \MangoPay\UserLegal(); $user->Name = "MartixSampleOrg"; $user->Email = "mail@test.com"; - $user->LegalPersonType = "BUSINESS"; + $user->LegalPersonType = \MangoPay\LegalPersonType::Business; $user->HeadquartersAddress = $this->getNewAddress(); $user->LegalRepresentativeFirstName = $john->FirstName; $user->LegalRepresentativeLastName = $john->LastName; diff --git a/tests/cases/users.php b/tests/cases/users.php index 22d7a472..9d9a8915 100644 --- a/tests/cases/users.php +++ b/tests/cases/users.php @@ -39,7 +39,7 @@ function test_Users_CreateLegal_PassesIfRequiredPropsProvided() { $user->HeadquartersAddress->Region = 'Region'; $user->Name = "SomeOtherSampleOrg"; $user->Email = "mail@test.com"; - $user->LegalPersonType = "BUSINESS"; + $user->LegalPersonType = \MangoPay\LegalPersonType::Business; $user->LegalRepresentativeFirstName = "FirstName"; $user->LegalRepresentativeLastName = "LastName"; $user->LegalRepresentativeAddress = new \MangoPay\Address();