mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Fixes AXO settings fields display and AXO sandbox mode
This commit is contained in:
parent
2e6f403ed1
commit
11b87155f3
3 changed files with 10 additions and 13 deletions
|
@ -84,15 +84,13 @@ return array(
|
|||
->rule()
|
||||
->condition_element( 'axo_enabled', '1' )
|
||||
->action_visible( 'axo_gateway_title' )
|
||||
->action_visible( 'axo_email_widget' )
|
||||
->action_visible( 'axo_address_widget' )
|
||||
->action_visible( 'axo_payment_widget' )
|
||||
->action_visible( 'axo_privacy' )
|
||||
->action_visible( 'axo_style_heading' )
|
||||
->action_class( 'axo_enabled', 'active' )
|
||||
->to_array(),
|
||||
$display_manager
|
||||
->rule()
|
||||
->condition_element( 'axo_enabled', '1' )
|
||||
->condition_js_variable( 'ppcpAxoShowStyles', true )
|
||||
->action_visible( 'axo_style_root_heading' )
|
||||
->action_visible( 'axo_style_root_bg_color' )
|
||||
|
|
|
@ -435,7 +435,9 @@ class AxoManager {
|
|||
}
|
||||
|
||||
async connect() {
|
||||
window.localStorage.setItem('axoEnv', 'sandbox'); // TODO: check sandbox
|
||||
if (this.axoConfig.environment.is_sandbox) {
|
||||
window.localStorage.setItem('axoEnv', 'sandbox');
|
||||
}
|
||||
|
||||
await this.fastlane.connect({
|
||||
locale: this.locale,
|
||||
|
|
|
@ -150,17 +150,14 @@ class AxoManager {
|
|||
* @return array
|
||||
*/
|
||||
private function script_data() {
|
||||
$email_widget = $this->settings->has( 'axo_email_widget' ) ? $this->settings->get( 'axo_email_widget' ) : null;
|
||||
$address_widget = $this->settings->has( 'axo_address_widget' ) ? $this->settings->get( 'axo_address_widget' ) : null;
|
||||
$payment_widget = $this->settings->has( 'axo_payment_widget' ) ? $this->settings->get( 'axo_payment_widget' ) : null;
|
||||
|
||||
return array(
|
||||
'widgets' => array(
|
||||
'email' => $email_widget ?: 'render',
|
||||
'address' => $address_widget ?: 'render',
|
||||
'payment' => $payment_widget ?: 'render',
|
||||
'environment' => array(
|
||||
'is_sandbox' => $this->environment->current_environment() === 'sandbox',
|
||||
),
|
||||
'insights' => array(
|
||||
'widgets' => array(
|
||||
'email' => 'render',
|
||||
),
|
||||
'insights' => array(
|
||||
'enabled' => true,
|
||||
'client_id' => ( $this->settings->has( 'client_id' ) ? $this->settings->get( 'client_id' ) : null ),
|
||||
'session_id' =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue