Mangopay / mangopay2-php-sdk

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

Registration data : Invalid format #403

Closed sohaieb closed 4 years ago

sohaieb commented 4 years ago

Hello,

I'm still having "Registration data : Invalid format" even if i added "data=" to my registration data, and here is the full object:

image

mangomaxoasis commented 4 years ago

Hi @sohaieb We're looking into it Max

sohaieb commented 4 years ago

Hi @sohaieb We're looking into it Max

Thank you, I'm waiting sir :)

sohaieb commented 4 years ago

Hello again

Finally, I fixed it, it was a missing part in my code :

$httpClient = new Client(); // use GuzzleHttp\Client;
        $stream = $httpClient->request('POST',
            $cardRegistration->CardRegistrationURL,
            [
                'form_params' => [
                    'data' => $cardRegistration->PreregistrationData,
                    'accessKeyRef' => $cardRegistration->AccessKey,
                    'cardNumber' => $cardNumber,
                    'cardExpirationDate' => $expiredDate,
                    'cardCvx' => $cvc
                ]
            ]);
        return $stream
            ->getBody()
            ->getContents();

I do not know why the mangopay documentation is missing these details ..

by the way thank you a lot.

mangomaxoasis commented 4 years ago

Hey @sohaieb Good to hear, we're currently reworking to doc, we'll try to include this comment in the next version cheers

sohaieb commented 4 years ago

Thank you sir :)