Mangopay / mangopay2-php-sdk

PHP SDK for MANGOPAY
https://packagist.org/packages/mangopay/php-sdk-v2
MIT License
123 stars 134 forks source link

we have a problem with UBO's #526

Closed Geoffray-buhler closed 3 years ago

Geoffray-buhler commented 3 years ago

So when i have all documents i create ubo like this

`

            $UserId = $this->getUser()->getMangoPayId();
            $document = new Documents;
            $ubodeclaration = $mangoservices->createUBODeclaration($UserId);
            $user->setIdUbo($ubodeclaration->Id);
            $entityManager->persist($user);
            $entityManager->flush();
            $ubo = new Ubo();
            $ubo->FirstName = $this->getUser()->getFirstname();
            $ubo->LastName = $this->getUser()->getLastname();
            $ubo->Address = new AdressMango();
            $ubo->Address->AddressLine1 = $adressPerso[0]->getNumber() . " " . $adressPerso[0]->getType() . " " . $adressPerso[0]->getStreetname();
            $ubo->Address->AddressLine2 = $adressPerso[0]->getAdressComplement();
            $ubo->Address->City = $adressPerso[0]->getCity();
            $ubo->Address->Region = 'Region';
            $ubo->Address->PostalCode = $adressPerso[0]->getZipCode();
            $ubo->Address->Country = $adressPerso[0]->getCountry();
            $ubo->Nationality = $this->getUser()->getNationalite();
            $ubo->Birthday = $this->getUser()->getBirthDate()->getTimestamp();
            $ubo->Birthplace = new Birthplace();
            $ubo->Birthplace->City = $this->getUser()->getCityBirth();
            $ubo->Birthplace->Country = $this->getUser()->getCountryBirth();

            $res = $mangoservices->createUBO($UserId, $ubodeclaration->Id, $ubo);

            $document->setName('UBO');
            $document->setTypeDoc('UBO');
            $document->setUser($user);
            $document->setCreatedAt(new DateTime());
            $document->setIsValidate('ASKED');

            $entityManager->persist($document);
            $entityManager->flush();

            $statut = $mangoservices->getUBODeclaration($ubodeclaration->Id, $UserId);
            $statut->Status = "VALIDATION_ASKED";
            $mangoservices->updateUBODeclaration($UserId, $ubodeclaration->Id, $statut);
            $mangoservices->submitUBODeclaration($UserId, $ubodeclaration->Id);

`

I have any error but in mangopay dashboard i have any ubo declaration details register

image

i don't know why but i know i make something wrong ^^

fredericdelordm commented 3 years ago

Hello @Geoffray-buhler,

Please have a look here to understand how UBOs work.

Let me know if it help

Geoffray-buhler commented 3 years ago

No that's don't help me but now all is ok but i don't know why