Model/IPNPaymentBuilder.php
public function buildPayment()
    {
        $return = null;

        // Setter forms request payment from request parameters.
        $requestOrderPayment = $this->prepareRequestOrderPayment();

        // Create order payment from database to check if it match created from request.
        $orderPayment = $this->loadOrderPayment($requestOrderPayment->getTransactionId());

        // Only need validate if there is order in database.
        // If request payment do not have matching payment with order return null.
        if ($orderPayment->getOrderId()) {
            // Validator change request payment by adding information if it is valid.
            $orderPayment = $this->addPaymentValidationInformation($requestOrderPayment, $orderPayment);
            $orderPayment = $this->changePaymentStatusInfo($requestOrderPayment, $orderPayment);
            $orderPayment->save();
            $return = $orderPayment;
        } else {
            //IPN request might be for a transaction that does not yet exist in the shop database.
            $paymentCreator = $this->getPaymentCreator();
            $return = $paymentCreator->handleOrderPayment($requestOrderPayment);
        }

        return $return;
    }
public function buildPayment()
    {
        $return = null;

        // Setter forms request payment from request parameters.
        $requestOrderPayment = $this->prepareRequestOrderPayment();

        // Create order payment from database to check if it match created from request.
        $orderPayment = $this->loadOrderPayment($requestOrderPayment->getTransactionId());

        // Only need validate if there is order in database.
        // If request payment do not have matching payment with order return null.
        if ($orderPayment->getOrderId()) {
            // Validator change request payment by adding information if it is valid.
            $orderPayment = $this->addPaymentValidationInformation($requestOrderPayment, $orderPayment);
            $orderPayment = $this->changePaymentStatusInfo($requestOrderPayment, $orderPayment);
            $orderPayment->save();
            $return = $orderPayment;
        } else {
            //IPN request might be for a transaction that does not yet exist in the shop database.
            $paymentCreator = $this->getPaymentCreator();
            $return = $paymentCreator->handleOrderPayment($requestOrderPayment);
        }

        return $return;
    }
public function buildPayment ( ) { $ return = null ; // Setter forms request payment from request parameters. $ requestOrderPayment = $ this -> prepareRequestOrderPayment ( ) ; // Create order payment from database to check if it match created from request. $ orderPayment = $ this -> loadOrderPayment ( $ requestOrderPayment -> getTransactionId ( ) ) ; // Only need validate if there is order in database. // If request payment do not have matching payment with order return null. if ( $ orderPayment -> getOrderId ( ) ) { // Validator change request payment by adding information if it is valid. $ orderPayment = $ this -> addPaymentValidationInformation ( $ requestOrderPayment , $ orderPayment ) ; $ orderPayment = $ this -> changePaymentStatusInfo ( $ requestOrderPayment , $ orderPayment ) ; $ orderPayment -> save ( ) ; $ return = $ orderPayment ; } else { //IPN request might be for a transaction that does not yet exist in the shop database. $ paymentCreator = $ this -> getPaymentCreator ( ) ; $ return = $ paymentCreator -> handleOrderPayment ( $ requestOrderPayment ) ; } return $ return ; }
Create payment from given request.

@return \OxidEsales\PayPalModule\Model\OrderPayment|null
Create payment from given request .