Skip to content

Commit

Permalink
Merge pull request #3 from eyra/fix-decline
Browse files Browse the repository at this point in the history
Fixed donation declined use case
  • Loading branch information
vloothuis authored Dec 20, 2023
2 parents 2609c1c + dc480e8 commit 7e20b99
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Binary file removed public/port-0.0.0-py3-none-any.whl
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions src/framework/processing/py/port/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import pandas as pd
import zipfile
import json

ExtractionResult = namedtuple("ExtractionResult", ["id", "title", "data_frame"])
filter_start_date = datetime(2017, 1, 1)
Expand Down Expand Up @@ -149,6 +150,9 @@ def process(sessionId):
if consent_result.__type__ == "PayloadJSON":
meta_data.append(("debug", f"donate consent data"))
yield donate(f"{sessionId}", consent_result.value)
if consent_result.__type__ == "PayloadFalse":
value = json.dumps('{"status" : "donation declined"}')
yield donate(f"{sessionId}", value)


def render_donation_page(body):
Expand Down

0 comments on commit 7e20b99

Please sign in to comment.