♻️ Rename onboarding prop to match its meaning

This commit is contained in:
Philipp Stracker 2025-02-14 13:04:37 +01:00
parent f958696c5f
commit 37e442eb1e
No known key found for this signature in database
2 changed files with 15 additions and 15 deletions

View file

@ -67,12 +67,12 @@ class OnboardingProfile extends AbstractDataModel {
*/ */
protected function get_defaults() : array { protected function get_defaults() : array {
return array( return array(
'completed' => false, 'completed' => false,
'step' => 0, 'step' => 0,
'is_casual_seller' => null, 'is_casual_seller' => null,
'are_optional_payment_methods_enabled' => null, 'accept_card_payments' => null,
'products' => array(), 'products' => array(),
'setup_done' => false, 'setup_done' => false,
); );
} }
@ -133,12 +133,12 @@ class OnboardingProfile extends AbstractDataModel {
} }
/** /**
* Sets the optional payment methods flag. * Sets the "accept card payments" flag.
* *
* @param bool|null $are_optional_payment_methods_enabled Whether the PayPal optional payment methods are enabled. * @param bool|null $accept_cards Whether to accept card payments via the PayPal plugin.
*/ */
public function set_are_optional_payment_methods_enabled( ?bool $are_optional_payment_methods_enabled ) : void { public function set_accept_card_payments( ?bool $accept_cards ) : void {
$this->data['are_optional_payment_methods_enabled'] = $are_optional_payment_methods_enabled; $this->data['accept_card_payments'] = $accept_cards;
} }
/** /**

View file

@ -41,23 +41,23 @@ class OnboardingRestEndpoint extends RestEndpoint {
* @var array * @var array
*/ */
private array $field_map = array( private array $field_map = array(
'completed' => array( 'completed' => array(
'js_name' => 'completed', 'js_name' => 'completed',
'sanitize' => 'to_boolean', 'sanitize' => 'to_boolean',
), ),
'step' => array( 'step' => array(
'js_name' => 'step', 'js_name' => 'step',
'sanitize' => 'to_number', 'sanitize' => 'to_number',
), ),
'is_casual_seller' => array( 'is_casual_seller' => array(
'js_name' => 'isCasualSeller', 'js_name' => 'isCasualSeller',
'sanitize' => 'to_boolean', 'sanitize' => 'to_boolean',
), ),
'are_optional_payment_methods_enabled' => array( 'accept_card_payments' => array(
'js_name' => 'areOptionalPaymentMethodsEnabled', 'js_name' => 'areOptionalPaymentMethodsEnabled',
'sanitize' => 'to_boolean', 'sanitize' => 'to_boolean',
), ),
'products' => array( 'products' => array(
'js_name' => 'products', 'js_name' => 'products',
), ),
); );