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