diff --git a/modules.php b/modules.php index 2422069c1..792aa636e 100644 --- a/modules.php +++ b/modules.php @@ -90,5 +90,12 @@ return function ( string $root_dir ): iterable { $modules[] = ( require "$modules_dir/ppcp-axo-block/module.php" )(); } + if ( apply_filters( + 'woocommerce.feature-flags.woocommerce_paypal_payments.settings_enabled', + getenv( 'PCP_SETTINGS_ENABLED' ) === '1' + ) ) { + $modules[] = ( require "$modules_dir/ppcp-settings/module.php" )(); + } + return $modules; }; diff --git a/modules/ppcp-api-client/src/Endpoint/BillingSubscriptions.php b/modules/ppcp-api-client/src/Endpoint/BillingSubscriptions.php index 8a46506b6..281afe0ec 100644 --- a/modules/ppcp-api-client/src/Endpoint/BillingSubscriptions.php +++ b/modules/ppcp-api-client/src/Endpoint/BillingSubscriptions.php @@ -67,7 +67,7 @@ class BillingSubscriptions { */ public function suspend( string $id ):void { $data = array( - 'reason' => 'Suspended by customer', + 'reason' => sprintf( 'Suspended by %s.', is_admin() ? 'merchant' : 'customer' ), ); $bearer = $this->bearer->bearer(); @@ -107,7 +107,7 @@ class BillingSubscriptions { */ public function activate( string $id ): void { $data = array( - 'reason' => 'Reactivated by customer', + 'reason' => sprintf( 'Reactivated by %s.', is_admin() ? 'merchant' : 'customer' ), ); $bearer = $this->bearer->bearer(); @@ -148,7 +148,7 @@ class BillingSubscriptions { */ public function cancel( string $id ): void { $data = array( - 'reason' => 'Cancelled by customer', + 'reason' => sprintf( 'Cancelled by %s.', is_admin() ? 'merchant' : 'customer' ), ); $bearer = $this->bearer->bearer(); diff --git a/modules/ppcp-blocks/resources/js/Components/card-fields.js b/modules/ppcp-blocks/resources/js/Components/card-fields.js index 2726bc12e..05d41b315 100644 --- a/modules/ppcp-blocks/resources/js/Components/card-fields.js +++ b/modules/ppcp-blocks/resources/js/Components/card-fields.js @@ -19,11 +19,9 @@ export function CardFields( { config, eventRegistration, emitResponse, - components, } ) { const { onPaymentSetup } = eventRegistration; const { responseTypes } = emitResponse; - const { PaymentMethodIcons } = components; const [ cardFieldsForm, setCardFieldsForm ] = useState(); const getCardFieldsForm = ( cardFieldsForm ) => { @@ -95,10 +93,6 @@ export function CardFields( { } } > - , - content: , - edit: , - ariaLabel: config.title, - canMakePayment: () => { - return true; - }, - supports: { - showSavedCards: true, - features: config.supports, - }, -} ); +const Label = ({components, config}) => { + const {PaymentMethodIcons} = components; + return <> + + + +} + +registerPaymentMethod({ + name: config.id, + label: