<commit_before><?php
namespace Payum\Paypal\Rest;

use Payum\Core\Action\ExecuteSameRequestWithModelDetailsAction;
use Payum\Core\Action\GetHttpRequestAction;
use Payum\Core\Payment;
use Payum\Core\Extension\EndlessCycleDetectorExtension;
use Payum\Paypal\Rest\Action\CaptureAction;
use Payum\Paypal\Rest\Action\StatusAction;
use PayPal\Rest\ApiContext;
use Payum\Paypal\Rest\Action\SyncAction;

abstract class PaymentFactory
{
    /**
     * @param ApiContext $api
     *
     * @return \Payum\Core\Payment
     */
    public static function create(ApiContext $api)
    {
        $payment = new Payment;

        $payment->addApi($api);

        $payment->addExtension(new EndlessCycleDetectorExtension);

        $payment->addAction(new CaptureAction);
        $payment->addAction(new StatusAction);
        $payment->addAction(new SyncAction);
        $payment->addAction(new ExecuteSameRequestWithModelDetailsAction);
        $payment->addAction(new GetHttpRequestAction);

        return $payment;
    }

    /**
     */
    private  function __construct()
    {
    }
}<commit_msg>[action] execute same request with details has to be the last action.<commit_after><?php
namespace Payum\Paypal\Rest;

use Payum\Core\Action\ExecuteSameRequestWithModelDetailsAction;
use Payum\Core\Action\GetHttpRequestAction;
use Payum\Core\Payment;
use Payum\Core\Extension\EndlessCycleDetectorExtension;
use Payum\Paypal\Rest\Action\CaptureAction;
use Payum\Paypal\Rest\Action\StatusAction;
use PayPal\Rest\ApiContext;
use Payum\Paypal\Rest\Action\SyncAction;

abstract class PaymentFactory
{
    /**
     * @param ApiContext $api
     *
     * @return \Payum\Core\Payment
     */
    public static function create(ApiContext $api)
    {
        $payment = new Payment;

        $payment->addApi($api);

        $payment->addExtension(new EndlessCycleDetectorExtension);

        $payment->addAction(new CaptureAction);
        $payment->addAction(new StatusAction);
        $payment->addAction(new SyncAction);
        $payment->addAction(new GetHttpRequestAction);

        $payment->addAction(new ExecuteSameRequestWithModelDetailsAction);

        return $payment;
    }

    /**
     */
    private  function __construct()
    {
    }
}
{'fraction_non_alphanumeric': 0.10802330793366204, 'fraction_numerical': 0.0, 'mean_word_length': 3.446215139442231, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3347526', 'n_tokens_mistral': 667, 'n_tokens_neox': 655, 'n_words': 117}