Change grind details location to name

This commit is contained in:
Nathan Chapman 2022-05-15 07:44:11 -06:00
parent af52ac5940
commit 62031b72fd

View File

@ -74,11 +74,11 @@ class CreateOrder(PayPalClient):
"""Method to create body with CAPTURE intent"""
processed_items = [{
# Shows within upper-right dropdown during payment approval
'name': f'{item["product"]}',
'name': f'{item["product"]}: ' + ', '.join([next((f"{value['quantity']} x {v[1]}" for i, v in enumerate(CoffeeGrind.GRIND_CHOICES) if v[0] == key), None)
for key, value in item['variations'].items()])[:100],
# Item details will also be in the completed paypal.com transaction view
'description': ', '.join([next((f"{value['quantity']} x {v[1]}" for i, v in enumerate(CoffeeGrind.GRIND_CHOICES) if v[0] == key), None)
for key, value in item['variations'].items()]),
'description': item['product'].subtitle,
'unit_amount': {
'currency_code': settings.DEFAULT_CURRENCY,
'value': f'{item["price"]}'