| @@ 2426-2437 (lines=12) @@ | ||
| 2423 | return $interval; |
|
| 2424 | } |
|
| 2425 | ||
| 2426 | public function failing_subscription() { |
|
| 2427 | $args = array( |
|
| 2428 | 'status' => 'failing' |
|
| 2429 | ); |
|
| 2430 | ||
| 2431 | if ( $this->update_subscription( $args ) ) { |
|
| 2432 | do_action( 'wpinv_subscription_failing', $this->ID, $this ); |
|
| 2433 | return true; |
|
| 2434 | } |
|
| 2435 | ||
| 2436 | return false; |
|
| 2437 | } |
|
| 2438 | ||
| 2439 | public function stop_subscription() { |
|
| 2440 | $args = array( |
|
| @@ 2439-2450 (lines=12) @@ | ||
| 2436 | return false; |
|
| 2437 | } |
|
| 2438 | ||
| 2439 | public function stop_subscription() { |
|
| 2440 | $args = array( |
|
| 2441 | 'status' => 'stopped' |
|
| 2442 | ); |
|
| 2443 | ||
| 2444 | if ( $this->update_subscription( $args ) ) { |
|
| 2445 | do_action( 'wpinv_subscription_stopped', $this->ID, $this ); |
|
| 2446 | return true; |
|
| 2447 | } |
|
| 2448 | ||
| 2449 | return false; |
|
| 2450 | } |
|
| 2451 | ||
| 2452 | public function restart_subscription() { |
|
| 2453 | $args = array( |
|
| @@ 2452-2463 (lines=12) @@ | ||
| 2449 | return false; |
|
| 2450 | } |
|
| 2451 | ||
| 2452 | public function restart_subscription() { |
|
| 2453 | $args = array( |
|
| 2454 | 'status' => 'active' |
|
| 2455 | ); |
|
| 2456 | ||
| 2457 | if ( $this->update_subscription( $args ) ) { |
|
| 2458 | do_action( 'wpinv_subscription_restarted', $this->ID, $this ); |
|
| 2459 | return true; |
|
| 2460 | } |
|
| 2461 | ||
| 2462 | return false; |
|
| 2463 | } |
|
| 2464 | ||
| 2465 | public function cancel_subscription() { |
|
| 2466 | $args = array( |
|