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(core): Add three_ds_requestor_app_url in business_profile #7589

Merged
merged 2 commits into from
Mar 24, 2025

Conversation

cookieg13
Copy link
Contributor

@cookieg13 cookieg13 commented Mar 21, 2025

Type of Change

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

Description

Add three_ds_requestor_app_url in business profile
Context: This is for merchant app declaring their URL within the CReq message so that the Authentication app can call the Merchant app after OOB authentication has occurred.

Scenario:

  • A user is making a purchase on a merchant's mobile app.
  • The transaction requires OOB authentication (e.g., through a separate authentication app).
  • The merchant app needs to tell the authentication app where to send the user back after authentication.
  • three_ds_requestor_app_url will contain the merchant's mobile app url

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?

Update business profile with three_ds_requestor_app_url

curl

curl --location --request POST 'http://localhost:8080/account/merchant_1742547204/business_profile/pro_6298oBgpw27s6v1QqYQs' \ --header 'Content-Type: application/json' \ --header 'api-key: test_admin' \ --data-raw '{ "collect_billing_details_from_wallet_connector": false, "collect_shipping_details_from_wallet_connector": false, "always_collect_shipping_details_from_wallet_connector": true, "always_collect_billing_details_from_wallet_connector": true, "authentication_connector_details": { "authentication_connectors": [], "three_ds_requestor_url": "https://app.hyperswitch.io/dashboard/payment-settings/pro_6298oBgpw27s6v1QqYQs", "three_ds_requestor_app_url": "merchantapp://auth/success?transactionId=1234567890" } }'

Screenshot 2025-03-21 at 14 39 38

Create 3ds payment with external authentication

curl --location --request POST 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_32udksJbcR2pLlvH67LsV6Iaaxfw5CQ0BqIZyRzGUwDqTfIEcXT9LCNCyAZwbQhH' \ --data-raw '{ "amount": 10000, "currency": "EUR", "confirm": true, "payment_link": false, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 10000, "customer_id": "StripeCustomer", "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "request_external_three_ds_authentication": true, "authentication_type": "three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4000 0000 0000 1091", "card_exp_month": "12", "card_exp_year": "2025", "card_cvc": "000" } }, "billing": { "address": { "line1": "1467", "line2": "CA", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "Henry", "last_name": "Henry" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "browser_info": { "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,\/;q=0.8", "language": "nl-NL", "color_depth": 24, "ip_address": "103.77.139.95", "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "dg": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }'
Screenshot 2025-03-21 at 16 43 31

Create External 3DS Authentication

curl --location --request POST 'localhost:8080/payments/pay_xhce13K4UclicVA0Q0IZ/3ds/authentication' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: pk_dev_a9a46d8a885940a3bf543ba1f8df66d7' \ --data-raw '{ "client_secret": "pay_xhce13K4UclicVA0Q0IZ_secret_TOYbtoZx1IFCx8Muuz8t", "device_channel": "BRW", "threeds_method_comp_ind": "Y" }'

Screenshot 2025-03-21 at 16 47 22

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

Sorry, something went wrong.

@cookieg13 cookieg13 requested review from a team as code owners March 21, 2025 09:14
Copy link

semanticdiff-com bot commented Mar 21, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  api-reference-v2/openapi_spec.json  0% smaller
  api-reference/openapi_spec.json  0% smaller
  crates/api_models/src/admin.rs  0% smaller
  crates/api_models/src/payments.rs  0% smaller
  crates/diesel_models/src/business_profile.rs  0% smaller
  crates/router/src/core/payments.rs  0% smaller
  crates/router/src/types/transformers.rs  0% smaller

