Mangopay / mangopay2-php-sdk

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

Payout: Blocked due to the Bank Account User's KYC limitations - Development environment #440

Closed sohaieb closed 3 years ago

sohaieb commented 3 years ago

Hello,

Iguess my payout code is working fine and it returned a "CREATED" status, but the problem that in the sandbox dashboard i get action "FAILED".

here is my payout code:

public function createPayOut($userId, $walletId, $bankAccountId, $amount = null, $fees = null, $currency = null)
    {
        $PayOut = new PayOut();
        $PayOut->AuthorId = $userId;
        $PayOut->DebitedWalletId = $walletId;
        $PayOut->DebitedFunds = new Money();
        $PayOut->DebitedFunds->Currency = $currency ?? $this->currency;
        $PayOut->DebitedFunds->Amount = $amount ?? $this->amount;
        if ($fees === null || $fees === 0.0) {
            $fees = $this->fees;
        }
        $this->setMoney($PayOut, $currency, $fees);
        $PayOut->PaymentType = "BANK_WIRE";
        $PayOut->MeanOfPaymentDetails = new PayOutPaymentDetailsBankWire();
        $PayOut->MeanOfPaymentDetails->BankAccountId = $bankAccountId;
        $payOut = $this->api->PayOuts->Create($PayOut);
        if ($payOut->Status === \ExceptionConstants::STATUS_FAILED) {
            throw new \Exception($payOut->ResultMessage, $payOut->ResultCode);
        }
        return $payOut;
    }

here is my postman payout action response: image

here is the status i got in sandbox dashboard: image

so what should i do please ? and is this related to KYC documentation config ? if yes, should i implement this KYC verification to proceed my payout test in development environment?

thanks in advance.

H4wKs commented 3 years ago

@sohaieb You can't make a Payout if your user is not KYC validated, no matter the environment, the logic still the same. From the MangoPay Sandbox dashboard, you have a section called "Sandbox Operations". Click on it, then choose "Process a KYC document" and validated the user you try to make the cashout for. Once the user is KYC validated, try to make that payout again and it should work like a charm.

mangomaxoasis commented 3 years ago

thanks @H4wKs !