src/Payum/Paypal/Masspay/Nvp/Action/ConvertPayoutAction.php
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        /** @var PayoutInterface $payout */
        $payout = $request->getSource();

        $this->gateway->execute($currency = new GetCurrency($payout->getCurrencyCode()));
        $divisor = pow(10, $currency->exp);

        $details = ArrayObject::ensureArrayObject($payout->getDetails());
        $details['CURRENCYCODE'] = $payout->getCurrencyCode();
        $details['L_AMT0'] = $payout->getTotalAmount() / $divisor;
        $details['L_NOTE0'] = $payout->getDescription();

        if ($payout->getRecipientEmail()) {
            $details['RECEIVERTYPE'] = 'EmailAddress';
            $details['L_EMAIL0'] = $payout->getRecipientEmail();
        } elseif ($payout->getRecipientId()) {
            $details['RECEIVERTYPE'] = 'UserID';
            $details['L_RECEIVERID0'] = $payout->getRecipientId();
        } else {
            throw new LogicException('Either recipient id or email must be set.');
        }
        
        $request->setResult((array) $details);
    }
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        /** @var PayoutInterface $payout */
        $payout = $request->getSource();

        $this->gateway->execute($currency = new GetCurrency($payout->getCurrencyCode()));
        $divisor = pow(10, $currency->exp);

        $details = ArrayObject::ensureArrayObject($payout->getDetails());
        $details['CURRENCYCODE'] = $payout->getCurrencyCode();
        $details['L_AMT0'] = $payout->getTotalAmount() / $divisor;
        $details['L_NOTE0'] = $payout->getDescription();

        if ($payout->getRecipientEmail()) {
            $details['RECEIVERTYPE'] = 'EmailAddress';
            $details['L_EMAIL0'] = $payout->getRecipientEmail();
        } elseif ($payout->getRecipientId()) {
            $details['RECEIVERTYPE'] = 'UserID';
            $details['L_RECEIVERID0'] = $payout->getRecipientId();
        } else {
            throw new LogicException('Either recipient id or email must be set.');
        }
        
        $request->setResult((array) $details);
    }
{@inheritdoc}

@param Convert $request