namespace, '/' . $this->rest_base . '/(?P\w+)', [ 'methods' => WP_REST_Server::READABLE, 'callback' => [ $this, 'get_payment_intent' ], 'permission_callback' => [ $this, 'check_permission' ], ] ); } /** * Retrieve charge to respond with via API. * * @param WP_REST_Request $request Full data about the request. */ public function get_payment_intent( $request ) { $payment_intent_id = $request->get_param( 'payment_intent_id' ); return $this->forward_request( 'get_intent', [ $payment_intent_id ] ); } }