mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
♻️ Rename onboarding prop to match its meaning
This commit is contained in:
parent
f958696c5f
commit
37e442eb1e
2 changed files with 15 additions and 15 deletions
|
@ -67,12 +67,12 @@ class OnboardingProfile extends AbstractDataModel {
|
|||
*/
|
||||
protected function get_defaults() : array {
|
||||
return array(
|
||||
'completed' => false,
|
||||
'step' => 0,
|
||||
'is_casual_seller' => null,
|
||||
'are_optional_payment_methods_enabled' => null,
|
||||
'products' => array(),
|
||||
'setup_done' => false,
|
||||
'completed' => false,
|
||||
'step' => 0,
|
||||
'is_casual_seller' => null,
|
||||
'accept_card_payments' => null,
|
||||
'products' => array(),
|
||||
'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 {
|
||||
$this->data['are_optional_payment_methods_enabled'] = $are_optional_payment_methods_enabled;
|
||||
public function set_accept_card_payments( ?bool $accept_cards ) : void {
|
||||
$this->data['accept_card_payments'] = $accept_cards;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -41,23 +41,23 @@ class OnboardingRestEndpoint extends RestEndpoint {
|
|||
* @var array
|
||||
*/
|
||||
private array $field_map = array(
|
||||
'completed' => array(
|
||||
'completed' => array(
|
||||
'js_name' => 'completed',
|
||||
'sanitize' => 'to_boolean',
|
||||
),
|
||||
'step' => array(
|
||||
'step' => array(
|
||||
'js_name' => 'step',
|
||||
'sanitize' => 'to_number',
|
||||
),
|
||||
'is_casual_seller' => array(
|
||||
'is_casual_seller' => array(
|
||||
'js_name' => 'isCasualSeller',
|
||||
'sanitize' => 'to_boolean',
|
||||
),
|
||||
'are_optional_payment_methods_enabled' => array(
|
||||
'accept_card_payments' => array(
|
||||
'js_name' => 'areOptionalPaymentMethodsEnabled',
|
||||
'sanitize' => 'to_boolean',
|
||||
),
|
||||
'products' => array(
|
||||
'products' => array(
|
||||
'js_name' => 'products',
|
||||
),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue