Fix merge conflicts

This commit is contained in:
dinamiko 2021-05-26 15:23:09 +02:00
commit f50628adad
22 changed files with 547 additions and 286 deletions

View file

@ -136,7 +136,8 @@ return array(
$webhook_registrar = $container->get( 'webhook.registrar' );
$state = $container->get( 'onboarding.state' );
$cache = new Cache( 'ppcp-paypal-bearer' );
return new SettingsListener( $settings, $fields, $webhook_registrar, $cache, $state );
$bearer = $container->get( 'api.bearer' );
return new SettingsListener( $settings, $fields, $webhook_registrar, $cache, $state, $bearer );
},
'wcgateway.order-processor' => static function ( $container ): OrderProcessor {
@ -184,7 +185,6 @@ return array(
'wcgateway.settings.fields' => static function ( $container ): array {
$state = $container->get( 'onboarding.state' );
$settings = $container->get( 'wcgateway.settings' );
$messages_disclaimers = $container->get( 'button.helper.messages-disclaimers' );
$fields = array(
@ -637,8 +637,8 @@ return array(
'type' => 'checkbox',
'desc_tip' => true,
'label' => sprintf(
// translators: %1$s and %2$s are the opening and closing href link tags.
__( 'To use vaulting features, you must %1$senable vaulting on your account%2$s.', 'woocommerce-paypal-payments' ),
// translators: %1$s and %2$s are the opening and closing of HTML <a> tag.
__( 'Enable saved cards and subscription features on your store. To use vaulting features, you must %1$senable vaulting on your account%2$s.', 'woocommerce-paypal-payments' ),
'<a
href="https://docs.woocommerce.com/document/woocommerce-paypal-payments/#enable-vaulting-on-your-live-account"
target="_blank"
@ -1809,7 +1809,6 @@ return array(
unset( $fields['disable_funding']['options']['card'] );
}
$dcc_applies = $container->get( 'api.helpers.dccapplies' );
/**
* Depending on your store location, some credit cards can't be used.
* Here, we filter them out.
@ -1818,6 +1817,7 @@ return array(
*
* @var DccApplies $dcc_applies
*/
$dcc_applies = $container->get( 'api.helpers.dccapplies' );
$card_options = $fields['disable_cards']['options'];
foreach ( $card_options as $card => $label ) {
if ( $dcc_applies->can_process_card( $card ) ) {
@ -1827,6 +1827,18 @@ return array(
}
$fields['disable_cards']['options'] = $card_options;
$fields['card_icons']['options'] = $card_options;
/**
* Display vault message on Pay Later label if vault is enabled.
*/
$settings = $container->get( 'wcgateway.settings' );
if ( $settings->has( 'vault_enabled' ) && $settings->get( 'vault_enabled' ) ) {
$message = __( "You have PayPal vaulting enabled, that's why Pay Later Messaging options are unavailable now. You cannot use both features at the same time.", 'woocommerce-paypal-payments' );
$fields['message_enabled']['label'] = $message;
$fields['message_product_enabled']['label'] = $message;
$fields['message_cart_enabled']['label'] = $message;
}
return $fields;
},