diff --git a/paypal/controllers/FrmPayPalLiteActionsController.php b/paypal/controllers/FrmPayPalLiteActionsController.php index 2e4dbf9993..500d403cc5 100644 --- a/paypal/controllers/FrmPayPalLiteActionsController.php +++ b/paypal/controllers/FrmPayPalLiteActionsController.php @@ -1419,6 +1419,7 @@ function ( $tag, $handle ) use ( $has_break ) { 'buttonStyle' => self::get_button_style_for_js( $action ), 'imagesUrl' => FrmPayPalLiteAppHelper::plugin_url() . 'images/', 'includeGooglePayApplePay' => $include_google_apple_pay, + 'mode' => FrmPayPalLiteAppHelper::active_mode(), ); wp_localize_script( 'formidable-paypal', 'frmPayPalVars', $paypal_vars ); diff --git a/paypal/js/frontend.js b/paypal/js/frontend.js index 36ca9997d7..13371c0a8a 100644 --- a/paypal/js/frontend.js +++ b/paypal/js/frontend.js @@ -920,7 +920,7 @@ */ function getGooglePaymentsClient() { return new google.payments.api.PaymentsClient( { - environment: 'TEST', + environment: frmPayPalVars.mode === 'test' ? 'TEST' : 'PRODUCTION', paymentDataCallbacks: { onPaymentAuthorized }