fix: update payment method deletion to handle PayPal Vault v3

- Remove call to non-existent cancel_billing_agreement method
- PayPal Vault tokens remain in PayPal's system when deleted from our DB
- Add logging for PayPal payment method deletion
- Maintains backward compatibility with legacy billing agreements
parent 6497e355
......@@ -273,7 +273,11 @@ class PaymentService:
if method_type == 'card' and gateway == 'stripe':
await self.stripe_handler.delete_payment_method(user_id, payment_method_id)
elif method_type == 'paypal':
await self.paypal_handler.cancel_billing_agreement(user_id, payment_method_id)
# For PayPal Vault v3, we just delete from DB (tokens remain in PayPal vault)
# For legacy billing agreements, we would cancel them
# Note: PayPal Vault tokens can be revoked via their API if needed
logger.info(f"Deleting PayPal payment method {payment_method_id} (gateway={gateway})")
pass
# Delete from database
cursor.execute(f"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment