Fix: pass payment_method to generate_receipt (Stripe)
The generate_receipt() function in fjccv_webhook.py now accepts and passes payment_method to generate_receipt.py.
This commit is contained in:
+7
-2
@@ -104,7 +104,8 @@ def get_donation_number(donor_name: str, year: int) -> str:
|
||||
return None
|
||||
|
||||
def generate_receipt(donor: str, amount: float, date_str: str,
|
||||
donation_number: str, transaction_id: str = None) -> Path:
|
||||
donation_number: str, transaction_id: str = None,
|
||||
payment_method: str = None) -> Path:
|
||||
"""Generate the PDF receipt using the existing script."""
|
||||
# Scripts are in the parent skill directory
|
||||
script_dir = Path('/root/.openclaw/agents/main/workspace/skills/fjccv-donation-receipts/scripts')
|
||||
@@ -123,6 +124,9 @@ def generate_receipt(donor: str, amount: float, date_str: str,
|
||||
if transaction_id:
|
||||
cmd.extend(['--transaction', transaction_id])
|
||||
|
||||
if payment_method:
|
||||
cmd.extend(['--payment-method', payment_method])
|
||||
|
||||
try:
|
||||
result = subprocess.run(cmd, capture_output=True, text=True, check=True)
|
||||
for line in result.stdout.split('\n'):
|
||||
@@ -347,7 +351,8 @@ def _process_checkout_session(session, donor_name, donor_email, amount, transact
|
||||
amount=amount,
|
||||
date_str=date_str,
|
||||
donation_number=donation_number,
|
||||
transaction_id=transaction_id
|
||||
transaction_id=transaction_id,
|
||||
payment_method="Stripe"
|
||||
)
|
||||
|
||||
if not receipt_pdf:
|
||||
|
||||
Reference in New Issue
Block a user