mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Check if wcs_get_subscription
exists before calling it
This commit is contained in:
parent
746e26397a
commit
9cfa8fa922
1 changed files with 1 additions and 1 deletions
|
@ -203,7 +203,7 @@ class RenewalHandler {
|
|||
);
|
||||
}
|
||||
|
||||
$subscription = wcs_get_subscription( $wc_order->get_meta( '_subscription_renewal' ) );
|
||||
$subscription = function_exists( 'wcs_get_subscription' ) ? wcs_get_subscription( $wc_order->get_meta( '_subscription_renewal' ) ) : null;
|
||||
if ( $subscription ) {
|
||||
$subscription_id = $subscription->get_id();
|
||||
$token_id = get_post_meta( $subscription_id, 'payment_token_id', true );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue