Laravel controller for creating payments with Mollie
Yes, the Single Reponsibility Principle can apply to methods (I know that article is geared towards Swift but should hopefully still be practical in other languages). 

While there are guidelines like this answer:


  What's the Right Size, Really?
  
  Depends on the language you use, but in general (and for my personal taste):
  
  
  Ideally, less than 25 lines.
  Acceptably, less than 35 lines.
  


there are varying opinions. I try to keep methods under 10 lines if possible. 

With the method createPayment(), the lines that handle creating the payment and CreditOrder could be moved out to a separate method:

/**
* Create a payment record and a CreditOrder
* @param $bundle
* @return Payment
*/
private function _createPaymentAndOrder($bundle) 
{
    $order_id = time();
    $payment = $this-&gt;payment-&gt;create([
        "amount"            =&gt; $bundle['price'],
        "description"       =&gt; $bundle['credits'] . " credits",
        "redirectUrl"       =&gt; route('order.credits.finish', ['order_id' =&gt; $order_id]),
        "webhookUrl"      =&gt; route('order.credits.webhook'),
        "metadata"          =&gt; ['order' =&gt; 'credits', 'order_id' =&gt; $order_id],
    ]);

    CreditOrder::create([
        'user_id' =&gt; auth()-&gt;user()-&gt;id,
        'order_id' =&gt; $order_id,
        'payment_id' =&gt; $payment-&gt;id,
        'payment_status' =&gt; $payment-&gt;status,
        'credits' =&gt; $bundle['credits'],
    ]);
    return $payment
}


Then those lines can be moved out and replaced with a call to that new method:

/**
* Attempt to create a payment record
* @param Request $request
* @param $bundle
*/
public function createPayment(Request $request, $bundle)
{
    $bundles = $this-&gt;creditBundles();

    if (!array_key_exists($bundle, $bundles)) {
        return redirect()-&gt;route('order.credits');
    }

    $bundle = $bundles[$bundle];
    $payment = $this-&gt;_createPaymentAndOrder($bundle);

    return redirect($payment-&gt;getPaymentUrl());
}


The names could be modified slightly so they aren't so close.

As far as the finish() method goes, the three lines below that actually update data could be moved into a separate method, unless that feels too small.

$user-&gt;increment('credits', $order-&gt;credits);
$order-&gt;payout = true;
$order-&gt;save();


And one could move the first couple blocks that check that the user is the same as the user on the order and the payment is paid into a separate method to handle error checking. If that method returned a certain value (e.g. true to signify an error occurred, false that no error occurred) then the rest of the method could be run accordingly.