mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 18:00:15 +08:00
Check for captured vault webhook order meta
This commit is contained in:
parent
572c62c74c
commit
465855d061
5 changed files with 24 additions and 10 deletions
|
@ -17,6 +17,7 @@ use WooCommerce\PayPalCommerce\ApiClient\Factory\OrderFactory;
|
|||
use WooCommerce\PayPalCommerce\Button\Helper\ThreeDSecure;
|
||||
use WooCommerce\PayPalCommerce\Onboarding\Environment;
|
||||
use WooCommerce\PayPalCommerce\Session\SessionHandler;
|
||||
use WooCommerce\PayPalCommerce\Subscription\Helper\SubscriptionHelper;
|
||||
use WooCommerce\PayPalCommerce\Vaulting\PaymentTokenRepository;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
|
||||
|
@ -98,6 +99,11 @@ class OrderProcessor {
|
|||
*/
|
||||
private $logger;
|
||||
|
||||
/**
|
||||
* @var SubscriptionHelper
|
||||
*/
|
||||
private $subscription_helper;
|
||||
|
||||
/**
|
||||
* OrderProcessor constructor.
|
||||
*
|
||||
|
@ -118,7 +124,8 @@ class OrderProcessor {
|
|||
AuthorizedPaymentsProcessor $authorized_payments_processor,
|
||||
Settings $settings,
|
||||
LoggerInterface $logger,
|
||||
Environment $environment
|
||||
Environment $environment,
|
||||
SubscriptionHelper $subscription_helper
|
||||
) {
|
||||
|
||||
$this->session_handler = $session_handler;
|
||||
|
@ -129,6 +136,7 @@ class OrderProcessor {
|
|||
$this->settings = $settings;
|
||||
$this->environment = $environment;
|
||||
$this->logger = $logger;
|
||||
$this->subscription_helper = $subscription_helper;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -172,6 +180,10 @@ class OrderProcessor {
|
|||
$order = $this->order_endpoint->authorize( $order );
|
||||
|
||||
$wc_order->update_meta_data( AuthorizedPaymentsProcessor::CAPTURED_META_KEY, 'false' );
|
||||
|
||||
if($this->subscription_helper->has_subscription( $wc_order->get_id() )) {
|
||||
$wc_order->update_meta_data('_ppcp_captured_vault_webhook', 'false');
|
||||
}
|
||||
}
|
||||
|
||||
$transaction_id = $this->get_paypal_order_transaction_id( $order );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue