Merge branch 'trunk' into PCP-2521-apple-pay-recurring-payments

This commit is contained in:
Pedro Silva 2024-01-30 17:53:38 +00:00
commit 6c0e0a96dc
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
18 changed files with 230 additions and 60 deletions

View file

@ -1,6 +1,17 @@
*** Changelog ***
= 2.5.0 - xxxx-xx-xx =
= 2.5.2 - xxxx-xx-xx =
* Fix - NOT_ENABLED_TO_VAULT_PAYMENT_SOURCE error for merchants without reference transactions #1984
* Fix - Fatal error in WooCommerce PayPal Payments plugin after 2.5.0 update #1985
* Fix - Can not refund order purchased with Vault v3 Card payment #1997
* Fix - PayPal Vaulting Subscriptions mode setting visible when merchant not enabled for Reference Transactions #1999
* Enhancement - Add setup URL for reference transactions #1964
* Enhancement - Improve PUI performance for variable products #1950
= 2.5.1 - 2024-01-24 =
* Temporary revert Vaulting integration changes introduced in 2.5.0
= 2.5.0 - 2024-01-22 =
* Fix - WC Subscriptions change subscription payment #1953
* Fix - GooglePay and ApplePay buttons disappear from the minicart when adding a product to the cart on the shop page #1915
* Enhancement - Enable Vault v3 and Card Fields by default for US merchants #1967
@ -142,7 +153,7 @@
* Feature preview - Google Pay integration #1654
= 2.2.2 - 2023-08-29 =
* Fix - High rate of auth voids on vaulted subscriptions for guest users #1529
* Fix - High rate of auth voids on vaulted subscriptions for guest users #1529
* Enhancement - HPOS compatibility issues #1594
* Feature preview - PayPal Subscriptions API fixes and improvements #1600 #1607

View file

