PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 2.2.0
Subscriptions for WooCommerce with Stripe Recurring Payments v2.2.0
2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.11.2 1.11.1 1.11.0 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.6 1.9.5 trunk 1.3.0 1.3.1 1.3.2 1.4.0 All 65 releases
← All changes | includes/Api/PlanController.php +0 -38 trunk → 2.2.0 View file →
@@ -195,20 +195,8 @@
195 195 );
196 196
197 197 register_rest_route(
198 198 self::NS,
199 - '/plans/product-user-cancel/(?P<id>\d+)',
200 - array(
201 - array(
202 - 'methods' => WP_REST_Server::EDITABLE,
203 - 'callback' => array( $this, 'save_product_user_cancel' ),
204 - 'permission_callback' => $perm,
205 - ),
206 - )
207 - );
208 -
209 - register_rest_route(
210 - self::NS,
211 199 '/plans/group-products/(?P<id>\d+)',
212 200 array(
213 201 array(
214 202 'methods' => WP_REST_Server::READABLE,
@@ -655,34 +643,8 @@
655 643 'deleted' => true,
656 644 'id' => $id,
657 645 )
658 646 );
659 - }
660 -
661 - /**
662 - * PUT /plans/product-user-cancel/{id} - save whether customers may cancel.
663 - *
664 - * Writes the same `_subscrpt_user_cancel` meta the product editor saves, as
665 - * an explicit "yes" / "no", which checkout copies onto each new subscription.
666 - *
667 - * Body: { enabled: bool }.
668 - *
669 - * @param WP_REST_Request $request Request.
670 - *
671 - * @return \WP_REST_Response|WP_Error
672 - */
673 - public function save_product_user_cancel( WP_REST_Request $request ) {
674 - $product = function_exists( 'wc_get_product' ) ? wc_get_product( (int) $request['id'] ) : null;
675 -
676 - if ( ! $product ) {
677 - return $this->not_found();
678 - }
679 -
680 - $params = $this->read_params( $request );
681 - $product->update_meta_data( '_subscrpt_user_cancel', empty( $params['enabled'] ) ? 'no' : 'yes' );
682 - $product->save();
683 -
684 - return rest_ensure_response( array( 'saved' => true ) );
685 647 }
686 648
687 649 /**
688 650 * POST /plans/bulk-price - set one price on many product/duration relations.