add a toggle to enable user adding credentials manually

This commit is contained in:
David Remer 2020-07-28 05:41:09 +03:00
parent a53e4d4187
commit 6a4b406568
5 changed files with 88 additions and 32 deletions

View file

@ -160,6 +160,7 @@ return [
'merchant_email' => [
'title' => __('Email address', 'woocommerce-paypal-commerce-gateway'),
'type' => 'text',
'required' => true,
'desc_tip' => true,
'description' => __('The email address of your PayPal account.', 'woocommerce-paypal-commerce-gateway'),
'default' => '',
@ -179,6 +180,43 @@ return [
'hidden' => 'merchant_email',
'requirements' => [],
],
'toggle_manual_input' => [
'type' => 'ppcp-text',
'title' => __('Manual mode', 'woocommerce-paypla-commerce-gateway'),
'text' => '<button id="ppcp[toggle_manual_input]">' . __('Toggle to manual credential input', 'woocommerce-paypal-commerce-gateway') . '</button>',
'screens' => [
State::STATE_START,
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
],
'requirements' => [],
],
'client_id' => [
'title' => __('Client Id', 'woocommerce-paypal-commerce-gateway'),
'type' => 'text',
'desc_tip' => true,
'description' => __('The client id of your api ', 'woocommerce-paypal-commerce-gateway'),
'default' => false,
'screens' => [
State::STATE_START,
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
],
'requirements' => [],
],
'client_secret' => [
'title' => __('Secret Key', 'woocommerce-paypal-commerce-gateway'),
'type' => 'password',
'desc_tip' => true,
'description' => __('The secret key of your api', 'woocommerce-paypal-commerce-gateway'),
'default' => false,
'screens' => [
State::STATE_START,
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
],
'requirements' => [],
],
'title' => [
'title' => __('Title', 'woocommerce-paypal-commerce-gateway'),
'type' => 'text',
@ -491,34 +529,6 @@ return [
],
'requirements' => [],
],
'client_id' => [
'title' => __('Client Id', 'woocommerce-paypal-commerce-gateway'),
'type' => 'text',
'desc_tip' => true,
'label' => __('Enable logging', 'woocommerce-paypal-commerce-gateway'),
'description' => __('Enable logging of unexpected behavior. This can also log private data and should only be enabled in a development or stage environment.', 'woocommerce-paypal-commerce-gateway'),
'default' => false,
'screens' => [
State::STATE_START,
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
],
'requirements' => [],
],
'client_secret' => [
'title' => __('Secret Id', 'woocommerce-paypal-commerce-gateway'),
'type' => 'text',
'desc_tip' => true,
'label' => __('Enable logging', 'woocommerce-paypal-commerce-gateway'),
'description' => __('Enable logging of unexpected behavior. This can also log private data and should only be enabled in a development or stage environment.', 'woocommerce-paypal-commerce-gateway'),
'default' => false,
'screens' => [
State::STATE_START,
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
],
'requirements' => [],
],
];
},
];