| @@ -37,8 +37,23 @@ | ||
| 37 | 37 | return FrmStrpLiteConnectHelper::cancel_subscription( $sub_id, $customer_id ); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | + * Cancel a subscription without checking that it belongs to the current user. | |
| 42 | + * Use this when there is no logged in user, like when a webhook event is processed. | |
| 43 | + * The customer check in self::cancel_subscription would always fail there because the current user ID is 0. | |
| 44 | + * | |
| 45 | + * @since 6.35 | |
| 46 | + * | |
| 47 | + * @param string $sub_id | |
| 48 | + * | |
| 49 | + * @return bool | |
| 50 | + */ | |
| 51 | + public static function cancel_subscription_without_customer_check( $sub_id ) { | |
| 52 | + return FrmStrpLiteConnectHelper::cancel_subscription( $sub_id ); | |
| 53 | + } | |
| 54 | + | |
| 55 | + /** | |
| 41 | 56 | * @param string $payment_id |
| 42 | 57 | * |
| 43 | 58 | * @return bool |
| 44 | 59 | */ |