Private
Public Access
1
0

rejecting payments without 3D secure info

This commit is contained in:
Sander Roosendaal
2019-07-23 18:06:08 +02:00
parent 0731db960c
commit ac3b2d101c
3 changed files with 27 additions and 11 deletions

View File

@@ -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']