Merge branch 'PCP-1744-google-pay-integration' into wip/apple-google-combined

# Conflicts:
#	modules.php
This commit is contained in:
Pedro Silva 2023-09-11 10:50:34 +01:00
commit 2e7f9b46b0
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
36 changed files with 4240 additions and 7 deletions

View file

@ -703,7 +703,6 @@ return array(
'requirements' => array(),
'gateway' => 'paypal',
),
'disable_cards' => array(
'title' => __( 'Disable specific credit cards', 'woocommerce-paypal-payments' ),
'type' => 'ppcp-multiselect',
@ -950,6 +949,13 @@ return array(
'paylater' => _x( 'Pay Later', 'Name of payment method', 'woocommerce-paypal-payments' ),
);
},
'wcgateway.extra-funding-sources' => static function( ContainerInterface $container ): array {
return array(
'googlepay' => _x( 'Google Pay', 'Name of payment method', 'woocommerce-paypal-payments' ),
);
},
/**
* The sources that do not cause issues about redirecting (on mobile, ...) and sometimes not returning back.
*/
@ -1051,7 +1057,10 @@ return array(
'wcgateway.funding-source.renderer' => function ( ContainerInterface $container ) : FundingSourceRenderer {
return new FundingSourceRenderer(
$container->get( 'wcgateway.settings' ),
$container->get( 'wcgateway.all-funding-sources' )
array_merge(
$container->get( 'wcgateway.all-funding-sources' ),
$container->get( 'wcgateway.extra-funding-sources' )
)
);
},

View file

@ -391,6 +391,7 @@ class SettingsListener {
if ( self::CREDENTIALS_UNCHANGED !== $credentials_change_status ) {
$this->settings->set( 'products_dcc_enabled', null );
$this->settings->set( 'products_pui_enabled', null );
do_action( 'woocommerce_paypal_payments_clear_apm_product_status', $this->settings );
}
if ( in_array(

View file

@ -288,6 +288,7 @@ class WCGatewayModule implements ModuleInterface {
$settings->set( 'products_dcc_enabled', false );
$settings->set( 'products_pui_enabled', false );
$settings->persist();
do_action( 'woocommerce_paypal_payments_clear_apm_product_status', $settings );
// Update caches.
$dcc_status = $c->get( 'wcgateway.helper.dcc-product-status' );