Update transaction id after manual capture

This commit is contained in:
Alex P 2022-08-03 14:21:33 +03:00
parent f256134148
commit 878f271ae9
2 changed files with 20 additions and 8 deletions

View file

@ -31,7 +31,7 @@ use WooCommerce\PayPalCommerce\WcGateway\Notice\AuthorizeOrderActionNotice;
*/
class AuthorizedPaymentsProcessor {
use PaymentsStatusHandlingTrait;
use PaymentsStatusHandlingTrait, TransactionIdHandlingTrait;
const SUCCESSFUL = 'SUCCESSFUL';
const ALREADY_CAPTURED = 'ALREADY_CAPTURED';
@ -200,6 +200,9 @@ class AuthorizedPaymentsProcessor {
$this->handle_capture_status( $capture, $wc_order );
$transaction_id = $capture->id();
$this->update_transaction_id( $transaction_id, $wc_order );
if ( self::SUCCESSFUL === $result_status ) {
if ( $capture->status()->is( CaptureStatus::COMPLETED ) ) {
$wc_order->add_order_note(