(
        self,
        amount: Decimal,
        *,
        application_fee: Decimal = None,
        source: Union[str, StripeModel] = None,
        **kwargs,
    )
return Charge.sync_from_stripe_data(stripe_charge)
Creates a charge for this customer.

        :param amount: The amount to charge.
        :type amount: Decimal. Precision is 2; anything more will be ignored.
        :param source: The source to use for this charge.
            Must be a source attributed to this customer. If None, the customer's
            default source is used. Can be either the id of the source or
            the source object itself.
        :type source: string, Source
Creates a charge for this customer.
Creates a charge for this customer .
def charge(
        self,
        amount: Decimal,
        *,
        application_fee: Decimal = None,
        source: Union[str, StripeModel] = None,
        **kwargs,
    ) -> Charge:
        """
        Creates a charge for this customer.

        :param amount: The amount to charge.
        :type amount: Decimal. Precision is 2; anything more will be ignored.
        :param source: The source to use for this charge.
            Must be a source attributed to this customer. If None, the customer's
            default source is used. Can be either the id of the source or
            the source object itself.
        :type source: string, Source
        """

        if not isinstance(amount, Decimal):
            raise ValueError("You must supply a decimal value representing dollars.")

        # Convert Source to id
        if source and isinstance(source, StripeModel):
            source = source.id

        stripe_charge = Charge._api_create(
            customer=self.id,
            amount=int(amount * 100),  # Convert dollars into cents
            application_fee=int(application_fee * 100)
            if application_fee
            else None,  # Convert dollars into cents
            source=source,
            **kwargs,
        )

        return Charge.sync_from_stripe_data(stripe_charge)
def charge ( self , amount : Decimal , * , application_fee : Decimal = None , source : Union [ str , StripeModel ] = None , * * kwargs , ) -> Charge : if not isinstance ( amount , Decimal ) : raise ValueError ( "You must supply a decimal value representing dollars." ) # Convert Source to id if source and isinstance ( source , StripeModel ) : source = source . id stripe_charge = Charge . _api_create ( customer = self . id , amount = int ( amount * 100 ) , # Convert dollars into cents application_fee = int ( application_fee * 100 ) if application_fee else None , # Convert dollars into cents source = source , * * kwargs , ) return Charge . sync_from_stripe_data ( stripe_charge )