# Path: mollie/api/resources/payments.py
# class Payments(ResourceBase):
#     RESOURCE_ID_PREFIX = "tr_"
# 
#     def get_resource_object(self, result):
#         return Payment(result, self.client)
# 
#     def get(self, payment_id, **params):
#         if not payment_id or not payment_id.startswith(self.RESOURCE_ID_PREFIX):
#             raise IdentifierError(
#                 f"Invalid payment ID: '{payment_id}'. A payment ID should start with '{self.RESOURCE_ID_PREFIX}'."
#             )
#         return super().get(payment_id, **params)
# 
#     def delete(self, payment_id, data=None):
#         """Cancel payment and return the payment object.
# 
#         Deleting a payment causes the payment status to change to canceled.
#         The updated payment object is returned.
#         """
#         if not payment_id or not payment_id.startswith(self.RESOURCE_ID_PREFIX):
#             raise IdentifierError(
#                 f"Invalid payment ID: '{payment_id}'. A payment ID should start with '{self.RESOURCE_ID_PREFIX}'."
#             )
#         result = super().delete(payment_id, data)
#         return self.get_resource_object(result)


from .payments import Payments


class SubscriptionPayments(Payments):
    customer_id = None
    subscription_id = None

    def get_resource_name(self):
        return f"customers/{self.customer_id}/subscriptions/{self.subscription_id}/payments"

    def with_parent_id(self, customer_id, subscription_id):
        self.customer_id = customer_id

# Path: mollie/api/resources/payments.py
# class Payments(ResourceBase):
#     RESOURCE_ID_PREFIX = "tr_"
# 
#     def get_resource_object(self, result):
#         return Payment(result, self.client)
# 
#     def get(self, payment_id, **params):
#         if not payment_id or not payment_id.startswith(self.RESOURCE_ID_PREFIX):
#             raise IdentifierError(
#                 f"Invalid payment ID: '{payment_id}'. A payment ID should start with '{self.RESOURCE_ID_PREFIX}'."
#             )
#         return super().get(payment_id, **params)
# 
#     def delete(self, payment_id, data=None):
#         """Cancel payment and return the payment object.
# 
#         Deleting a payment causes the payment status to change to canceled.
#         The updated payment object is returned.
#         """
#         if not payment_id or not payment_id.startswith(self.RESOURCE_ID_PREFIX):
#             raise IdentifierError(
#                 f"Invalid payment ID: '{payment_id}'. A payment ID should start with '{self.RESOURCE_ID_PREFIX}'."
#             )
#         result = super().delete(payment_id, data)
#         return self.get_resource_object(result)


# Path: mollie/api/resources/subscription_payments.py
from .payments import Payments



class SubscriptionPayments(Payments):
    customer_id = None
    subscription_id = None

    def get_resource_name(self):
        return f"customers/{self.customer_id}/subscriptions/{self.subscription_id}/payments"

    def with_parent_id(self, customer_id, subscription_id):
        self.customer_id = customer_id

        self.subscription_id = subscription_id