(self, card, amount_in_dollars, description)
return transaction_record.id
Charges a stripe card and returns a transaction id
Charges a stripe card and returns a transaction id
Charges a stripe card and returns a transaction id
def create_charge(self, card, amount_in_dollars, description):
        """ Charges a stripe card and returns a transaction id """
        amount_in_cents = int((amount_in_dollars * Decimal('100')).quantize(Decimal(10)))
        transaction_record = stripe.Charge.create(
            card=card,
            customer=self.customer,
            amount=amount_in_cents,
            currency=settings.DEFAULT_CURRENCY,
            description=description,
        )
        return transaction_record.id
def create_charge ( self , card , amount_in_dollars , description ) : amount_in_cents = int ( ( amount_in_dollars * Decimal ( '100' ) ) . quantize ( Decimal ( 10 ) ) ) transaction_record = stripe . Charge . create ( card = card , customer = self . customer , amount = amount_in_cents , currency = settings . DEFAULT_CURRENCY , description = description , ) return transaction_record . id