Plugin Directory


Ignore:
Timestamp:
10/15/2026 01:17:41 PM (4 days ago)
Author:
adreastrian
Message:

releasing v2.1.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fluent-cart/trunk/app/Models/Subscription.php

    r3746418 r3748568  
    1515use FluentCart\App\Models\Concerns\CanUpdateBatch;
    1616use FluentCart\App\Models\Concerns\HasActivity;
     17use FluentCart\App\Services\Payments\PaymentHelper;
    1718use FluentCart\App\Services\Payments\SubscriptionHelper;
    1819use FluentCart\App\Services\TemplateService;
    … …  
    285286
    286287    /**
    287      * Display label of the backing gateway ("Authorize.Net", "Cash"), the same
    288      * source StatusHelper stamps into order.payment_method_title. Empty when the
    289      * slug resolves to no registered gateway.
     288     * Display label of the backing gateway ("Authorize.Net", "Cash"). The slug
     289     * in title case when no registered gateway matches.
    290290     */
    291291    public function getPaymentMethodTitleAttribute(): string
    292292    {
    293         $gateway = $this->resolveGateway();
    294         if (!$gateway) {
    295             return '';
    296         }
    297 
    298         $title = method_exists($gateway, 'getMeta')
    299             ? $gateway->getMeta('title')
    300             : Arr::get($gateway->meta(), 'title');
    301 
    302         return (string) $title;
     293        return PaymentHelper::getMethodTitle($this->current_payment_method);
    303294    }
    304295
    … …  
    387378        }
    388379
    389         return Arr::get($info, 'method', '');
     380        return Arr::get($info, 'method') ?: PaymentHelper::getMethodTitle($this->current_payment_method);
    390381    }
    391382
Note: See TracChangeset for help on using the changeset viewer.