Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): [payouts] failure of payout retrieve when token is expired #5362

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

Sakilmostak
Copy link
Contributor

@Sakilmostak Sakilmostak commented Jul 18, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

the payout retrieve fails when payout_token expires for payout_method_data. It should not fail for such cases so removed the dependency on payout_method_data

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Tested through postman:

  • Create a payout through Paypal:
{
    "amount": 1,
    "currency": "EUR",
    "customer_id": "payout_customer",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payout request",
    "payout_type": "wallet",
    "payout_method_data": {
        "wallet": {
            "paypal": {
                "email": "[email protected]"
            }
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "NY",
            "zip": "94122",
            "country": "US",
            "first_name": "John",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "entity_type": "NaturalPerson",
    "recurring": false,
    "metadata": {
        "ref": "123"
    },
    "routing": {
        "type": "single",
        "data": "paypal"
    },
    "confirm": true,
    "auto_fulfill": true
}
  • The status should be pending
  • Wait for 15+ minutes
  • Do a retrieve call to payout
curl --location 'http://localhost:8080/payouts/{{payout_id}}?force_sync=true' \
--header 'api-key: {{apl_key}}'
  • The status should be succeeded

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@Sakilmostak Sakilmostak added A-core Area: Core flows C-bug Category: Bug labels Jul 18, 2024
@Sakilmostak Sakilmostak added this to the July 2024 Release milestone Jul 18, 2024
@Sakilmostak Sakilmostak self-assigned this Jul 18, 2024
@Sakilmostak Sakilmostak requested a review from a team as a code owner July 18, 2024 11:49
@Sakilmostak Sakilmostak changed the title bugfix(core): [payouts] failure of payout retrieve when token is expired fix(core): [payouts] failure of payout retrieve when token is expired Jul 18, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Jul 18, 2024
Merged via the queue into main with commit 817d06c Jul 18, 2024
19 of 25 checks passed
@likhinbopanna likhinbopanna deleted the fix_token_expire_in_retrieve branch July 18, 2024 14:39
pixincreate added a commit that referenced this pull request Jul 19, 2024
* 'main' of github.com:juspay/hyperswitch: (26 commits)
  refactor(core): change primary keys in user, user_roles and roles tables (#5374)
  chore(version): 2024.07.19.1
  refactor(connector): make the `original_authorized_amount` optional for MITs with `connector_mandate_details` (#5311)
  feat(connector): Plaid connector Integration (#3952)
  feat: encryption service integration to support batch encryption and decryption (#5164)
  refactor(core): change primary key of refund table (#5367)
  chore(version): 2024.07.19.0
  chore(postman): update Postman collection files
  Docs: Updating Error codes for documentation purposes (#5314)
  fix(core): [payouts] failure of payout retrieve when token is expired (#5362)
  build: remove unused dependencies (#5343)
  refactor(blocklist): change primary key of blocklist table (#5356)
  chore: Increasing log coverage for payment method list (#5042)
  refactor(routing): Remove backwards compatibility for the routing crate (#3015)
  refactor(merchant_account): change primary key for merchant account (#5327)
  refactor(router): remove id dependency from merchant connector account, dispute and mandate (#5330)
  feat(connector): [Itau Bank] Template for payment flows (#5304)
  chore(version): 2024.07.18.0
  refactor(router): Remove the locker call in the psync flow (#5348)
  feat(router): Add support for passing the domain dynamically in the session call (#5347)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants