Receive Payment and Return Payment Model.

@return PayuPayment
2017
public function capture()
    {
        $storage = new Storage();
        $config = new Config($storage->getAccount());

        if ($config->getDriver() == 'database') {
            return PayuPayment::find($storage->getPayment());
        }

        return new PayuPayment($storage->getPayment());
    }
1318532
protected function prepareRequestOrderPayment()
    {
        $requestOrderPayment = oxNew(\OxidEsales\PayPalModule\Model\OrderPayment::class);
        $request = $this->getRequest();

        $requestPaymentSetter = $this->getOrderPaymentSetter();
        $requestPaymentSetter->setRequest($request);
        $requestPaymentSetter->setRequestOrderPayment($requestOrderPayment);

        $requestOrderPayment = $requestPaymentSetter->getRequestOrderPayment();

        return $requestOrderPayment;
    }
813971
public static AlipayFundCouponOrderRefundResponse fundCouponOrderRefundToResponse(
			AlipayFundCouponOrderRefundModel model) throws AlipayApiException {
		AlipayFundCouponOrderRefundRequest request = new AlipayFundCouponOrderRefundRequest();
		request.setBizModel(model);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
	}
286513
public function getPayController()
    {
        if ($this->_payController === null) {
            $this->_payController = $this->createControllerById('pay');
        }

        return $this->_payController;
    }
235882
public function payouts()
    {
        if (!isset($this->payouts)) {
            $this->payouts = new Services\PayoutsService($this->api_client);
        }

        return $this->payouts;
    }
748743
public function getOrderPaymentSetter()
    {
        if (is_null($this->payPalIPNPaymentSetter)) {
            $payPalIPNPaymentSetter = oxNew(\OxidEsales\PayPalModule\Model\IPNRequestPaymentSetter::class);
            $this->setOrderPaymentSetter($payPalIPNPaymentSetter);
        }

        return $this->payPalIPNPaymentSetter;
    }
1135276
public function getPaymentBuilder()
    {
        if (is_null($this->paymentBuilder)) {
            $this->paymentBuilder = oxNew(\OxidEsales\PayPalModule\Model\IPNPaymentBuilder::class);
        }

        return $this->paymentBuilder;
    }
870021
public static function payMethods($lang = null)
    {

        try {
            $authType = self::getAuth();
        } catch (OpenPayU_Exception $e) {
            throw new OpenPayU_Exception($e->getMessage(), $e->getCode());
        }

        if (!$authType instanceof AuthType_Oauth) {
            throw new OpenPayU_Exception_Configuration('Retrieve works only with OAuth');
        }

        $pathUrl = OpenPayU_Configuration::getServiceUrl() . self::PAYMETHODS_SERVICE;
        if ($lang !== null) {
            $pathUrl .= '?lang=' . $lang;
        }

        $response = self::verifyResponse(OpenPayU_Http::doGet($pathUrl, $authType));

        return $response;
    }
599747
public function addPayment(\OxidEsales\PayPalModule\Model\OrderPayment $payment)
    {
        //order payment info
        if ($this->getOrderId()) {
            $payment->setOrderId($this->getOrderId());
            $payment->save();
        }

        $this->load($this->getOrderId());

        return $payment;
    }
1176386
public function actionPay($id)
    {
        $payment = $this->findModel($id);
        if (!$this->module->hasGateway($payment->gateway)) {
            throw new NotFoundHttpException("Unknown payment gateway '{$payment->gateway}'");
        }
        /** @var \yuncms\payment\BaseGateway $gateway */
        $gateway = $this->module->getGateway($payment->gateway);
        $paymentParams = [];
        $gateway->payment($payment, $paymentParams);
        if ($paymentParams) {
            if (Yii::$app->request->isAjax) {
                return $this->renderPartial('pay', ['payment' => $payment, 'paymentParams' => $paymentParams]);
            } else {
                return $this->render('pay', ['payment' => $payment, 'paymentParams' => $paymentParams]);
            }
        }
       // print_r($paymentParams);
        //exit;
        return $this->redirect(['/payment/default/index', 'id' => $payment->id]);
    }
