Add previous transaction to parent order (WIP)

This commit is contained in:
Emili Castells Guasch 2023-07-11 11:19:50 +02:00
parent 518651b6a9
commit 56d16a5d8a
2 changed files with 6 additions and 1 deletions

View file

@ -128,7 +128,6 @@ class OrderFactory {
);
}
if ( ! isset( $order_data->intent ) ) {
$this->logger->info(wc_print_r($order_data, true));
throw new RuntimeException(
__( 'Order does not contain intent.', 'woocommerce-paypal-payments' )
);

View file

@ -73,6 +73,12 @@ class SubscriptionModule implements ModuleInterface {
$logger = $c->get( 'woocommerce.logger.woocommerce' );
$this->add_payment_token_id( $subscription, $payment_token_repository, $logger );
if(count($subscription->get_related_orders()) === 1) {
$parent_order = $subscription->get_parent();
// get transaction id
// add trans as meta to sub
}
}
);