@ -71,7 +71,7 @@ return array(
// Connection tab fields.
$fields = $insert_after(
$fields,
'ppcp_dcc_status',
'ppcp_reference_transactions_status',
array(
'applepay_status' => array(
'title' => __( 'Apple Pay Payments', 'woocommerce-paypal-payments' ),

View file

@ -42,7 +42,7 @@ return array(
// Connection tab fields.
$fields = $insert_after(
$fields,
'ppcp_dcc_status',
'ppcp_reference_transactions_status',
array(
'googlepay_status' => array(
'title' => __( 'Google Pay Payments', 'woocommerce-paypal-payments' ),

View file

@ -12,6 +12,7 @@ namespace WooCommerce\PayPalCommerce\SavePaymentMethods;
use Psr\Log\LoggerInterface;
use WC_Order;
use WooCommerce\PayPalCommerce\ApiClient\Authentication\UserIdToken;
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\BillingAgreementsEndpoint;
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\PaymentTokensEndpoint;
use WooCommerce\PayPalCommerce\ApiClient\Entity\Order;
use WooCommerce\PayPalCommerce\ApiClient\Entity\PaymentSource;
@ -55,6 +56,30 @@ class SavePaymentMethodsModule implements ModuleInterface {
return;
}
$settings = $c->get( 'wcgateway.settings' );
assert( $settings instanceof Settings );
$billing_agreements_endpoint = $c->get( 'api.endpoint.billing-agreements' );
assert( $billing_agreements_endpoint instanceof BillingAgreementsEndpoint );
add_action(
'woocommerce_paypal_payments_gateway_migrate_on_update',
function() use ( $settings, $billing_agreements_endpoint ) {
$reference_transaction_enabled = $billing_agreements_endpoint->reference_transaction_enabled();
if ( $reference_transaction_enabled !== true ) {
$settings->set( 'vault_enabled', false );
$settings->persist();
}
}
);
if (
( ! $settings->has( 'vault_enabled' ) || ! $settings->get( 'vault_enabled' ) )
&& ( ! $settings->has( 'vault_enabled_dcc' ) || ! $settings->get( 'vault_enabled_dcc' ) )
) {
return;
}
add_filter(
'woocommerce_paypal_payments_localized_script_data',
function( array $localized_script_data ) use ( $c ) {
@ -78,8 +103,12 @@ class SavePaymentMethodsModule implements ModuleInterface {
// Adds attributes needed to save payment method.
add_filter(
'ppcp_create_order_request_body_data',
function( array $data, string $payment_method, array $request_data ): array {
function( array $data, string $payment_method, array $request_data ) use ( $settings ): array {
if ( $payment_method === CreditCardGateway::ID ) {
if ( ! $settings->has( 'vault_enabled_dcc' ) || ! $settings->get( 'vault_enabled_dcc' ) ) {
return $data;
}
$save_payment_method = $request_data['save_payment_method'] ?? false;
if ( $save_payment_method ) {
$data['payment_source'] = array(
@ -106,6 +135,10 @@ class SavePaymentMethodsModule implements ModuleInterface {
}
if ( $payment_method === PayPalGateway::ID ) {
if ( ! $settings->has( 'vault_enabled' ) || ! $settings->get( 'vault_enabled' ) ) {
return $data;
}
$funding_source = $request_data['funding_source'] ?? null;
if ( $funding_source && $funding_source === 'venmo' ) {

View file

@ -237,8 +237,18 @@ class VaultingModule implements ModuleInterface {
add_filter(
'woocommerce_available_payment_gateways',
function( array $methods ): array {
/**
* Param types removed to avoid third-party issues.
*
* @psalm-suppress MissingClosureParamType
*/
function( $methods ) {
global $wp;
if ( ! is_array( $methods ) ) {
return $methods;
}
if (
isset( $wp->query_vars['add-payment-method'] )
&& apply_filters( 'woocommerce_paypal_payments_disable_add_payment_method', true )

View file

@ -11,6 +11,7 @@ declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\WcGateway;
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\BillingAgreementsEndpoint;
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\PayUponInvoiceOrderEndpoint;
use WooCommerce\PayPalCommerce\ApiClient\Entity\ApplicationContext;
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
@ -332,6 +333,7 @@ return array(
$container->get( 'http.redirector' ),
$container->get( 'api.partner_merchant_id-production' ),
$container->get( 'api.partner_merchant_id-sandbox' ),
$container->get( 'api.endpoint.billing-agreements' ),
$logger
);
},
@ -367,8 +369,9 @@ return array(
$order_endpoint = $container->get( 'api.endpoint.order' );
$payments_endpoint = $container->get( 'api.endpoint.payments' );
$refund_fees_updater = $container->get( 'wcgateway.helper.refund-fees-updater' );
$prefix = $container->get( 'api.prefix' );
$logger = $container->get( 'woocommerce.logger.woocommerce' );
return new RefundProcessor( $order_endpoint, $payments_endpoint, $refund_fees_updater, $logger );
return new RefundProcessor( $order_endpoint, $payments_endpoint, $refund_fees_updater, $prefix, $logger );
},
'wcgateway.processor.authorized-payments' => static function ( ContainerInterface $container ): AuthorizedPaymentsProcessor {
$order_endpoint = $container->get( 'api.endpoint.order' );
@ -418,6 +421,18 @@ return array(
},
'wcgateway.settings.fields.subscriptions_mode' => static function ( ContainerInterface $container ): array {
$subscription_mode_options = array(
'vaulting_api' => __( 'PayPal Vaulting', 'woocommerce-paypal-payments' ),
'subscriptions_api' => __( 'PayPal Subscriptions', 'woocommerce-paypal-payments' ),
'disable_paypal_subscriptions' => __( 'Disable PayPal for subscriptions', 'woocommerce-paypal-payments' ),
);
$billing_agreements_endpoint = $container->get( 'api.endpoint.billing-agreements' );
$reference_transaction_enabled = $billing_agreements_endpoint->reference_transaction_enabled();
if ( $reference_transaction_enabled !== true ) {
unset( $subscription_mode_options['vaulting_api'] );
}
return array(
'title' => __( 'Subscriptions Mode', 'woocommerce-paypal-payments' ),
'type' => 'select',
@ -426,11 +441,7 @@ return array(
'desc_tip' => true,
'description' => __( 'Utilize PayPal Vaulting for flexible subscription processing with saved payment methods, create “PayPal Subscriptions” to bill customers at regular intervals, or disable PayPal for subscription-type products.', 'woocommerce-paypal-payments' ),
'default' => 'vaulting_api',
'options' => array(
'vaulting_api' => __( 'PayPal Vaulting', 'woocommerce-paypal-payments' ),
'subscriptions_api' => __( 'PayPal Subscriptions', 'woocommerce-paypal-payments' ),
'disable_paypal_subscriptions' => __( 'Disable PayPal for subscriptions', 'woocommerce-paypal-payments' ),
),
'options' => $subscription_mode_options,
'screens' => array(
State::STATE_ONBOARDED,
),
@ -1315,6 +1326,12 @@ return array(
'wcgateway.enable-pui-url-live' => static function ( ContainerInterface $container ): string {
return 'https://www.paypal.com/bizsignup/entry?country.x=DE&product=payment_methods&capabilities=PAY_UPON_INVOICE';
},
'wcgateway.enable-reference-transactions-url-sandbox' => static function ( ContainerInterface $container ): string {
return 'https://www.sandbox.paypal.com/bizsignup/entry?product=ADVANCED_VAULTING';
},
'wcgateway.enable-reference-transactions-url-live' => static function ( ContainerInterface $container ): string {
return 'https://www.paypal.com/bizsignup/entry?product=ADVANCED_VAULTING';
},
'wcgateway.settings.connection.dcc-status-text' => static function ( ContainerInterface $container ): string {
$state = $container->get( 'onboarding.state' );
if ( $state->current_state() < State::STATE_ONBOARDED ) {
@ -1353,6 +1370,39 @@ return array(
esc_html( $dcc_button_text )
);
},
'wcgateway.settings.connection.reference-transactions-status-text' => static function ( ContainerInterface $container ): string {
$environment = $container->get( 'onboarding.environment' );
assert( $environment instanceof Environment );
$billing_agreements_endpoint = $container->get( 'api.endpoint.billing-agreements' );
assert( $billing_agreements_endpoint instanceof BillingAgreementsEndpoint );
$enabled = $billing_agreements_endpoint->reference_transaction_enabled();
$enabled_status_text = esc_html__( 'Status: Available', 'woocommerce-paypal-payments' );
$disabled_status_text = esc_html__( 'Status: Not yet enabled', 'woocommerce-paypal-payments' );
$button_text = $enabled
? esc_html__( 'Settings', 'woocommerce-paypal-payments' )
: esc_html__( 'Enable Advanced PayPal Wallet', 'woocommerce-paypal-payments' );
$enable_url = $environment->current_environment_is( Environment::PRODUCTION )
? $container->get( 'wcgateway.enable-reference-transactions-url-live' )
: $container->get( 'wcgateway.enable-reference-transactions-url-sandbox' );
$button_url = $enabled
? admin_url( 'admin.php?page=wc-settings&tab=checkout&section=ppcp-gateway#field-paypal_saved_payments' )
: $enable_url;
return sprintf(
'<p>%1$s %2$s</p><p><a target="%3$s" href="%4$s" class="button">%5$s</a></p>',
$enabled ? $enabled_status_text : $disabled_status_text,
$enabled ? '<span class="dashicons dashicons-yes"></span>' : '<span class="dashicons dashicons-no"></span>',
$enabled ? '_self' : '_blank',
esc_url( $button_url ),
esc_html( $button_text )
);
},
'wcgateway.settings.connection.pui-status-text' => static function ( ContainerInterface $container ): string {
$state = $container->get( 'onboarding.state' );
if ( $state->current_state() < State::STATE_ONBOARDED ) {

View file

@ -369,6 +369,9 @@ class CreditCardGateway extends \WC_Payment_Gateway_CC {
$saved_payment_card = WC()->session->get( 'ppcp_saved_payment_card' );
if ( $saved_payment_card ) {
if ( $saved_payment_card['payment_source'] === 'card' && $saved_payment_card['status'] === 'COMPLETED' ) {
$wc_order->update_meta_data( PayPalGateway::ORDER_ID_META_KEY, $saved_payment_card['order_id'] );
$wc_order->save_meta_data();
$this->update_transaction_id( $saved_payment_card['order_id'], $wc_order );
$wc_order->payment_complete();
WC()->session->set( 'ppcp_saved_payment_card', null );

View file

@ -91,24 +91,14 @@ class CheckoutHelper {
/**
* Ensures product is neither downloadable nor virtual.
*
* @param WC_Product $product WC product.
* @param WC_Product $product WC product (can be a variation).
* @return bool
*/
public function is_physical_product( WC_Product $product ):bool {
public function is_physical_product( WC_Product $product ): bool {
if ( $product->is_downloadable() || $product->is_virtual() ) {
return false;
}
if ( is_a( $product, WC_Product_Variable::class ) ) {
foreach ( $product->get_available_variations( 'object' ) as $variation ) {
if ( is_a( $variation, WC_Product_Variation::class ) ) {
if ( true === $variation->is_downloadable() || true === $variation->is_virtual() ) {
return false;
}
}
}
}
return true;
}
}

View file

@ -98,7 +98,11 @@ class PayUponInvoiceHelper {
if ( $cart && ! is_checkout_pay_page() ) {
$items = $cart->get_cart_contents();
foreach ( $items as $item ) {
$product = wc_get_product( $item['product_id'] );
$product_id = $item['product_id'];
if ( isset( $item['variation_id'] ) && $item['variation_id'] ) {
$product_id = $item['variation_id'];
}
$product = wc_get_product( $product_id );
if ( $product && ! $this->checkout_helper->is_physical_product( $product ) ) {
return false;
}

View file

@ -56,6 +56,13 @@ class RefundProcessor {
*/
private $logger;
/**
* The prefix.
*
* @var string
*/
private $prefix;
/**
* The refund fees updater.
*
@ -69,13 +76,21 @@ class RefundProcessor {
* @param OrderEndpoint $order_endpoint The order endpoint.
* @param PaymentsEndpoint $payments_endpoint The payments endpoint.
* @param RefundFeesUpdater $refund_fees_updater The refund fees updater.
* @param string $prefix The prefix.
* @param LoggerInterface $logger The logger.
*/
public function __construct( OrderEndpoint $order_endpoint, PaymentsEndpoint $payments_endpoint, RefundFeesUpdater $refund_fees_updater, LoggerInterface $logger ) {
public function __construct(
OrderEndpoint $order_endpoint,
PaymentsEndpoint $payments_endpoint,
RefundFeesUpdater $refund_fees_updater,
string $prefix,
LoggerInterface $logger
) {
$this->order_endpoint = $order_endpoint;
$this->payments_endpoint = $payments_endpoint;
$this->refund_fees_updater = $refund_fees_updater;
$this->prefix = $prefix;
$this->logger = $logger;
}
@ -164,7 +179,7 @@ class RefundProcessor {
$capture = $captures[0];
$refund = new RefundCapture(
$capture,
$capture->invoice_id(),
$capture->invoice_id() ?: $this->prefix . $wc_order->get_order_number(),
$reason,
new Amount(
new Money( $amount, $wc_order->get_currency() )

View file

@ -410,6 +410,16 @@ return function ( ContainerInterface $container, array $fields ): array {
'requirements' => array( 'dcc' ),
'gateway' => Settings::CONNECTION_TAB_ID,
),
'ppcp_reference_transactions_status' => array(
'title' => __( 'Advanced PayPal Wallet', 'woocommerce-paypal-payments' ),
'type' => 'ppcp-text',
'text' => $container->get( 'wcgateway.settings.connection.reference-transactions-status-text' ),
'screens' => array(
State::STATE_ONBOARDED,
),
'requirements' => array( 'dcc' ),
'gateway' => Settings::CONNECTION_TAB_ID,
),
'ppcp_pui_status' => array(
'title' => __( 'Pay upon Invoice', 'woocommerce-paypal-payments' ),
'type' => 'ppcp-text',

View file

@ -14,6 +14,7 @@ use WooCommerce\PayPalCommerce\AdminNotices\Entity\Message;
use WooCommerce\PayPalCommerce\AdminNotices\Repository\Repository;
use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer;
use WooCommerce\PayPalCommerce\ApiClient\Authentication\PayPalBearer;
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\BillingAgreementsEndpoint;
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache;
use WooCommerce\PayPalCommerce\Http\RedirectorInterface;
@ -152,6 +153,13 @@ class SettingsListener {
*/
private $partner_merchant_id_sandbox;
/**
* Billing Agreements endpoint.
*
* @var BillingAgreementsEndpoint
*/
private $billing_agreements_endpoint;
/**
* The logger.
*
@ -162,21 +170,22 @@ class SettingsListener {
/**
* SettingsListener constructor.
*
* @param Settings $settings The settings.
* @param array $setting_fields The setting fields.
* @param WebhookRegistrar $webhook_registrar The Webhook Registrar.
* @param Cache $cache The Cache.
* @param State $state The state.
* @param Bearer $bearer The bearer.
* @param string $page_id ID of the current PPCP gateway settings page, or empty if it is not such page.
* @param Cache $signup_link_cache The signup link cache.
* @param array $signup_link_ids Signup link ids.
* @param Cache $pui_status_cache The PUI status cache.
* @param Cache $dcc_status_cache The DCC status cache.
* @param RedirectorInterface $redirector The HTTP redirector.
* @param string $partner_merchant_id_production Partner merchant ID production.
* @param string $partner_merchant_id_sandbox Partner merchant ID sandbox.
* @param ?LoggerInterface $logger The logger.
* @param Settings $settings The settings.
* @param array $setting_fields The setting fields.
* @param WebhookRegistrar $webhook_registrar The Webhook Registrar.
* @param Cache $cache The Cache.
* @param State $state The state.
* @param Bearer $bearer The bearer.
* @param string $page_id ID of the current PPCP gateway settings page, or empty if it is not such page.
* @param Cache $signup_link_cache The signup link cache.
* @param array $signup_link_ids Signup link ids.
* @param Cache $pui_status_cache The PUI status cache.
* @param Cache $dcc_status_cache The DCC status cache.
* @param RedirectorInterface $redirector The HTTP redirector.
* @param string $partner_merchant_id_production Partner merchant ID production.
* @param string $partner_merchant_id_sandbox Partner merchant ID sandbox.
* @param BillingAgreementsEndpoint $billing_agreements_endpoint Billing Agreements endpoint.
* @param ?LoggerInterface $logger The logger.
*/
public function __construct(
Settings $settings,
@ -193,6 +202,7 @@ class SettingsListener {
RedirectorInterface $redirector,
string $partner_merchant_id_production,
string $partner_merchant_id_sandbox,
BillingAgreementsEndpoint $billing_agreements_endpoint,
LoggerInterface $logger = null
) {
@ -210,6 +220,7 @@ class SettingsListener {
$this->redirector = $redirector;
$this->partner_merchant_id_production = $partner_merchant_id_production;
$this->partner_merchant_id_sandbox = $partner_merchant_id_sandbox;
$this->billing_agreements_endpoint = $billing_agreements_endpoint;
$this->logger = $logger ?: new NullLogger();
}
@ -367,7 +378,9 @@ class SettingsListener {
$vault_enabled = wc_clean( wp_unslash( $_POST['ppcp']['vault_enabled'] ?? '' ) );
$subscription_mode = wc_clean( wp_unslash( $_POST['ppcp']['subscriptions_mode'] ?? '' ) );
if ( $subscription_mode === 'vaulting_api' && $vault_enabled !== '1' ) {
$reference_transaction_enabled = $this->billing_agreements_endpoint->reference_transaction_enabled();
if ( $subscription_mode === 'vaulting_api' && $vault_enabled !== '1' && $reference_transaction_enabled === true ) {
$this->settings->set( 'vault_enabled', true );
$this->settings->persist();
}

View file

@ -435,15 +435,21 @@ class WCGatewayModule implements ModuleInterface {
add_action(
'woocommerce_paypal_payments_clear_apm_product_status',
function( Settings $settings = null ) use ( $c ): void {
// Clear DCC Product status.
$dcc_product_status = $c->get( 'wcgateway.helper.dcc-product-status' );
if ( $dcc_product_status instanceof DCCProductStatus ) {
$dcc_product_status->clear( $settings );
}
// Clear Pay Upon Invoice status.
$pui_product_status = $c->get( 'wcgateway.pay-upon-invoice-product-status' );
if ( $pui_product_status instanceof PayUponInvoiceProductStatus ) {
$pui_product_status->clear( $settings );
}
// Clear Reference Transaction status.
delete_transient( 'ppcp_reference_transaction_enabled' );
}
);
}

View file

@ -158,7 +158,16 @@ class WcSubscriptionsModule implements ModuleInterface {
add_filter(
'woocommerce_available_payment_gateways',
function( array $methods ) use ( $c ) : array {
/**
* Param types removed to avoid third-party issues.
*
* @psalm-suppress MissingClosureParamType
*/
function( $methods ) use ( $c ) {
if ( ! is_array( $methods ) ) {
return $methods;
}
if ( ! is_wc_endpoint_url( 'order-pay' ) ) {
return $methods;
}

View file

@ -1,6 +1,6 @@
{
"name": "woocommerce-paypal-payments",
"version": "2.5.0",
"version": "2.5.2",
"description": "WooCommerce PayPal Payments",
"repository": "https://github.com/woocommerce/woocommerce-paypal-payments",
"license": "GPL-2.0",

View file

@ -4,7 +4,7 @@ Tags: woocommerce, paypal, payments, ecommerce, checkout, cart, pay later, apple
Requires at least: 5.3
Tested up to: 6.4
Requires PHP: 7.2
Stable tag: 2.5.0
Stable tag: 2.5.2
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@ -52,16 +52,16 @@ With the [Vaulting](https://www.paypal.com/us/brc/article/securely-store-payment
Its easy for shoppers, simple for you, and great for your business with no monthly or setup fees.
= Activate PayPal =
Are you new to PayPal? [Learn how to add it to your store.](https://woocommerce.com/document/woocommerce-paypal-payments/)
Are you new to PayPal? [Learn how to add it to your store.](https://woocommerce.com/document/woocommerce-paypal-payments/)
Need to update your existing PayPal integration? [Learn how to upgrade your integration.](https://woocommerce.com/document/woocommerce-paypal-payments/paypal-payments-upgrade-guide/)
[Watch the video on how to activate PayPal for your WooCommerce store](https://woocommerce.com/document/woocommerce-paypal-payments/#complete-setup-video)
= More reasons it pays to PayPal =
- **Instant access to funds**: Access card payments, send money or make a payment from your bank account. Youre credited immediately while the payment is processing. Funds settle instantly into your PayPal business account.
- **Fraud Detection**: Save time and money by letting PayPal help you handle the risk of fraudulent transactions with our fraud, chargeback, and Seller Protection capabilities (on eligible transactions†). Our AI technology works hard to monitor all of your transactions — so you can focus on what matters most. †Available on eligible purchases. Limits apply.
- **Global compliance**: PayPal payment solutions help you meet your global compliance standards, such as PCI and PSD2, bringing international markets within reach for your business. Our platform has built-in compliance with two-factor authentication provided by cards (3D Secure). We include automatic updates as security protocols change.
---
@ -80,17 +80,17 @@ Need to update your existing PayPal integration? [Learn how to upgrade your inte
= Where can I find the WooCommerce PayPal Payments documentation and setup guide? =
For help setting up and configuring WooCommerce PayPal Payments, please refer to the documentation. [Learn how to add PayPal to your store.](https://woocommerce.com/document/woocommerce-paypal-payments/)
For help setting up and configuring WooCommerce PayPal Payments, please refer to the documentation. [Learn how to add PayPal to your store.](https://woocommerce.com/document/woocommerce-paypal-payments/)
Need to update your existing PayPal integration? [Learn how to upgrade your integration.](https://woocommerce.com/document/woocommerce-paypal-payments/paypal-payments-upgrade-guide/)
= Where can I get help for WooCommerce PayPal Payments? =
For questions regarding the plugin setup, we recommend reviewing our [documentation](https://woocommerce.com/document/woocommerce-paypal-payments/) and the [troubleshooting guide](https://woocommerce.com/document/woocommerce-paypal-payments/#troubleshooting) if you encounter any issues.
If the question or problem persists after reviewing the documentation, kindly create a new thread in the [support forums](https://wordpress.org/support/plugin/woocommerce-paypal-payments/#new-topic-0) or open a support ticket via [our helpdesk](https://woocommerce.com/document/woocommerce-paypal-payments/#get-help).
For questions regarding the plugin setup, we recommend reviewing our [documentation](https://woocommerce.com/document/woocommerce-paypal-payments/) and the [troubleshooting guide](https://woocommerce.com/document/woocommerce-paypal-payments/#troubleshooting) if you encounter any issues.
If the question or problem persists after reviewing the documentation, kindly create a new thread in the [support forums](https://wordpress.org/support/plugin/woocommerce-paypal-payments/#new-topic-0) or open a support ticket via [our helpdesk](https://woocommerce.com/document/woocommerce-paypal-payments/#get-help).
= WooCommerce PayPal Payments suddenly no longer works what do I do? =
Start by diagnosing the issue using our helpful [troubleshooting guide](https://woocommerce.com/document/woocommerce-paypal-payments/#troubleshooting).
Start by diagnosing the issue using our helpful [troubleshooting guide](https://woocommerce.com/document/woocommerce-paypal-payments/#troubleshooting).
If you notice an error or any other issue after updating a plugin or the theme, there could be a potential compatibility issue between it and WooCommerce PayPal Payments.
In such cases, we recommend running a [conflict test](https://github.com/woocommerce/woocommerce-paypal-payments/wiki/Advanced-Troubleshooting) using [Health Check](https://github.com/woocommerce/woocommerce-paypal-payments/wiki/Advanced-Troubleshooting#test-on-staging) (which allows you to disable themes and plugins without affecting your visitors) or troubleshooting the issue using a [staging site](https://github.com/woocommerce/woocommerce-paypal-payments/wiki/Advanced-Troubleshooting#test-on-staging).
@ -123,7 +123,7 @@ View the [Testing features previews FAQ](https://github.com/woocommerce/woocomme
= WooCommerce PayPal Payments is awesome! Can I contribute? =
Yes, you can! Contributions are always appreciated. Join in on our [GitHub repository](https://github.com/woocommerce/woocommerce-paypal-payments/issues) to stay up-to-date with the latest developments.
If you like the plugin, please also consider leaving a review [here](https://wordpress.org/support/plugin/woocommerce-paypal-payments/reviews/#new-post) or [here](https://woocommerce.com/de-de/products/woocommerce-paypal-payments/#reviews) to share your valuable feedback with other users as it is much appreciated.
If you like the plugin, please also consider leaving a review [here](https://wordpress.org/support/plugin/woocommerce-paypal-payments/reviews/#new-post) or [here](https://woocommerce.com/de-de/products/woocommerce-paypal-payments/#reviews) to share your valuable feedback with other users as it is much appreciated.
= My question is not listed here. Where can I find more answers? =
@ -179,7 +179,18 @@ If you encounter issues with the PayPal buttons not appearing after an update, p
== Changelog ==
= 2.5.0 - xxxx-xx-xx =
= 2.5.2 - xxxx-xx-xx =
* Fix - NOT_ENABLED_TO_VAULT_PAYMENT_SOURCE error for merchants without reference transactions #1984
* Fix - Fatal error in WooCommerce PayPal Payments plugin after 2.5.0 update #1985
* Fix - Can not refund order purchased with Vault v3 Card payment #1997
* Fix - PayPal Vaulting Subscriptions mode setting visible when merchant not enabled for Reference Transactions #1999
* Enhancement - Add setup URL for reference transactions #1964
* Enhancement - Improve PUI performance for variable products #1950
= 2.5.1 - 2024-01-24 =
* Temporary revert Vaulting integration changes introduced in 2.5.0
= 2.5.0 - 2024-01-22 =
* Fix - WC Subscriptions change subscription payment #1953
* Fix - GooglePay and ApplePay buttons disappear from the minicart when adding a product to the cart on the shop page #1915
* Enhancement - Enable Vault v3 and Card Fields by default for US merchants #1967
@ -321,7 +332,7 @@ If you encounter issues with the PayPal buttons not appearing after an update, p
* Feature preview - Google Pay integration #1654
= 2.2.2 - 2023-08-29 =
* Fix - High rate of auth voids on vaulted subscriptions for guest users #1529
* Fix - High rate of auth voids on vaulted subscriptions for guest users #1529
* Enhancement - HPOS compatibility issues #1594
* Feature preview - PayPal Subscriptions API fixes and improvements #1600 #1607

View file

@ -2,8 +2,10 @@
namespace WooCommerce\PayPalCommerce\WcGateway\Settings;
use Psr\Log\LoggerInterface;
use Requests_Utility_CaseInsensitiveDictionary;
use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer;
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\BillingAgreementsEndpoint;
use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache;
use WooCommerce\PayPalCommerce\Helper\RedirectorStub;
use WooCommerce\PayPalCommerce\Helper\StubRedirectionException;
@ -12,7 +14,6 @@ use WooCommerce\PayPalCommerce\Onboarding\State;
use Mockery;
use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
use WooCommerce\PayPalCommerce\Webhooks\WebhookRegistrar;
use function Brain\Monkey\Functions\expect;
use function Brain\Monkey\Functions\when;
class SettingsListenerTest extends ModularTestCase
@ -40,6 +41,8 @@ class SettingsListenerTest extends ModularTestCase
$signup_link_ids = array();
$pui_status_cache = Mockery::mock(Cache::class);
$dcc_status_cache = Mockery::mock(Cache::class);
$billing_agreement_endpoint = Mockery::mock(BillingAgreementsEndpoint::class);
$logger = Mockery::mock(LoggerInterface::class);
$testee = new SettingsListener(
$settings,
@ -55,7 +58,9 @@ class SettingsListenerTest extends ModularTestCase
$dcc_status_cache,
new RedirectorStub(),
'',
''
'',
$billing_agreement_endpoint,
$logger
);
$_GET['section'] = PayPalGateway::ID;

View file

@ -3,7 +3,7 @@
* Plugin Name: WooCommerce PayPal Payments
* Plugin URI: https://woocommerce.com/products/woocommerce-paypal-payments/
* Description: PayPal's latest complete payments processing solution. Accept PayPal, Pay Later, credit/debit cards, alternative digital wallets local payment types and bank accounts. Turn on only PayPal options or process a full suite of payment methods. Enable global transaction with extensive currency and country coverage.
* Version: 2.5.0
* Version: 2.5.2
* Author: WooCommerce
* Author URI: https://woocommerce.com/
* License: GPL-2.0
@ -25,7 +25,7 @@ define( 'PAYPAL_API_URL', 'https://api-m.paypal.com' );
define( 'PAYPAL_URL', 'https://www.paypal.com' );
define( 'PAYPAL_SANDBOX_API_URL', 'https://api-m.sandbox.paypal.com' );
define( 'PAYPAL_SANDBOX_URL', 'https://www.sandbox.paypal.com' );
define( 'PAYPAL_INTEGRATION_DATE', '2024-01-12' );
define( 'PAYPAL_INTEGRATION_DATE', '2024-01-25' );
! defined( 'CONNECT_WOO_CLIENT_ID' ) && define( 'CONNECT_WOO_CLIENT_ID', 'AcCAsWta_JTL__OfpjspNyH7c1GGHH332fLwonA5CwX4Y10mhybRZmHLA0GdRbwKwjQIhpDQy0pluX_P' );
! defined( 'CONNECT_WOO_SANDBOX_CLIENT_ID' ) && define( 'CONNECT_WOO_SANDBOX_CLIENT_ID', 'AYmOHbt1VHg-OZ_oihPdzKEVbU3qg0qXonBcAztuzniQRaKE0w1Hr762cSFwd4n8wxOl-TCWohEa0XM_' );