From 863fcc251b3734e1de42c8d2a9061c0e57c0a760 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 9 Nov 2021 11:20:08 +0100 Subject: [PATCH] adding plan id --- rowers/braintreestuff.py | 8 +++++++- rowers/tasks.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rowers/braintreestuff.py b/rowers/braintreestuff.py index e601737a..59ec9aaa 100644 --- a/rowers/braintreestuff.py +++ b/rowers/braintreestuff.py @@ -189,6 +189,12 @@ def make_payment(rower,data): amount = data['amount'] amount = '{amount}'.format(amount=amount) + if 'plan' in data: + theplan = data['plan'] + additional_text = 'Rowsandall Purchase Plan nr {theplan}'.format(theplan=theplan) + else: + additional_text = 'Rowsandall Purchase' + result = gateway.transaction.sale({ "amount": amount, "payment_method_nonce": nonce_from_the_client, @@ -208,7 +214,7 @@ def make_payment(rower,data): if not fakturoid_contact_id: fakturoid_contact_id = fakturoid.create_contact(rower) id = fakturoid.create_invoice(rower,amount,transaction.id,dosend=True,contact_id=fakturoid_contact_id, - name='Rowsandall Purchase') + name=additional_text) try: job = myqueue(queuehigh,handle_send_email_transaction, diff --git a/rowers/tasks.py b/rowers/tasks.py index d6d5284d..ec2b5cae 100644 --- a/rowers/tasks.py +++ b/rowers/tasks.py @@ -1331,7 +1331,7 @@ def handle_send_email_transaction( d = { 'name': username, 'siteurl': siteurl, - 'amount': amount + 'amount': amount, } res = send_template_email(from_email,[useremail],