Skip to content

Conversation

@deadtik
Copy link

@deadtik deadtik commented Jan 29, 2026

Description

Fixes #321.

Users frequently pass string values (e.g., "true", "false") in the options dictionary, expecting them to work like booleans. The Razorpay API strictly requires integers (1/0). When strings are sent, the API silently ignores them (defaulting to False), causing issues like PayPal options not appearing.

Changes

  • Added input sanitization to payment_link.create.
  • The method now detects string values ("true", "false") in options.checkout.method and automatically casts them to integers (1, 0).
  • Updated docstrings and added type hinting (PEP-8 cleanup).

Verification

  • Verified locally that passing {"card": "true"} is correctly transformed to {"card": 1} before the network request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Payment link generated using the API does not show Paypal option

1 participant