Skip to content

Conversation

sai-harsha-vardhan
Copy link
Contributor

@sai-harsha-vardhan sai-harsha-vardhan commented Sep 6, 2024

Type of Change

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

Description

add payment_method check in get_mandate_type to derive it as a recurring payment for setup_future_usage as off_session without customer_acceptance for wallet payment_method only

Additional Changes

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

Motivation and Context

Currently, when setup_future_usage is sent as off_session without customer acceptance, it was derived as recurring payment in get_mandate_type and external_three_ds flow was getting skipped. Ideally, we should treat it as a normal payment and proceed with external_three_ds flow in this case

How did you test it?

Tested Manually

  1. Payments Create with setup_future_usage as off_session and not sending customer_acceptance in payments confirm
    Request - It should trigger external_three_ds flow
    Payments Create
{
    "request_external_three_ds_authentication": true,
    "request_incremental_authorization": false,
    "amount": 123,
    "currency": "USD",
    "confirm": false,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "stripecustomer1",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "authentication_type": "three_ds",
    "return_url": "https://google.com/",
    "routing": {
        "type": "single",
        "data": "cybersource",
        "timestamp": {{$timestamp}}
    },
    "setup_future_usage": "off_session",
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "CA",
            "zip": "94122",
            "country": "US",
            "first_name": "John",
            "last_name": "Doe"
        },
         "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "CA",
            "zip": "94122",
            "country": "US",
            "first_name": "John",
            "last_name": "Doe"
        },
         "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
      "connector_metadata": {
        "noon": {
            "order_category": "pay"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {},
    "order_details": [
        {
            "product_name": "Apple iphone 15",
            "quantity":1,
            "amount": 0,
            "account_name": "transaction_processing"
        }
    ]
}

Payments Confirm

{
    "payment_method_data": {
        "card": {
            "card_number": "4111111111111111",
            "card_exp_month": "01",
            "card_exp_year": "2097",
            "card_holder_name": "John Doe",
            "card_cvc": "100"
        }
    },
    "payment_method": "card",
    "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,
        "screen_height": 723,
        "screen_width": 1536,
        "time_zone": 0,
        "java_enabled": true,
        "java_script_enabled": true,
        "ip_address": "125.0.0.1"
    }
}

image

  1. Sanity of New mandate and recurring payments with any external_three_ds flow <> any connector
  2. Sanity of New mandate and recurring payments without external_three_ds flow with any connector

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

@sai-harsha-vardhan sai-harsha-vardhan requested a review from a team as a code owner September 6, 2024 13:31
Copy link

Review changes with SemanticDiff.

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Sep 12, 2024
Merged via the queue into main with commit 1929f56 Sep 12, 2024
14 of 18 checks passed
@Gnanasundari24 Gnanasundari24 deleted the fix-netcetera-off-session-issue branch September 12, 2024 13:51
pixincreate added a commit that referenced this pull request Sep 13, 2024
* 'main' of github.com:juspay/hyperswitch: (51 commits)
  feat(connector): [DEUTSCHEBANK] Integrate SEPA Payments (#5826)
  feat(payments_v2): payment intent diesel and domain models changes v2 (#5783)
  feat(connector): [Fiuu] ADD Wasm Configs (#5874)
  chore(version): 2024.09.13.0
  refactor(core): Update shipping_cost and order_tax_amount to net_amount of payment_attempt (#5844)
  refactor: return optional request body from build_request_v2 in ConnectorIntegrationV2 trait (#5865)
  feat(refunds): Refunds aggregate api (#5795)
  refactor: handle redirections for iframed content (#5591)
  refactor(payment_links): Update API contract for dynamic transaction details and upgrade UI (#5849)
  fix(router): add payment_method check in `get_mandate_type` (#5828)
  fix(connector): [ZSL] compare consr_paid_amt with the total amount for identifying partial payments (#5873)
  feat(connector): [Novalnet] add Payment flows for cards (#5726)
  chore(version): 2024.09.12.0
  fix(router): return `collect_billing_details_from_wallet_connector` if `always_collect_billing_details_from_wallet_connector ` is false in merchant payment method list (#5854)
  feat(opensearch): add profile_id and organization_id to /search APIs (#5705)
  build(deps): bump `sqlx` to `0.8.2` (#5859)
  refactor: Remove unwanted commented lines (#5851)
  feat(payments): add support for profile aggregates (#5845)
  Feat(connector): [Fiuu] Add DuitNow/FPX PaymentMethod (#5841)
  chore: remove Connectors enum dependency from ConnectorIntegrationV2 trait (#5840)
  ...
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.

5 participants