Skip to content

Commit

Permalink
Change charge descriptor. Fix sort by price.
Browse files Browse the repository at this point in the history
  • Loading branch information
freQniK committed Jun 26, 2023
1 parent 283bb38 commit 016908d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion src/fiat/stripe_pay/charge.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def create_payment_charge(self, tokenid,amount):
payment = stripe.Charge.create(
amount= int(float(amount)*100), # convert amount to cents
currency='usd',
description='Example charge',
description='dVPN Credits',
source=tokenid,
)

Expand Down
4 changes: 2 additions & 2 deletions src/ui/screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,13 +1146,13 @@ def SortNodesByPrice(self, CountryNodes):

for data in NodeData:
try:
udvpn = re.findall(r'[0-9]+' +"dvpn", data['Price'])[0]
udvpn = re.findall(r'[0-9]+\.[0-9]+' +"dvpn", data['Price'])[0]
NodeData[i]['Price'] = udvpn
except IndexError:
NodeData[i]['Price'] = "1dvpn"
i += 1

NodeDataSorted = sorted(NodeData, key=lambda d: int(d['Price'].split('dvpn')[0]))
NodeDataSorted = sorted(NodeData, key=lambda d: float(d['Price'].split('dvpn')[0]))
NewNodeData = []

for ndata in NodeDataSorted:
Expand Down

0 comments on commit 016908d

Please sign in to comment.