Mangopay / mangopay2-php-sdk

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

500 when retrieving SecureModeRedirectURL #81

Closed umbecanessa closed 8 years ago

umbecanessa commented 8 years ago

Hey, i've a super annoying error when i'm trying to access to SecureModeRedirectURL of the CardPreAuthorization object.

Every time i Get :

\MangoPay\ResponseException: Code: 500 Message: Internal server error. Internal Server Error

Details: MangoPay\Libraries\Error Object ( [Message] => Internal Server Error [Errors] => )

even if I try to print it with. Is the only property in the object that create this error.

Here is my code:

$CardPreAuthorization = new \MangoPay\CardPreAuthorization();
    $CardPreAuthorization->AuthorId = $updatedCardRegister->UserId;
    $CardPreAuthorization->DebitedFunds = new \MangoPay\Money();
    $CardPreAuthorization->DebitedFunds->Currency = "EUR";
    $CardPreAuthorization->DebitedFunds->Amount = $_SESSION['amount']*100;
    $CardPreAuthorization->SecureMode = "DEFAULT";
    $CardPreAuthorization->CardId = $card->Id;
    $CardPreAuthorization->SecureModeReturnURL = "https://mywebsite/index.php";

    $CreatePreAuthorization = $mangoPayApi->CardPreAuthorizations->Create($CardPreAuthorization);
   echo $CreatePreAuthorization->SecureModeRedirectURL;
hobailey commented 8 years ago

Hi @umbecanessa, I'm confused why you think that just accessing the SecureModeRedirectURL is triggering the API error 500? But a couple of things:

umbecanessa commented 8 years ago

Hi @hobailey, is very strange I just try it (without changing any line of code) now and it works perfectly.

hobailey commented 8 years ago

OK, thanks for the update :-)