mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
Save wc order after setting transaction id
This commit is contained in:
parent
c8819086d8
commit
e83db4a103
2 changed files with 3 additions and 2 deletions
|
@ -177,7 +177,7 @@ class OrderProcessor {
|
|||
$transaction_id = $this->get_paypal_order_transaction_id( $order );
|
||||
|
||||
if ( $transaction_id ) {
|
||||
$this->set_order_transaction_id( $transaction_id, $wc_order );
|
||||
$this->update_transaction_id( $transaction_id, $wc_order );
|
||||
}
|
||||
|
||||
$this->handle_new_order_status( $order, $wc_order );
|
||||
|
|
|
@ -28,13 +28,14 @@ trait TransactionIdHandlingTrait {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function set_order_transaction_id(
|
||||
protected function update_transaction_id(
|
||||
string $transaction_id,
|
||||
WC_Order $wc_order,
|
||||
LoggerInterface $logger = null
|
||||
): bool {
|
||||
try {
|
||||
$wc_order->set_transaction_id( $transaction_id );
|
||||
$wc_order->save();
|
||||
return true;
|
||||
} catch ( Exception $exception ) {
|
||||
if ( $logger ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue