Remove legacy credit card support
This commit is contained in:
parent
5161a74354
commit
4e658d2d77
2 changed files with 0 additions and 25 deletions
|
@ -34,12 +34,6 @@ class PaymentMethodSerializer(serializers.ModelSerializer):
|
||||||
class ChargePaymentMethodSerializer(serializers.Serializer):
|
class ChargePaymentMethodSerializer(serializers.Serializer):
|
||||||
amount = serializers.DecimalField(max_digits=10, decimal_places=2)
|
amount = serializers.DecimalField(max_digits=10, decimal_places=2)
|
||||||
|
|
||||||
class CreditCardSerializer(serializers.Serializer):
|
|
||||||
number = serializers.IntegerField()
|
|
||||||
exp_month = serializers.IntegerField()
|
|
||||||
exp_year = serializers.IntegerField()
|
|
||||||
cvc = serializers.IntegerField()
|
|
||||||
|
|
||||||
class CreatePaymentMethodSerializer(serializers.ModelSerializer):
|
class CreatePaymentMethodSerializer(serializers.ModelSerializer):
|
||||||
please_visit = serializers.CharField(read_only=True)
|
please_visit = serializers.CharField(read_only=True)
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
|
@ -71,19 +71,6 @@ def handle_stripe_error(f):
|
||||||
|
|
||||||
return handle_problems
|
return handle_problems
|
||||||
|
|
||||||
# Convenience CC container, also used for serialization.
|
|
||||||
class CreditCard():
|
|
||||||
number = None
|
|
||||||
exp_year = None
|
|
||||||
exp_month = None
|
|
||||||
cvc = None
|
|
||||||
|
|
||||||
def __init__(self, number, exp_month, exp_year, cvc):
|
|
||||||
self.number=number
|
|
||||||
self.exp_year = exp_year
|
|
||||||
self.exp_month = exp_month
|
|
||||||
self.cvc = cvc
|
|
||||||
|
|
||||||
# Actual Stripe logic.
|
# Actual Stripe logic.
|
||||||
|
|
||||||
def public_api_key():
|
def public_api_key():
|
||||||
|
@ -116,12 +103,6 @@ def get_setup_intent(setup_intent_id):
|
||||||
def get_payment_method(payment_method_id):
|
def get_payment_method(payment_method_id):
|
||||||
return stripe.PaymentMethod.retrieve(payment_method_id)
|
return stripe.PaymentMethod.retrieve(payment_method_id)
|
||||||
|
|
||||||
## Legacy
|
|
||||||
|
|
||||||
@handle_stripe_error
|
|
||||||
def get_card(customer_id, card_id):
|
|
||||||
return stripe.Customer.retrieve_source(customer_id, card_id)
|
|
||||||
|
|
||||||
@handle_stripe_error
|
@handle_stripe_error
|
||||||
def charge_customer(amount, customer_id, card_id):
|
def charge_customer(amount, customer_id, card_id):
|
||||||
# Amount is in CHF but stripes requires smallest possible unit.
|
# Amount is in CHF but stripes requires smallest possible unit.
|
||||||
|
|
Loading…
Reference in a new issue