Beispiel #1
0
 def supplier_can_use_data(self):
     if self._core_customer:
         return resolve_boolean(
             self._core_customer.dp_supplier
         )
     else:
         if isinstance(self._supplier_can_use_data, bool):
             return self._supplier_can_use_data
         elif isinstance(self._supplier_can_use_data, basestring):
             return resolve_boolean(
                 self._supplier_can_use_data
             )
Beispiel #2
0
 def user_can_use_data(self):
     if self._core_customer:
         return resolve_boolean(
             self._core_customer.dp_user
         )
     else:
         if isinstance(self._user_can_use_data, bool):
             return self._user_can_use_data
         elif isinstance(self._user_can_use_data, six.string_types):
             return resolve_boolean(
                 self._user_can_use_data
             )
Beispiel #3
0
 def world_can_use_data(self):
     if self._core_customer:
         return resolve_boolean(
             self._core_customer.dp_world
         )
     else:
         if isinstance(self._world_can_use_data, bool):
             return self._world_can_use_data
         elif isinstance(self._world_can_use_data, basestring):
             return resolve_boolean(
                 self._world_can_use_data
             )
    def example_seats_are_real(self):
        """Boolean to indicate if the example_seats are actual seat numbers.

        If True, the seats in the example_seats list will be the seats that
        are reserved.
        """
        return resolve_boolean(self._core_price_band.example_seats_are_real)
Beispiel #5
0
    def need_departure_date(self):
        """Flag to indicate that a departure date is required.

        Value can be True/False (a departure date is/isn't required)
        or None (the data could not be retrieved/unknown).
        See the API documentation for more information about the
        'need_departure_date' flag.
        """

        if self._need_departure_date is None:
            need_departure_date = self._get_core_event_attr(
                'need_departure_date'
            )

            if need_departure_date:

                self._need_departure_date = resolve_boolean(
                    need_departure_date
                )

            else:
                self.get_performances()

        if self._need_departure_date:
            return self._need_departure_date
        else:
            return None
Beispiel #6
0
    def is_purchase_successful(self):
        """Boolean indicating if the bundle was purchased successfully

        Will return True if the purchase was successful,
        False if the purchase was not successful and
        None if no purchase was attempted.
        """
        is_success = None

        if self._core_bundle.purchase_result:

            is_success = resolve_boolean(self._core_bundle.purchase_result.success)

        return is_success
Beispiel #7
0
    def _build_reviews(self):
        self._critic_reviews = []
        self._user_reviews = []
        for r in self._get_core_event_attr('reviews'):

            is_user_bool = resolve_boolean(r.is_user_review)

            review = Review(
                core_review=r, is_user_review=is_user_bool
            )

            if is_user_bool:
                self._user_reviews.append(review)
            else:
                self._critic_reviews.append(review)
Beispiel #8
0
    def is_purchase_successful(self):
        """Check if the trolley was purchased successfully

        Will return True if the purchase was successful,
        False if the purchase was not successful and
        None if no purchase was attempted.
        """
        is_success = None

        if self._core_trolley.purchase_result:

            is_success = resolve_boolean(
                self._core_trolley.purchase_result.success
            )

        return is_success
    def delete(self):
        """Cancels this reservation, returns True if successful."""

        crypto_block = self._get_crypto_block_for_object(
            method_name='make_reservation',
            interface_object=self
        )

        resp_dict = self.get_core_api().release_reservation(
            crypto_block=crypto_block,
            upfront_data_token=self.settings['upfront_data_token'],
        )

        return resolve_boolean(
            resp_dict['released_ok']
        )
 def needs_agent_reference(self):
     return resolve_boolean(
         self._needs_agent_reference
     )
 def supports_billing_address(self):
     """Boolean indicating if billing address can be provided during
     purchase."""
     return resolve_boolean(
         self._supports_billing_address
     )
 def needs_email_address(self):
     """Boolean indicating if an email address is required for purchase."""
     return resolve_boolean(
         self._needs_email_address
     )
Beispiel #13
0
 def supports_https(self):
     """Boolean flag indicating HTTPS support."""
     return resolve_boolean(
         self._core_video_iframe.video_iframe_supports_https
     )
 def failed_3d_secure(self):
     """Boolean to indicate if the purchase attempt was marked with a
     3D secure failure."""
     return resolve_boolean(self._failed_3d_secure)
