♻️ Prevent upading clientId/secret via REST

This commit is contained in:
Philipp Stracker 2025-01-08 15:19:50 +01:00
parent 6167955374
commit bd7bbb36b2
No known key found for this signature in database
2 changed files with 8 additions and 10 deletions

View file

@ -57,14 +57,14 @@ class CommonSettings extends AbstractDataModel {
return array( return array(
'use_sandbox' => false, 'use_sandbox' => false,
'use_manual_connection' => false, 'use_manual_connection' => false,
'client_id' => '',
'client_secret' => '',
// Details about connected merchant account. // Details about connected merchant account.
'merchant_connected' => false, 'merchant_connected' => false,
'sandbox_merchant' => false, 'sandbox_merchant' => false,
'merchant_id' => '', 'merchant_id' => '',
'merchant_email' => '', 'merchant_email' => '',
'client_id' => '',
'client_secret' => '',
); );
} }

View file

@ -50,14 +50,6 @@ class CommonRestEndpoint extends RestEndpoint {
'js_name' => 'useManualConnection', 'js_name' => 'useManualConnection',
'sanitize' => 'to_boolean', 'sanitize' => 'to_boolean',
), ),
'client_id' => array(
'js_name' => 'clientId',
'sanitize' => 'sanitize_text_field',
),
'client_secret' => array(
'js_name' => 'clientSecret',
'sanitize' => 'sanitize_text_field',
),
'webhooks' => array( 'webhooks' => array(
'js_name' => 'webhooks', 'js_name' => 'webhooks',
), ),
@ -81,6 +73,12 @@ class CommonRestEndpoint extends RestEndpoint {
'merchant_email' => array( 'merchant_email' => array(
'js_name' => 'email', 'js_name' => 'email',
), ),
'client_id' => array(
'js_name' => 'clientId',
),
'client_secret' => array(
'js_name' => 'clientSecret',
),
); );
/** /**