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