1257961
protected function curlExecute()
    {
        $response = curl_exec($this->getResource());

        $curlErrorNumber = $this->getErrorNumber();
        if ($curlErrorNumber) {
            /**
             * @var \OxidEsales\PayPalModule\Core\Exception\PayPalException $exception
             */
            $exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalException::class, 'Curl error: ' . $curlErrorNumber);
            throw $exception;
        }

        return $response;
    }
135873
public function capture()
    {
        $path = sprintf('/%s/%s/%s/%s', MoipResource::VERSION, self::PATH, $this->getId(), 'capture');
        if ($this->isMultipayment($this->getId())) {
            $path = sprintf('/%s/%s/%s/%s', MoipResource::VERSION, self::MULTI_PAYMENTS_PATH, $this->getId(), 'capture');
        }

        $response = $this->httpRequest($path, Requests::POST, $this);

        return $this->populate($response);
    }
568209
public function getPayload()
    {
        $payload = $this->getService('com:subscriptions.domain.payment.payload', array(

           'order_id' => $this->orderId,
           'description' => $this->_package->name,
           'amount' => $this->getItemAmountAfterDiscount(),
           'tax_amount' => $this->getTaxAmount(),
           'payment_method' => $this->getPaymentMethod(),
           'currency' => $this->currency,

        ));

        if ($this->_package->recurring) {
            $payload->setRecurring(1, $this->_package->billingPeriod, AnDomainAttributeDate::getInstance()->getDate(DATE_FORMAT_ISO_EXTENDED));
        }

        return $payload;
    }
105205
public function pay()
    {
        if (!Settings::first()->ready()) {
            return false;
        }

        if ($this->ammount != 0) {
            try {
                Charge::create([
                    'amount'      => $this->ammount,
                    'currency'    => $this->currency,
                    'source'      => $this->source,
                    'description' => $this->description,
                ]);
            } catch (Exception $e) {
                $this->error = $e;

                return false;
            }
        }

        return true;
    }
178110
public function execute()
    {

        //$cardInternational = $this->getRequest()->getParam('card_international');

        try {
            $creditCard = new CreditCardMethod(
                $this->_objectManager->create('Magento\Directory\Api\CountryInformationAcquirerInterface'),
                $this->_objectManager->create('Magento\Framework\App\Config\ScopeConfigInterface'),
                $this->_objectManager->create('Magento\Framework\Module\ModuleList'),
                $this->loadOrder(),
                $this->_objectManager->create('UOL\PagSeguro\Helper\Library'),
                $data = [
                    'sender_document' => $this->helperData()->formatDocument($this->getRequest()->getParam('sender_document')),
                    'sender_hash' => $this->getRequest()->getParam('sender_hash'),
                    'order_id' => $this->lastRealOrderId(),
                    'installment' => [
                        'quantity' => $this->getRequest()->getParam('installment_quantity'),
                        'amount'   => $this->getRequest()->getParam('installment_amount')
                    ],
                    'token' => $this->getRequest()->getParam('card_token'),
                    'holder' => [
                        'name'       => $this->getRequest()->getParam('holder_name'),
                        'birth_date' => $this->getRequest()->getParam('holder_birthdate'),

                    ]
                ]
            );
            return $this->placeOrder($creditCard);

        } catch (\Exception $exception) {
            $this->changeOrderHistory('pagseguro_cancelada');
            $this->clearSession();
            return $this->whenError($exception->getMessage());
        }
    }
403330
public function getPayPalOxOrder()
    {
        if (is_null($this->payPalOxOrder)) {
            $order = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
            $order->loadPayPalOrder();
            $this->setPayPalOxOrder($order);
        }

        return $this->payPalOxOrder;
    }
240428
public function getPayment()
    {
        if ($this->_oPayment === null) {
            $this->_oPayment = false;

            $oBasket = $this->getBasket();
            $oUser = $this->getUser();

            // payment is set ?
            $sPaymentid = $oBasket->getPaymentId();
            $oPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);

            if ($sPaymentid && $oPayment->load($sPaymentid) &&
                $oPayment->isValidPayment(
                    \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('dynvalue'),
                    \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(),
                    $oUser,
                    $oBasket->getPriceForPayment(),
                    \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('sShipSet')
                )
            ) {
                $this->_oPayment = $oPayment;
            }
        }

        return $this->_oPayment;
    }