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