juspay/hyperswitch

[BUG] invalidate `payout_token` once the txn is processed

Open

#6005 aperta il 24 set 2024

Vedi su GitHub
 (8 commenti) (0 reazioni) (1 assegnatario)Rust (4676 fork)batch import
C-bugS-awaiting-triagegood first issue

Metriche repository

Star
 (42.690 star)
Metriche merge PR
 (Merge medio 6g 22h) (213 PR mergiate in 30 g)

Descrizione

Bug Description

payout_token can be used for processing payout txns for saved payout methods. This is a short lived token which is generated by customer's PM list API. These tokens should only be used once. However, these are not being invalidated post usage.

Expected Behavior

Tokens should only be used once per payout request. These must be invalidated after completing the payout txn. Same tokens should not be allowed to be consumed for multiple payouts.

Token generated -> Token attached to a payout

Actual Behavior

Same token is being across multiple payout txns. Moreover, these are not being invalidated once the txn reaches the end of it's lifecycle.

Steps To Reproduce

  1. Save a payout method
  2. List customer payment methods for generating payment_token
  3. Use this payout_token in payout create APIs
  4. Complete the payout txn
  5. Use this as payout_token again - should be allowed. Ideal scenario is throwing an error stating Invalid token

Have you spent some time checking if this bug has been raised before?

  • I checked and didn't find a similar issue

Have you read the Contributing Guidelines?

Guida contributor