diff --git a/modules/ppcp-settings/resources/js/data/payment/hooks.js b/modules/ppcp-settings/resources/js/data/payment/hooks.js index e795bf760..823909695 100644 --- a/modules/ppcp-settings/resources/js/data/payment/hooks.js +++ b/modules/ppcp-settings/resources/js/data/payment/hooks.js @@ -56,6 +56,14 @@ const useHooks = () => { const pui = usePersistent( 'ppcp-pay-upon-invoice-gateway' ); const oxxo = usePersistent( 'ppcp-oxxo-gateway' ); + // Custom modal data. + const paypalShowLogo = usePersistent( 'paypalShowLogo' ); + const threeDSecure = usePersistent( 'threeDSecure' ); + const fastlaneCardholderName = usePersistent( 'fastlaneCardholderName' ); + const fastlaneDisplayWatermark = usePersistent( + 'fastlaneDisplayWatermark' + ); + return { persist, isReady, @@ -78,6 +86,10 @@ const useHooks = () => { multibanco, pui, oxxo, + paypalShowLogo, + threeDSecure, + fastlaneCardholderName, + fastlaneDisplayWatermark, }; }; @@ -107,6 +119,10 @@ export const usePaymentMethods = () => { multibanco, pui, oxxo, + paypalShowLogo, + threeDSecure, + fastlaneCardholderName, + fastlaneDisplayWatermark, } = useHooks(); const paymentMethods = [ @@ -128,6 +144,10 @@ export const usePaymentMethods = () => { multibanco, pui, oxxo, + paypalShowLogo, + threeDSecure, + fastlaneCardholderName, + fastlaneDisplayWatermark, ]; return { diff --git a/modules/ppcp-settings/resources/js/data/payment/reducer.js b/modules/ppcp-settings/resources/js/data/payment/reducer.js index 4894c9996..85c2e7d63 100644 --- a/modules/ppcp-settings/resources/js/data/payment/reducer.js +++ b/modules/ppcp-settings/resources/js/data/payment/reducer.js @@ -37,6 +37,10 @@ const defaultPersistent = Object.freeze( { 'ppcp-multibanco': {}, 'ppcp-pay-upon-invoice-gateway': {}, 'ppcp-oxxo-gateway': {}, + paypalShowLogo: false, + threeDSecure: 'no-3d-secure', + fastlaneCardholderName: false, + fastlaneDisplayWatermark: false, } ); // Reducer logic. diff --git a/modules/ppcp-settings/src/Endpoint/PaymentRestEndpoint.php b/modules/ppcp-settings/src/Endpoint/PaymentRestEndpoint.php index 694948f44..3da892ff3 100644 --- a/modules/ppcp-settings/src/Endpoint/PaymentRestEndpoint.php +++ b/modules/ppcp-settings/src/Endpoint/PaymentRestEndpoint.php @@ -66,11 +66,11 @@ class PaymentRestEndpoint extends RestEndpoint { 'sanitize' => 'sanitize_text_field', ), 'fastlane_cardholder_name' => array( - 'js_name' => 'FastlaneCardholderName', + 'js_name' => 'fastlaneCardholderName', 'sanitize' => 'to_boolean', ), 'fastlane_display_watermark' => array( - 'js_name' => 'FastlaneDisplayWatermark', + 'js_name' => 'fastlaneDisplayWatermark', 'sanitize' => 'to_boolean', ), ); @@ -682,6 +682,11 @@ class PaymentRestEndpoint extends RestEndpoint { } } + $gateway_settings['paypalShowLogo'] = $this->settings->get_paypal_show_logo(); + $gateway_settings['threeDSecure'] = $this->settings->get_three_d_secure(); + $gateway_settings['fastlaneCardholderName'] = $this->settings->get_fastlane_cardholder_name(); + $gateway_settings['fastlaneDisplayWatermark'] = $this->settings->get_fastlane_display_watermark(); + return $this->return_success( $gateway_settings ); }