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

feat(router): Add payments get-intent API for v2 #6396

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

AnuthaDev
Copy link
Contributor

@AnuthaDev AnuthaDev commented Oct 22, 2024

Type of Change

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

Description

Added get-intent API for payments

Additional Changes

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

Motivation and Context

Closes #6395

How did you test it?

1a. Request

curl --location 'http://localhost:8080/v2/payments/12345_pay_0192b3a0145173519abaa04d4b939558/get-intent' \
--header 'Content-Type: application/json' \
--header 'X-Profile-Id: pro_wcilqiS8axGFvpzfO9pw' \
--header 'api-key: dev_D3bTAROAIoP4nlqsaQXLzXoLdZznkpWQ3l4mzMRJEAP7V46pSnZucJM2zQiVwG0J'

1b. Response

{
    "id": "12345_pay_0192b3a0145173519abaa04d4b939558",
    "amount_details": {
        "order_amount": {
            "Value": 100
        },
        "currency": "USD",
        "shipping_cost": null,
        "order_tax_amount": null,
        "skip_external_tax_calculation": "Skip",
        "skip_surcharge_calculation": "Skip",
        "surcharge_amount": null,
        "tax_on_surcharge": null
    },
    "client_secret": "12345_pay_0192b3a0145173519abaa04d4b939558_secret_0192b3a0145173519abaa05c07ec3e61",
    "merchant_reference_id": null,
    "routing_algorithm_id": null,
    "capture_method": "automatic",
    "authentication_type": "no_three_ds",
    "billing": null,
    "shipping": null,
    "customer_id": null,
    "customer_present": "Present",
    "description": null,
    "return_url": null,
    "setup_future_usage": "on_session",
    "apply_mit_exemption": "Skip",
    "statement_descriptor": null,
    "order_details": null,
    "allowed_payment_method_types": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "payment_link_enabled": "Skip",
    "payment_link_config": null,
    "request_incremental_authorization": "default",
    "expires_on": "2024-10-22T10:02:45.618Z",
    "frm_metadata": null,
    "request_external_three_ds_authentication": "Skip"
}

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

Copy link

semanticdiff-com bot commented Oct 22, 2024

Review changes with SemanticDiff.

Analyzed 17 of 18 files.

Overall, the semantic diff is 50% smaller than the GitHub diff.

Filename Status
✔️ crates/router_env/src/logger/types.rs Analyzed
✔️ crates/router/src/types/api/payments.rs 49.02% smaller
✔️ crates/router/src/services/api.rs Analyzed
✔️ crates/router/src/routes/app.rs 16.0% smaller
✔️ crates/router/src/routes/lock_utils.rs 37.84% smaller
✔️ crates/router/src/routes/payments.rs Analyzed
✔️ crates/router/src/core/payments.rs 6.67% smaller
✔️ crates/router/src/core/payments/operations.rs Analyzed
✔️ crates/router/src/core/payments/transformers.rs Analyzed
✔️ crates/router/src/core/payments/operations/payment_get_intent.rs Analyzed
✔️ crates/openapi/src/openapi_v2.rs 18.63% smaller
✔️ crates/openapi/src/routes/payments.rs Analyzed
✔️ crates/hyperswitch_domain_models/src/router_flow_types/payments.rs 44.35% smaller
✔️ crates/api_models/src/payments.rs Analyzed
✔️ crates/api_models/src/events/payment.rs 32.86% smaller
✔️ api-reference-v2/mint.json Analyzed
✔️ api-reference-v2/openapi_spec.json 88.83% smaller
api-reference-v2/api-reference/payments/payments--get-intent.mdx Unsupported file format

@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Oct 22, 2024
@AnuthaDev AnuthaDev added this to the October 2024 Release milestone Oct 22, 2024
@AnuthaDev AnuthaDev marked this pull request as ready for review October 23, 2024 09:34
@AnuthaDev AnuthaDev requested review from a team as code owners October 23, 2024 09:34
crates/router/src/services/api.rs Outdated Show resolved Hide resolved
crates/router/src/routes/payments.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] add payments get-intent API for v2
4 participants