Beispiel #15
0
 def is_offer(self):
     """Boolean to indicate if the default concession for this ticket
     type is a special offer.
     """
     return resolve_boolean(self._core_price_band.is_offer)
Beispiel #16
0
 def is_main(self):
     """Flag to indicate if this is the primary category for the event."""
     if self._core_class:
         return resolve_boolean(self._core_class.is_main_class)
     else:
         return resolve_boolean(self._core_subclass.is_main_subclass)
Beispiel #17
0
 def need_duration(self):
     return resolve_boolean(
         self._get_core_event_attr('need_duration')
     )
Beispiel #18
0
 def need_performance(self):
     return resolve_boolean(
         self._get_core_event_attr('need_performance')
     )
Beispiel #19
0
 def show_perf_time(self):
     return resolve_boolean(
         self._get_core_event_attr('show_perf_time')
     )
Beispiel #20
0
 def is_seated(self):
     return resolve_boolean(
         self._get_core_event_attr('is_seated')
     )
 def failed_cv_two(self):
     """Boolean to indicate if the purchase attempt was marked with a
     CV2 failure."""
     return resolve_boolean(self._failed_cv_two)
 def failed_avs(self):
     """Boolean to indicate if the purchase attempt was marked with a
     AVS failure."""
     return resolve_boolean(self._failed_avs)
Beispiel #23
0
    def get_performances(self, earliest_date=None, latest_date=None, **kwargs):
        """Retrieves the Performances for this Event.

        Returns the list of Performances for the Event, called internally
        by several other methods, it calls the 'date_time_options' API method.
        The 'performances' property should be used to get this information
        unless a specific date range is required.

        Args:
            earliest_date (datetime.date): restrict the list of
                Performances to be later than this date.
            latest_date (datetime.date): restrict the list of
                Performances to be earlier than this date.

        Returns:
            list: List of Performance objects
        """
        crypto_block = self._get_search_crypto()

        resp_dict = self.get_core_api().date_time_options(
            crypto_block=crypto_block,
            upfront_data_token=self.settings['upfront_data_token'],
            event_token=self.event_id,
            earliest_date=date_to_yyyymmdd_or_none(earliest_date),
            latest_date=date_to_yyyymmdd_or_none(latest_date),
            request_cost_range=True,
            **kwargs
        )

        performances = []

        self.need_departure_date = resolve_boolean(
            resp_dict['need_departure_date']
        )

        if 'using_perf_list' in resp_dict:

            self.perfs_have_required_info = resolve_boolean(
                resp_dict['has_perf_names']
            )

            self.perfs_have_usage_date = False
            self.has_single_false_perf = False

            for p in resp_dict['using_perf_list']['performances']:

                if self.need_departure_date:
                    departure_date = p.date
                else:
                    departure_date = None

                performances.append(
                    perf_objs.Performance.from_event_and_perf_token(
                        event=self,
                        perf_token=p.perf_token,
                        core_performance=p,
                        departure_date=departure_date,
                        **self._internal_settings()
                    )
                )

        elif 'using_usage_date' in resp_dict:

            self.perfs_have_usage_date = True
            self.has_single_false_perf = False
            self.perfs_have_required_info = False

            performances = self._build_performances_from_usage(
                usage_date_dict=resp_dict['using_usage_date'],
                need_departure_date=self.need_departure_date,
                latest_date=latest_date
            )

        else:

            self.perfs_have_usage_date = False
            self.has_single_false_perf = True
            self.perfs_have_required_info = False

            performances.append(perf_objs.Performance.from_event_only(
                event=self,
                **self._internal_settings()
            ))

        self.performances = performances

        self._set_crypto_for_object(
            crypto_block=resp_dict['crypto_block'],
            method_name='date_time_options',
            interface_object=self
        )

        return performances
Beispiel #24
0
 def is_restricted_view(self):
     """Boolean representing whether the seat has a restricted view."""
     return resolve_boolean(self._core_seat.is_restricted_view)
 def need_payment_card(self):
     """Boolean indicating if a payment card is required for purchase."""
     return resolve_boolean(
         self._need_payment_card
     )
Beispiel #26
0
 def has_no_perfs(self):
     return resolve_boolean(
         self._get_core_event_attr('has_no_perfs')
     )
Beispiel #27
0
 def is_limited(self):
     """Boolean flag indicating limited availability."""
     return resolve_boolean(
         self._get_core_performance_attr('is_limited')
     )