feat(refunds_v2): Add refund create core flow#7619
Merged
likhinbopanna merged 22 commits intomainfrom Apr 21, 2025
Merged
Conversation
...nce-v2/api-reference/payment-methods/payment-method--list-customer-saved-payment-methods.mdx
Outdated
Show resolved
Hide resolved
hrithikesh026
previously approved these changes
Apr 2, 2025
hrithikesh026
previously approved these changes
Apr 2, 2025
jarnura
requested changes
Apr 2, 2025
jarnura
requested changes
Apr 2, 2025
jarnura
requested changes
Apr 2, 2025
jarnura
requested changes
Apr 11, 2025
…tch into refunds-create-core-flow
hrithikesh026
previously approved these changes
Apr 11, 2025
jarnura
previously approved these changes
Apr 13, 2025
tsdk02
reviewed
Apr 15, 2025
| #[cfg(feature = "v2")] | ||
| impl ApiEventMetric for RefundsCreateRequest { | ||
| fn get_api_event_type(&self) -> Option<ApiEventsType> { | ||
| None |
Contributor
There was a problem hiding this comment.
Why are we returning None here?
Contributor
Author
There was a problem hiding this comment.
We are going to take this up later in separate implementation.
tsdk02
previously approved these changes
Apr 15, 2025
07095f6
hrithikesh026
approved these changes
Apr 17, 2025
su-shivanshmathur
approved these changes
Apr 17, 2025
pixincreate
added a commit
that referenced
this pull request
Apr 22, 2025
…acilitapay-pix-pmt * 'main' of github.com:juspay/hyperswitch: fix(connector): revert noon-paypal (#7864) refactor(cypress): do not update `card_expiry` while updating card info (#7834) feat(vsaas): add processor_merchant_id and created_by column in payment_intents and payments_attempts for v1 (#7768) chore(dynamic-fields): remove billing details as required fields for Worldpay connector (#7853) feat(dynamic_routing): integration of elimination routing for core flows (#6816) chore(version): 2025.04.22.0 revert: fix(connector): [noon] address `next_action_url` being `null` for cards in 3ds payment (#7859) feat(dynamic_routing): add open router integration for success based routing (#7795) feat(refunds_v2): Add refund create core flow (#7619) fix(core): [CARD TESTING GUARD] Added Card Testing Guard Config response in case of NULL (#7478)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
This PR is a part of v2 implementation of refunds. This PR contains refunds create core flow, i.e we can be able to create refunds for payments in v2.
Important
We are moving
refunds/transformers.rsandrefunds/validator.rsto a separate location because of accessibilityto both v1 and v2 refund code.
Additional Changes
Motivation and Context
Merging this PR would add support for creating refunds for payments in v2 apis.
How did you test it?
{ "id": "12345_pay_0195d13dd6497c12a3b187039fc4b71e", "status": "requires_payment_method", "amount_details": { "order_amount": 100, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null }, "client_secret": "12345_pay_0195d13dd6497c12a3b187039fc4b71e_secret_0195d13dd6547a938bfe7b97b36203a5", "profile_id": "pro_TujgCYCsvWvO6YNsRAmC", "merchant_reference_id": null, "routing_algorithm_id": null, "capture_method": "automatic", "authentication_type": "no_three_ds", "billing": { "address": { "city": null, "country": null, "line1": null, "line2": null, "line3": null, "zip": null, "state": null, "first_name": "John", "last_name": "Dough" }, "phone": null, "email": "example@example.com" }, "shipping": { "address": { "city": "Karwar", "country": null, "line1": null, "line2": null, "line3": null, "zip": "581301", "state": "Karnataka", "first_name": "John", "last_name": "Dough" }, "phone": null, "email": "example@example.com" }, "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": "2025-03-26T07:12:25.588Z", "frm_metadata": null, "request_external_three_ds_authentication": "Skip" }{ "id": "12345_pay_0195d13dd6497c12a3b187039fc4b71e", "status": "succeeded", "amount": { "order_amount": 100, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null, "net_amount": 100, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": 100 }, "customer_id": null, "connector": "stripe", "client_secret": "12345_pay_0195d13dd6497c12a3b187039fc4b71e_secret_0195d13dd6547a938bfe7b97b36203a5", "created": "2025-03-26T06:57:25.588Z", "payment_method_data": { "billing": null }, "payment_method_type": "card", "payment_method_subtype": "credit", "connector_transaction_id": "pi_3R6ntzD5R7gDAGff0MYUxZFn", "connector_reference_id": null, "merchant_connector_id": "mca_FhEKUEAUdgv7mVCs3A9U", "browser_info": null, "error": null, "shipping": null, "billing": null, "attempts": null, "connector_token_details": { "token": "pm_1R6ntzD5R7gDAGff07DogD0c", "connector_token_request_reference_id": "oMf8ppmFul0oTqI6Zl" }, "payment_method_id": null, "next_action": null, "return_url": "https://google.com/success", "authentication_type": "no_three_ds", "authentication_type_applied": "no_three_ds" }{ "id": "12345_ref_0195d13dfedb7790bc1a84be825e64d5", "payment_id": "12345_pay_0195d13dd6497c12a3b187039fc4b71e", "merchant_reference_id": "1742972256", "amount": 100, "currency": "USD", "status": "succeeded", "reason": "Paid by mistake", "metadata": { "foo": "bar" }, "error_details": { "code": "", "message": "" }, "created_at": "2025-03-26T06:57:35.993Z", "updated_at": "2025-03-26T06:57:36.981Z", "connector": "stripe", "profile_id": "pro_TujgCYCsvWvO6YNsRAmC", "merchant_connector_id": "mca_FhEKUEAUdgv7mVCs3A9U", "connector_refund_reference_id": "12345_ref_0195d13dfedb7790bc1a84be825e64d5" }{"error":{"type":"invalid_request","message":"The refund amount exceeds the amount captured","code":"IR_13"}}{ "id": "12345_pay_0195d142100474c3bcb32e40935e290d", "status": "failed", "amount": { "order_amount": 100, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null, "net_amount": 100, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": null }, "customer_id": null, "connector": "stripe", "client_secret": "12345_pay_0195d142100474c3bcb32e40935e290d_secret_0195d14210127d30b524ec0e063b3c0a", "created": "2025-03-26T07:02:02.514Z", "payment_method_data": { "billing": null }, "payment_method_type": "card", "payment_method_subtype": "credit", "connector_transaction_id": null, "connector_reference_id": null, "merchant_connector_id": "mca_FhEKUEAUdgv7mVCs3A9U", "browser_info": null, "error": { "code": "invalid_expiry_month", "message": "invalid_expiry_month", "unified_code": null, "unified_message": null }, "shipping": null, "billing": null, "attempts": null, "connector_token_details": null, "payment_method_id": null, "next_action": null, "return_url": "https://google.com/success", "authentication_type": "no_three_ds", "authentication_type_applied": "no_three_ds" }{ "error": { "type": "invalid_request", "message": "This Payment could not be refund because it has a status of failed. The expected state is succeeded, partially_captured", "code": "IR_14" } }Error case responses
Checklist
cargo +nightly fmt --allcargo clippy