Commit 35460a67 authored by Mark Harding's avatar Mark Harding
Browse files

(feat): add pro payout method to settings

parent 52a592b9
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -327,6 +327,10 @@ class Manager
                ->save();
                ->save();
        }
        }


        if (isset($values['payout_method'])) {
            $settings->setPayoutMethod($values['payout_method']);
        }

        $settings->setTimeUpdated(time());
        $settings->setTimeUpdated(time());


        $this->setupRoutingDelegate
        $this->setupRoutingDelegate
+2 −0
Original line number Original line Diff line number Diff line
@@ -101,6 +101,7 @@ class Repository
                        ->setHasCustomLogo($data['has_custom_logo'] ?? false)
                        ->setHasCustomLogo($data['has_custom_logo'] ?? false)
                        ->setHasCustomBackground($data['has_custom_background'] ?? false)
                        ->setHasCustomBackground($data['has_custom_background'] ?? false)
                        ->setTimeUpdated($data['time_updated'] ?? 0)
                        ->setTimeUpdated($data['time_updated'] ?? 0)
                        ->setPayoutMethod($data['payout_method'] ?? 'usd')
                    ;
                    ;


                    $response[] = $settings;
                    $response[] = $settings;
@@ -150,6 +151,7 @@ class Repository
                'has_custom_logo' => $settings->hasCustomLogo(),
                'has_custom_logo' => $settings->hasCustomLogo(),
                'has_custom_background' => $settings->hasCustomBackground(),
                'has_custom_background' => $settings->hasCustomBackground(),
                'time_updated' => $settings->getTimeUpdated(),
                'time_updated' => $settings->getTimeUpdated(),
                'payout_method' => $settings->getPayoutMethod(),
            ]),
            ]),
        ];
        ];


+6 −0
Original line number Original line Diff line number Diff line
@@ -52,6 +52,8 @@ use Minds\Traits\MagicAttributes;
 * @method Settings setHasCustomBackground(bool $customBackground)
 * @method Settings setHasCustomBackground(bool $customBackground)
 * @method int getTimeUpdated()
 * @method int getTimeUpdated()
 * @method Settings setTimeUpdated(int $timeUpdated)
 * @method Settings setTimeUpdated(int $timeUpdated)
 * @method string getPayoutMethod()
 * @method Settings setPayoutMethod(string $method)
 */
 */
class Settings implements JsonSerializable
class Settings implements JsonSerializable
{
{
@@ -135,6 +137,9 @@ class Settings implements JsonSerializable
    /** @var int */
    /** @var int */
    protected $timeUpdated;
    protected $timeUpdated;


    /** @var string */
    protected $payoutMethod = 'usd';

    /**
    /**
     * @return string
     * @return string
     */
     */
@@ -176,6 +181,7 @@ class Settings implements JsonSerializable
            'styles' => $this->buildStyles(),
            'styles' => $this->buildStyles(),
            'published' => $this->published,
            'published' => $this->published,
            'time_updated' => $this->timeUpdated,
            'time_updated' => $this->timeUpdated,
            'payout_method' => $this->payoutMethod,
        ];
        ];
    }
    }