Skip to content

Commit

Permalink
Merge pull request #102 from julestex/add_legal_person_class
Browse files Browse the repository at this point in the history
Add constants for LegalPersonType
  • Loading branch information
hobailey committed Apr 18, 2016
2 parents 21ba4d2 + 13a55bd commit 9f5dbb4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
11 changes: 11 additions & 0 deletions MangoPay/LegalPersonType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
namespace MangoPay;

/**
* Legal Person types
*/
class LegalPersonType
{
const Business = 'BUSINESS';
const Organization = 'ORGANIZATION';
}
2 changes: 1 addition & 1 deletion demos/users_create.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// CREATE LEGAL USER
$legalUser = new MangoPay\UserLegal();
$legalUser->Name = 'Name Legal Test';
$legalUser->LegalPersonType = 'BUSINESS';
$legalUser->LegalPersonType = \MangoPay\LegalPersonType::Business;
$legalUser->Email = '[email protected]';
$legalUser->LegalRepresentativeFirstName = "Bob";
$legalUser->LegalRepresentativeLastName = "Briant";
Expand Down
4 changes: 2 additions & 2 deletions demos/workflow/scripts/user-create-legal.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
$User = new MangoPay\UserLegal();
$User->Name = "Name Legal Test";
$User->LegalPersonType = "BUSINESS";
$User->LegalPersonType = \MangoPay\LegalPersonType::Business;
$User->Email = "[email protected]";
$User->LegalRepresentativeFirstName = "Bob";
$User->LegalRepresentativeLastName = "Briant";
Expand All @@ -12,4 +12,4 @@

//Display result
pre_dump($result);
$_SESSION["MangoPayDemo"]["UserLegal"] = $result->Id;
$_SESSION["MangoPayDemo"]["UserLegal"] = $result->Id;
2 changes: 1 addition & 1 deletion tests/cases/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ protected function getMatrix() {
$user = new \MangoPay\UserLegal();
$user->Name = "MartixSampleOrg";
$user->Email = "[email protected]";
$user->LegalPersonType = "BUSINESS";
$user->LegalPersonType = \MangoPay\LegalPersonType::Business;
$user->HeadquartersAddress = $this->getNewAddress();
$user->LegalRepresentativeFirstName = $john->FirstName;
$user->LegalRepresentativeLastName = $john->LastName;
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function test_Users_CreateLegal_PassesIfRequiredPropsProvided() {
$user->HeadquartersAddress->Region = 'Region';
$user->Name = "SomeOtherSampleOrg";
$user->Email = "[email protected]";
$user->LegalPersonType = "BUSINESS";
$user->LegalPersonType = \MangoPay\LegalPersonType::Business;
$user->LegalRepresentativeFirstName = "FirstName";
$user->LegalRepresentativeLastName = "LastName";
$user->LegalRepresentativeAddress = new \MangoPay\Address();
Expand Down

0 comments on commit 9f5dbb4

Please sign in to comment.