| @@ 2447-2458 (lines=12) @@ | ||
| 2444 | return $interval; |
|
| 2445 | } |
|
| 2446 | ||
| 2447 | public function failing_subscription() { |
|
| 2448 | $args = array( |
|
| 2449 | 'status' => 'failing' |
|
| 2450 | ); |
|
| 2451 | ||
| 2452 | if ( $this->update_subscription( $args ) ) { |
|
| 2453 | do_action( 'wpinv_subscription_failing', $this->ID, $this ); |
|
| 2454 | return true; |
|
| 2455 | } |
|
| 2456 | ||
| 2457 | return false; |
|
| 2458 | } |
|
| 2459 | ||
| 2460 | public function stop_subscription() { |
|
| 2461 | $args = array( |
|
| @@ 2460-2471 (lines=12) @@ | ||
| 2457 | return false; |
|
| 2458 | } |
|
| 2459 | ||
| 2460 | public function stop_subscription() { |
|
| 2461 | $args = array( |
|
| 2462 | 'status' => 'stopped' |
|
| 2463 | ); |
|
| 2464 | ||
| 2465 | if ( $this->update_subscription( $args ) ) { |
|
| 2466 | do_action( 'wpinv_subscription_stopped', $this->ID, $this ); |
|
| 2467 | return true; |
|
| 2468 | } |
|
| 2469 | ||
| 2470 | return false; |
|
| 2471 | } |
|
| 2472 | ||
| 2473 | public function restart_subscription() { |
|
| 2474 | $args = array( |
|
| @@ 2473-2484 (lines=12) @@ | ||
| 2470 | return false; |
|
| 2471 | } |
|
| 2472 | ||
| 2473 | public function restart_subscription() { |
|
| 2474 | $args = array( |
|
| 2475 | 'status' => 'active' |
|
| 2476 | ); |
|
| 2477 | ||
| 2478 | if ( $this->update_subscription( $args ) ) { |
|
| 2479 | do_action( 'wpinv_subscription_restarted', $this->ID, $this ); |
|
| 2480 | return true; |
|
| 2481 | } |
|
| 2482 | ||
| 2483 | return false; |
|
| 2484 | } |
|
| 2485 | ||
| 2486 | public function cancel_subscription() { |
|
| 2487 | $args = array( |
|