Fix merge conflicts with trunk

This commit is contained in:
dinamiko 2021-03-31 11:22:01 +02:00
commit 34b624905d
31 changed files with 1008 additions and 165 deletions

View file

@ -13,6 +13,7 @@ use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint;
use WooCommerce\PayPalCommerce\ApiClient\Entity\ApplicationContext;
use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache;
use WooCommerce\PayPalCommerce\ApiClient\Helper\DccApplies;
use WooCommerce\PayPalCommerce\Onboarding\Environment;
use WooCommerce\PayPalCommerce\Onboarding\State;
use WooCommerce\PayPalCommerce\WcGateway\Admin\OrderTablePaymentStatusColumn;
use WooCommerce\PayPalCommerce\WcGateway\Admin\PaymentStatusOrderDetail;
@ -22,6 +23,7 @@ use WooCommerce\PayPalCommerce\WcGateway\Checkout\DisableGateways;
use WooCommerce\PayPalCommerce\WcGateway\Endpoint\ReturnUrlEndpoint;
use WooCommerce\PayPalCommerce\WcGateway\Gateway\CreditCardGateway;
use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
use WooCommerce\PayPalCommerce\WcGateway\Gateway\TransactionUrlProvider;
use Woocommerce\PayPalCommerce\WcGateway\Helper\DccProductStatus;
use WooCommerce\PayPalCommerce\WcGateway\Notice\AuthorizeOrderActionNotice;
use WooCommerce\PayPalCommerce\WcGateway\Notice\ConnectAdminNotice;
@ -32,7 +34,6 @@ use WooCommerce\PayPalCommerce\WcGateway\Settings\SectionsRenderer;
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
use WooCommerce\PayPalCommerce\WcGateway\Settings\SettingsListener;
use WooCommerce\PayPalCommerce\WcGateway\Settings\SettingsRenderer;
use WpOop\TransientCache\CachePoolFactory;
return array(
'wcgateway.paypal-gateway' => static function ( $container ): PayPalGateway {
@ -44,6 +45,7 @@ return array(
$session_handler = $container->get( 'session.handler' );
$refund_processor = $container->get( 'wcgateway.processor.refunds' );
$state = $container->get( 'onboarding.state' );
$transaction_url_provider = $container->get( 'wcgateway.transaction-url-provider' );
return new PayPalGateway(
$settings_renderer,
@ -53,7 +55,8 @@ return array(
$settings,
$session_handler,
$refund_processor,
$state
$state,
$transaction_url_provider
);
},
'wcgateway.credit-card-gateway' => static function ( $container ): CreditCardGateway {
@ -66,6 +69,7 @@ return array(
$session_handler = $container->get( 'session.handler' );
$refund_processor = $container->get( 'wcgateway.processor.refunds' );
$state = $container->get( 'onboarding.state' );
$transaction_url_provider = $container->get( 'wcgateway.transaction-url-provider' );
$payment_token_repository = $container->get( 'subscription.repository.payment-token' );
$purchase_unit_factory = $container->get( 'api.factory.purchase-unit' );
$payer_factory = $container->get( 'api.factory.payer' );
@ -80,6 +84,7 @@ return array(
$session_handler,
$refund_processor,
$state,
$transaction_url_provider,
$payment_token_repository,
$purchase_unit_factory,
$payer_factory,
@ -139,7 +144,10 @@ return array(
$order_factory = $container->get( 'api.factory.order' );
$threed_secure = $container->get( 'button.helper.three-d-secure' );
$authorized_payments_processor = $container->get( 'wcgateway.processor.authorized-payments' );
$settings = $container->get( 'wcgateway.settings' );
$settings = $container->get( 'wcgateway.settings' );
$environment = $container->get( 'onboarding.environment' );
$logger = $container->get( 'woocommerce.logger.woocommerce' );
return new OrderProcessor(
$session_handler,
$cart_repository,
@ -148,7 +156,9 @@ return array(
$order_factory,
$threed_secure,
$authorized_payments_processor,
$settings
$settings,
$logger,
$environment->current_environment_is( Environment::SANDBOX )
);
},
'wcgateway.processor.refunds' => static function ( $container ): RefundProcessor {
@ -648,6 +658,7 @@ return array(
'mybank' => _x( 'MyBank', 'Name of payment method', 'woocommerce-paypal-payments' ),
'p24' => _x( 'Przelewy24', 'Name of payment method', 'woocommerce-paypal-payments' ),
'sofort' => _x( 'Sofort', 'Name of payment method', 'woocommerce-paypal-payments' ),
'venmo' => _x( 'Venmo', 'Name of payment method', 'woocommerce-paypal-payments' ),
),
'screens' => array(
State::STATE_PROGRESSIVE,
@ -1847,6 +1858,28 @@ return array(
$fields['message_cart_heading']['description'] = __( 'Display pay later messaging on your site for offers like Pay in 3, which lets customers pay with 3 interest-free monthly payments. Well show messages on your site to promote this feature for you. You may not promote pay later offers with any other content, marketing, or materials.', 'woocommerce-paypal-payments' );
}
if ( 'FR' === $country ) {
// todo: replace this with the text in English and use this text for French translation when it will be created.
$french_pay_later_description = 'Affichez le Paiement en 4X PayPal sur votre site.' .
'Le Paiement en 4X PayPal permet aux consommateurs français de payer en 4 versements égaux.' .
'Vous pouvez promouvoir le Paiement en 4X PayPal uniquement si vous êtes un commerçant basé en France, ' .
'avec un site internet en français et uneintégration PayPal standard. ' .
'Les marchands ayantloutil Vaulting(coffre-fort numérique) ou une intégration de paiements récurrents/abonnement, ' .
'ainsi que ceux présentant certaines activités (vente de biens numériques / de biens non physiques) ' .
'ne sont pas éligibles pour promouvoir le Paiement en 4X PayPal.' .
'Nous afficherons des messages sur votre site pour promouvoir le Paiement en 4X PayPal. ' .
'Vous ne pouvez pas promouvoir le Paiement en 4X PayPal avec un autre contenu, quel quil soit.';
$fields['message_heading']['heading'] = __( 'Pay Later Messaging on Checkout', 'woocommerce-paypal-payments' );
$fields['message_heading']['description'] = $french_pay_later_description;
$fields['message_product_heading']['heading'] = __( 'Pay Later Messaging on Single Product Page', 'woocommerce-paypal-payments' );
$fields['message_product_heading']['description'] = $french_pay_later_description;
$fields['message_cart_heading']['heading'] = __( 'Pay Later Messaging on Cart', 'woocommerce-paypal-payments' );
$fields['message_cart_heading']['description'] = $french_pay_later_description;
}
/**
* Set Pay Later link for DE
*/
@ -1908,6 +1941,22 @@ return array(
$prefix
);
},
'wcgateway.transaction-url-sandbox' => static function ( $container ): string {
return 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_view-a-trans&id=%s';
},
'wcgateway.transaction-url-live' => static function ( $container ): string {
return 'https://www.paypal.com/cgi-bin/webscr?cmd=_view-a-trans&id=%s';
},
'wcgateway.transaction-url-provider' => static function ( $container ): TransactionUrlProvider {
$sandbox_url_base = $container->get( 'wcgateway.transaction-url-sandbox' );
$live_url_base = $container->get( 'wcgateway.transaction-url-live' );
return new TransactionUrlProvider( $sandbox_url_base, $live_url_base );
},
'wcgateway.helper.dcc-product-status' => static function ( $container ) : DccProductStatus {
$settings = $container->get( 'wcgateway.settings' );