protected function getPaymentStatus($response)
    {
        $lastPayment = Arr::last($response['payments']);

        // approved, in_process, pending, rejected, cancelled
        // on testing at least, payments may be empty
        return $lastPayment ? Arr::get($lastPayment, 'status', 'other') : 'no_payment';
    }
protected function getPaymentStatus($response)
    {
        $lastPayment = Arr::last($response['payments']);

        // approved, in_process, pending, rejected, cancelled
        // on testing at least, payments may be empty
        return $lastPayment ? Arr::get($lastPayment, 'status', 'other') : 'no_payment';
    }
protected function getPaymentStatus ( $ response ) { $ lastPayment = Arr :: last ( $ response [ 'payments' ] ) ; // approved, in_process, pending, rejected, cancelled // on testing at least, payments may be empty return $ lastPayment ? Arr :: get ( $ lastPayment , 'status' , 'other' ) : 'no_payment' ; }
Get the status from the last payment.

@param array $response

@return string
Get the status from the last payment .