Mangopay / mangopay2-php-sdk

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

Refund don't work in production environement #359

Closed Aurel4012 closed 5 years ago

Aurel4012 commented 5 years ago

Hi, i have a problem when i want refund user in production. In sendbox everything is ok and i use the same code but in production i have this return:

MangoPay\ResponseException Code: 400

Message: Bad request. One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.

Details: MangoPay\Libraries\Error Object ( [Message] => One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error. [Errors] => stdClass Object ( [payinId] => The value 744287650 is not valid )

[Id] => 4b1eadd6-e8a0-4cb3-bbd5-cd6e350fd5fc#1571133500
[Date] => 1571133501
[Type] => param_error

) I see in my dashboard production and the PayInId and AuthorId are good. I use this code:

           $api = new \MangoPay\MangoPayApi();

           $api->Config->ClientId = MangoPay_ClientId;

            $api->Config->ClientPassword = MangoPay_ClientPassword;

            $api->Config->TemporaryFolder = MangoPay_TemporaryFolder;

            $api->Config->BaseUrl = MangoPay_BaseUrl;

        $PayInId = $transfert_id;

    $Refund = new \MangoPay\Refund();

    $Refund->AuthorId = $user_id;

    $Refund->RefundReasonMessage = 'Remboursement mission refusée par le Moover';

    $result = $api->PayIns->CreateRefund($PayInId, $Refund);

Of course my cliendID, tempfile and key are good in production and not the same in dev I can make payin succefully in prod. Have you an idea ?

Aurel4012 commented 5 years ago

Solved It's little bit strong, i advert Mangopay. We don't give me the correct client ID in production it's same i use when i want refund but without first uppercase. But whith the incorrect ID i don't have trouble when i make payin only in refund.