2023-03-04 14:13:14 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Extensions\PaymentGateways\PayPal;
|
|
|
|
|
|
|
|
use Spatie\LaravelSettings\Settings;
|
|
|
|
|
|
|
|
class PayPalSettings extends Settings
|
|
|
|
{
|
2023-03-04 19:00:22 +00:00
|
|
|
public bool $enabled = false;
|
2023-03-04 14:13:14 +00:00
|
|
|
public ?string $client_id;
|
|
|
|
public ?string $client_secret;
|
2023-03-04 19:00:22 +00:00
|
|
|
public ?string $sandbox_client_id;
|
|
|
|
public ?string $sandbox_client_secret;
|
2023-03-04 14:13:14 +00:00
|
|
|
|
|
|
|
public static function group(): string
|
|
|
|
{
|
|
|
|
return 'paypal';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static function encrypted(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'client_id',
|
2023-03-04 19:00:22 +00:00
|
|
|
'client_secret',
|
|
|
|
'sandbox_client_id',
|
|
|
|
'sandbox_client_secret'
|
2023-03-04 14:13:14 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Summary of optionInputData array
|
|
|
|
* Only used for the settings page
|
|
|
|
* @return array<array<'type'|'label'|'description'|'options', string|bool|float|int|array<string, string>>>
|
|
|
|
*/
|
|
|
|
public static function getOptionInputData()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'category_icon' => 'fas fa-dollar-sign',
|
|
|
|
'client_id' => [
|
2023-03-04 19:00:22 +00:00
|
|
|
'type' => 'string',
|
2023-03-04 14:13:14 +00:00
|
|
|
'label' => 'Client ID',
|
|
|
|
'description' => 'The Client ID of your PayPal App',
|
|
|
|
],
|
|
|
|
'client_secret' => [
|
2023-03-04 19:00:22 +00:00
|
|
|
'type' => 'string',
|
2023-03-04 14:13:14 +00:00
|
|
|
'label' => 'Client Secret',
|
|
|
|
'description' => 'The Client Secret of your PayPal App',
|
2023-03-04 19:00:22 +00:00
|
|
|
],
|
|
|
|
'enabled' => [
|
|
|
|
'type' => 'boolean',
|
|
|
|
'label' => 'Enabled',
|
|
|
|
'description' => 'Enable this payment gateway',
|
|
|
|
],
|
|
|
|
'sandbox_client_id' => [
|
|
|
|
'type' => 'string',
|
|
|
|
'label' => 'Sandbox Client ID',
|
|
|
|
'description' => 'The Sandbox Client ID used when app_env = local',
|
|
|
|
],
|
|
|
|
'sandbox_client_secret' => [
|
|
|
|
'type' => 'string',
|
|
|
|
'label' => 'Sandbox Client Secret',
|
|
|
|
'description' => 'The Sandbox Client Secret used when app_env = local',
|
|
|
|
],
|
2023-03-04 14:13:14 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|