@cookieg13 cookieg13 self-assigned this Mar 21, 2025
@cookieg13 cookieg13 changed the title Add three_ds_requestor_app_url in business_profile feat(core): Add three_ds_requestor_app_url in business_profile Mar 21, 2025
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Mar 21, 2025
@@ -91,6 +91,7 @@ pub struct ConnectorAuthenticationRequestData {
pub email: Option<Email>,
pub threeds_method_comp_ind: api_models::payments::ThreeDsCompletionIndicator,
pub three_ds_requestor_url: String,
pub three_ds_requestor_app_url: Option<String>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't required in ConnectorAuthenticationRequestData right? We just wanted to send it back in ExternalAuthenticationResponse

@@ -25,6 +25,7 @@ pub struct UasAuthenticationRequestData {
pub email: Option<common_utils::pii::Email>,
pub threeds_method_comp_ind: api_models::payments::ThreeDsCompletionIndicator,
pub three_ds_requestor_url: String,
pub three_ds_requestor_app_url: Option<String>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need not add here too

@cookieg13 cookieg13 force-pushed the three_ds_requestor_url branch from 75bf4a6 to 1d8d205 Compare March 21, 2025 11:19
@cookieg13 cookieg13 requested a review from a team as a code owner March 21, 2025 11:19
@cookieg13 cookieg13 force-pushed the three_ds_requestor_url branch from 1d8d205 to e167423 Compare March 21, 2025 11:20
@cookieg13 cookieg13 removed the request for review from a team March 21, 2025 11:25
@likhinbopanna likhinbopanna added this pull request to the merge queue Mar 24, 2025
Merged via the queue into main with commit 2ad2e50 Mar 24, 2025
17 of 20 checks passed
@likhinbopanna likhinbopanna deleted the three_ds_requestor_url branch March 24, 2025 11:30
pixincreate added a commit that referenced this pull request Mar 24, 2025
…lobalpay-fixes

* 'main' of github.com:juspay/hyperswitch:
  feat(connector): [Recurly] Add record back support for recurly [V2] (#7544)
  refactor(webhook): add jwt authenticated endpoint to list unique webhook events for a profile (#7325)
  feat(core): Add three_ds_requestor_app_url in business_profile (#7589)
  feat(refunds): Add refunds diesel model support in V2 API (#7503)
  fix(connector): [globalpay] address 5xx due to deserialization issue when `account_name` is not passed (#7540)
  chore: update production endpoint url for globalPay (#7588)
  feat(connector): [Stripebilling] add record back support for stripebilling (#7561)
  feat(router): Make payment_method_subtype optional in payment_attempt [V2] (#7568)
  fix(connector): RSync voided status mapping in AuthorizeDotNet (#7566)
  chore(version): 2025.03.24.0
  feat(connector): [Coingate] implement refunds  (#7513)
  feat(connectors): [Redsys] add Psync and Rsync support (#7586)
  refactor(connector): [BRAINTREE] Pass email in payment requests (#7591)
  feat(webhook): Return events list and total_count on list initial delivery attempt call (#7243)
  refactor(router): make error_type generic in domain_models inorder to avoid conversion of errors in storage_impl (#7537)
  feat(router): [V2] Return connector customer reference IDs in `CustomerResponse` (#7319)
  feat: core changes for extended authorization (#6766)
  feat(coingate): Add Payment webhooks (#7489)
  refactor(dynamic_routing): change insert operation to upsert for dynamic_routing_stats (#7398)
  feat(connectors): [Redsys] add 3D secure card payment support, including transaction capture, cancellation, and refunds (#7508)
pixincreate added a commit that referenced this pull request Mar 27, 2025
…e-status-check

* 'main' of github.com:juspay/hyperswitch: (74 commits)
  chore(version): 2025.03.26.0
  feat(connector): [Coingate] add wasm changes for coingate metadata (#7632)
  feat(connector): [TRUSTPAY]  implement Banktransfer PaymentMethod (#7575)
  feat(connector): [BANKOFAMERICA] Implement Samsung Pay (#6888)
  fix(connector):  add Nomupay in payout_connector_list for all environment (#7521)
  chore(version): 2025.03.25.0
  feat(connector): [Recurly] Add record back support for recurly [V2] (#7544)
  refactor(webhook): add jwt authenticated endpoint to list unique webhook events for a profile (#7325)
  feat(core): Add three_ds_requestor_app_url in business_profile (#7589)
  feat(refunds): Add refunds diesel model support in V2 API (#7503)
  fix(connector): [globalpay] address 5xx due to deserialization issue when `account_name` is not passed (#7540)
  chore: update production endpoint url for globalPay (#7588)
  feat(connector): [Stripebilling] add record back support for stripebilling (#7561)
  feat(router): Make payment_method_subtype optional in payment_attempt [V2] (#7568)
  fix(connector): RSync voided status mapping in AuthorizeDotNet (#7566)
  chore(version): 2025.03.24.0
  feat(connector): [Coingate] implement refunds  (#7513)
  feat(connectors): [Redsys] add Psync and Rsync support (#7586)
  refactor(connector): [BRAINTREE] Pass email in payment requests (#7591)
  feat(webhook): Return events list and total_count on list initial delivery attempt call (#7243)
  ...
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.

None yet

4 participants