<commit_before><?php
namespace Payum\Be2Bill;

use Payum\Payment;
use Payum\Be2Bill\Action\CaptureAction;
use Payum\Be2Bill\Action\StatusAction;

abstract class PaymentFactory
{
    /**
     * @param Api $api
     * 
     * @return Payment
     */
    public static function create(Api $api)
    {
        $payment = new Payment;
        
        $payment->addApi($api);

        $payment->addAction(new CaptureAction());
        $payment->addAction(new StatusAction());<commit_msg>add endless cycle check in default setup.<commit_after><?php
namespace Payum\Be2Bill;

use Payum\Payment;
use Payum\Extension\EndlessCycleDetectorExtension;
use Payum\Be2Bill\Action\CaptureAction;
use Payum\Be2Bill\Action\StatusAction;

abstract class PaymentFactory
{
    /**
     * @param Api $api
     * 
     * @return Payment
     */
    public static function create(Api $api)
    {
        $payment = new Payment;
        
        $payment->addApi($api);

        $payment->addExtension(new EndlessCycleDetectorExtension);

        $payment->addAction(new CaptureAction());
        $payment->addAction(new StatusAction());
{'fraction_non_alphanumeric': 0.1152115211521152, 'fraction_numerical': 0.0054005400540054005, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '1257918', 'n_tokens_mistral': 332, 'n_tokens_neox': 330, 'n_words': 69}