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): store network_reference_id against the payment_method_id in the payment_method_table #4041

Merged
merged 52 commits into from
Apr 4, 2024

Conversation

ShankarSinghC
Copy link
Contributor

@ShankarSinghC ShankarSinghC commented Mar 12, 2024

Type of Change

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

Description

During the CIT there needs to be a validation which check for the setup_future_usage field, if it is set to off_session the NRID returned from the connector needs to be stored against the particular payment_method_id in the network_transaction_id column of the payment_methods table.

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?

Create a Merchant account
Create a mca for stripe, adyen or cybersource
Create a mandate payment (Setup mandate)

{
    "amount": 0,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "singh",
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "4242424242424242",
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        }
    },
    "setup_future_usage": "off_session",
    "payment_type": "setup_mandate",
        "customer_acceptance": {
            "acceptance_type": "offline",
            "accepted_at": "1963-05-03T04:07:52.723Z",
            "online": {
                "ip_address": "127.0.0.1",
                "user_agent": "amet irure esse"
            }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "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": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "John",
            "last_name": "Doe"
        },
        "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,
        "screen_height": 723,
        "screen_width": 1536,
        "time_zone": 0,
        "java_enabled": true,
        "java_script_enabled": true,
        "ip_address": "125.0.0.1"
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {},
    "order_details": [
        {
            "product_name": "Apple iphone 15",
            "quantity": 1,
            "amount": 0,
            "account_name": "transaction_processing"
        }
    ]
}

Once the mandate is successful the network_transaction_id is stored as below
network_transaction_id being stored in payment_method table
image

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
  • I added a CHANGELOG entry if applicable

@ShankarSinghC ShankarSinghC added A-core Area: Core flows A-payment-methods Area: Payment Methods A-payments Area: payments labels Mar 12, 2024
@ShankarSinghC ShankarSinghC added this to the March 2024 milestone Mar 12, 2024
@ShankarSinghC ShankarSinghC self-assigned this Mar 12, 2024
@ShankarSinghC ShankarSinghC requested review from a team as code owners March 12, 2024 08:10
@ShankarSinghC ShankarSinghC changed the title feat(router):Store Network Reference ID against the Payment Method ID in the payment_method_table feat(router): store network_reference_id against the payment_method_id in the payment_method_table Mar 12, 2024
@ShankarSinghC ShankarSinghC changed the title feat(router): store network_reference_id against the payment_method_id in the payment_method_table feat(router): store network_reference_id against the payment_method_id in the payment_method_table Mar 12, 2024
jagan-jaya
jagan-jaya previously approved these changes Apr 3, 2024
jagan-jaya
jagan-jaya previously approved these changes Apr 3, 2024
jagan-jaya
jagan-jaya previously approved these changes Apr 3, 2024
Aprabhat19
Aprabhat19 previously approved these changes Apr 3, 2024
@pixincreate pixincreate added this pull request to the merge queue Apr 4, 2024
Merged via the queue into main with commit 21e2d78 Apr 4, 2024
10 of 12 checks passed
@pixincreate pixincreate deleted the nrid/store-nrid branch April 4, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows A-payment-methods Area: Payment Methods A-payments Area: payments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Store Network Reference ID against the Payment Method ID for all off-session payments
6 participants