Переглянути джерело

feat(donation): introduced setting for creditor name

UPON DEPLOY, please add DESECSTACK_API_SEPA_CREDITOR_NAME with an
appropriate name of your donation bank account to your .env file.
Any donors will expect that name to appear on their bank statement.
Nils Wisiol 7 роки тому
батько
коміт
449752d201

+ 1 - 0
.env.default

@@ -12,6 +12,7 @@ DESECSTACK_DBMASTER_CERTS=./certs
 # API-related
 # API-related
 DESECSTACK_API_ADMIN=
 DESECSTACK_API_ADMIN=
 DESECSTACK_API_SEPA_CREDITOR_ID=
 DESECSTACK_API_SEPA_CREDITOR_ID=
+DESECSTACK_API_SEPA_CREDITOR_NAME=
 DESECSTACK_API_EMAIL_HOST=
 DESECSTACK_API_EMAIL_HOST=
 DESECSTACK_API_EMAIL_HOST_USER=
 DESECSTACK_API_EMAIL_HOST_USER=
 DESECSTACK_API_EMAIL_HOST_PASSWORD=
 DESECSTACK_API_EMAIL_HOST_PASSWORD=

+ 1 - 0
.travis.yml

@@ -9,6 +9,7 @@ env:
    - DESECSTACK_DOMAIN=your.hostname.example.com
    - DESECSTACK_DOMAIN=your.hostname.example.com
    - DESECSTACK_API_ADMIN=john.doe@example.com
    - DESECSTACK_API_ADMIN=john.doe@example.com
    - DESECSTACK_API_SEPA_CREDITOR_ID=TESTCREDITORID
    - DESECSTACK_API_SEPA_CREDITOR_ID=TESTCREDITORID
+   - DESECSTACK_API_SEPA_CREDITOR_NAME=TESTCREDITORNAME
    - DESECSTACK_API_EMAIL_HOST=mail.your.hostname.example.com
    - DESECSTACK_API_EMAIL_HOST=mail.your.hostname.example.com
    - DESECSTACK_API_EMAIL_HOST_USER=user
    - DESECSTACK_API_EMAIL_HOST_USER=user
    - DESECSTACK_API_EMAIL_HOST_PASSWORD=password
    - DESECSTACK_API_EMAIL_HOST_PASSWORD=password

+ 0 - 1
api/desecapi/models.py

@@ -366,7 +366,6 @@ class Donation(models.Model):
         self.iban = self.iban[:6] + "xxx" # do NOT save account details
         self.iban = self.iban[:6] + "xxx" # do NOT save account details
         super().save(*args, **kwargs) # Call the "real" save() method.
         super().save(*args, **kwargs) # Call the "real" save() method.
 
 
-
     class Meta:
     class Meta:
         ordering = ('created',)
         ordering = ('created',)
 
 

+ 1 - 0
api/desecapi/settings.py

@@ -162,6 +162,7 @@ NSMASTER_PDNS_API_TOKEN = os.environ['DESECSTACK_NSMASTER_APIKEY']
 # SEPA direct debit settings
 # SEPA direct debit settings
 SEPA = {
 SEPA = {
     'CREDITOR_ID': os.environ['DESECSTACK_API_SEPA_CREDITOR_ID'],
     'CREDITOR_ID': os.environ['DESECSTACK_API_SEPA_CREDITOR_ID'],
+    'CREDITOR_NAME': os.environ['DESECSTACK_API_SEPA_CREDITOR_NAME'],
 }
 }
 
 
 # recaptcha
 # recaptcha

+ 1 - 1
api/desecapi/templates/emails/donation/donor-content.txt

@@ -9,7 +9,7 @@ We will debit {{ donation.amount }} € from your account within the next
 two weeks. Your mandate reference number is {{ donation.mref }}; our
 two weeks. Your mandate reference number is {{ donation.mref }}; our
 creditor identifier is {{ creditoridentifier }}.
 creditor identifier is {{ creditoridentifier }}.
 
 
-Please note that the payment is handled by "enit", which may be the name 
+Please note that the payment is handled by "{{ creditorname }}", which may be the name
 appearing on your bank statement.
 appearing on your bank statement.
 
 
 Again, thank you so much.
 Again, thank you so much.

+ 1 - 0
api/desecapi/views.py

@@ -387,6 +387,7 @@ class DonationList(generics.CreateAPIView):
             context = {
             context = {
                 'donation': donation,
                 'donation': donation,
                 'creditoridentifier': settings.SEPA['CREDITOR_ID'],
                 'creditoridentifier': settings.SEPA['CREDITOR_ID'],
+                'creditorname': settings.SEPA['CREDITOR_NAME'],
                 'complete_iban': iban
                 'complete_iban': iban
             }
             }
 
 

+ 1 - 0
docker-compose.yml

@@ -104,6 +104,7 @@ services:
     - DESECSTACK_DOMAIN
     - DESECSTACK_DOMAIN
     - DESECSTACK_API_ADMIN
     - DESECSTACK_API_ADMIN
     - DESECSTACK_API_SEPA_CREDITOR_ID
     - DESECSTACK_API_SEPA_CREDITOR_ID
+    - DESECSTACK_API_SEPA_CREDITOR_NAME
     - DESECSTACK_API_EMAIL_HOST
     - DESECSTACK_API_EMAIL_HOST
     - DESECSTACK_API_EMAIL_HOST_USER
     - DESECSTACK_API_EMAIL_HOST_USER
     - DESECSTACK_API_EMAIL_HOST_PASSWORD
     - DESECSTACK_API_EMAIL_HOST_PASSWORD