Merge branch 'trunk' into PCP-1393-update-to-vault-v-3

# Conflicts:
#	modules/ppcp-api-client/services.php
#	modules/ppcp-wc-gateway/src/Processor/OrderProcessor.php
#	tests/PHPUnit/WcGateway/Processor/OrderProcessorTest.php
This commit is contained in:
Pedro Silva 2023-11-24 11:20:15 +00:00
commit fb1ceeba76
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
27 changed files with 658 additions and 231 deletions

View file

@ -15,6 +15,7 @@ use WC_Session_Handler;
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint;
use WooCommerce\PayPalCommerce\ApiClient\Entity\OrderStatus;
use Psr\Log\LoggerInterface;
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
use WooCommerce\PayPalCommerce\Session\MemoryWcSession;
use WooCommerce\PayPalCommerce\Session\SessionHandler;
use WooCommerce\PayPalCommerce\WcGateway\FundingSource\FundingSourceRenderer;
@ -228,12 +229,14 @@ class CheckoutOrderApproved implements RequestHandler {
continue;
}
if ( ! $this->order_processor->process( $wc_order ) ) {
try {
$this->order_processor->process( $wc_order );
} catch ( RuntimeException $exception ) {
return $this->failure_response(
sprintf(
'Failed to process WC order %s: %s.',
(string) $wc_order->get_id(),
$this->order_processor->last_error()
$exception->getMessage()
)
);
}