rejecting payments without 3D secure info
This commit is contained in:
@@ -101,6 +101,11 @@ def get_plans_costs():
|
||||
|
||||
def make_payment(rower,data):
|
||||
nonce_from_the_client = data['payment_method_nonce']
|
||||
nonce = gateway.payment_method_nonce.find(nonce_from_the_client)
|
||||
info = nonce.three_d_secure_info
|
||||
if info is None:
|
||||
return False,0
|
||||
|
||||
amount = data['amount']
|
||||
amount = '{amount:.f2}'.format(amount=amount)
|
||||
|
||||
@@ -131,6 +136,10 @@ def update_subscription(rower,data,method='up'):
|
||||
planid = data['plan']
|
||||
plan = PaidPlan.objects.get(id=planid)
|
||||
nonce_from_the_client = data['payment_method_nonce']
|
||||
nonce = gateway.payment_method_nonce.find(nonce_from_the_client)
|
||||
info = nonce.three_d_secure_info
|
||||
if info is None:
|
||||
return False,0
|
||||
amount = data['amount']
|
||||
amount = '{amount:.2f}'.format(amount=amount)
|
||||
|
||||
@@ -229,6 +238,10 @@ def update_subscription(rower,data,method='up'):
|
||||
|
||||
def create_subscription(rower,data):
|
||||
nonce_from_the_client = data['payment_method_nonce']
|
||||
nonce = gateway.payment_method_nonce.find(nonce_from_the_client)
|
||||
info = nonce.three_d_secure_info
|
||||
if info is None:
|
||||
return False,0
|
||||
amount = data['amount']
|
||||
|
||||
planid = data['plan']
|
||||
|
||||
Reference in New Issue
Block a user