mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Update renewal order status to completed
This commit is contained in:
parent
507932b565
commit
ae0f56e30b
1 changed files with 3 additions and 0 deletions
|
@ -94,9 +94,12 @@ class PaymentSaleCompleted implements RequestHandler {
|
||||||
foreach ( $subscriptions as $subscription ) {
|
foreach ( $subscriptions as $subscription ) {
|
||||||
$transaction_id = wc_clean( wp_unslash( $request['resource']['id'] ?? '' ) );
|
$transaction_id = wc_clean( wp_unslash( $request['resource']['id'] ?? '' ) );
|
||||||
if ( $transaction_id && is_string( $transaction_id ) ) {
|
if ( $transaction_id && is_string( $transaction_id ) ) {
|
||||||
|
$this->logger->info( 'Creating renewal order from PAYMENT.SALE.COMPLETED webhook handler' );
|
||||||
$renewal_order = wcs_create_renewal_order( $subscription );
|
$renewal_order = wcs_create_renewal_order( $subscription );
|
||||||
if ( is_a( $renewal_order, WC_Order::class ) ) {
|
if ( is_a( $renewal_order, WC_Order::class ) ) {
|
||||||
|
$renewal_order->payment_complete();
|
||||||
$this->update_transaction_id( $transaction_id, $renewal_order, $this->logger );
|
$this->update_transaction_id( $transaction_id, $renewal_order, $this->logger );
|
||||||
|
$this->logger->info( 'Updating status completed and transaction id from PAYMENT.SALE.COMPLETED webhook handler' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue