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

fix(core): Update pm details in Psync response #6003

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

prasunna09
Copy link
Contributor

@prasunna09 prasunna09 commented Sep 24, 2024

Type of Change

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

Description

Currently, in Psync response, payment_method_data is being none. Updated the Psync response with pm data.
For network token pm data will be none, since we are not storing additional pm data in attempt.
For other payment methods, it will continue to function as it did previously.

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?

payment curl -

    "amount": 6540,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 6540,
    "customer_id": "StripeCustomer",
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://duck.com/",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "card_number": "4242424242424242",
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "sundari"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "sundari"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "routing": {
        "type": "single",
        "data": "stripe"
    }
    
} 

test cases - make a successful payment, pm data should be displayed in the response
PaymentsCreate -
Screenshot 2024-09-24 at 1 54 01 PM

PSync -
Screenshot 2024-09-24 at 1 54 16 PM

Save Card flow -
Screenshot 2024-09-24 at 1 54 30 PM

payment create - wallet - googlepay
Screenshot 2024-09-24 at 5 26 55 PM

sync response - wallet
Screenshot 2024-09-24 at 5 28 48 PM

confirm - network token
Screenshot 2024-09-24 at 5 31 01 PM

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

@prasunna09 prasunna09 added A-core Area: Core flows C-bug Category: Bug labels Sep 24, 2024
@prasunna09 prasunna09 self-assigned this Sep 24, 2024
@prasunna09 prasunna09 requested a review from a team as a code owner September 24, 2024 08:35
Copy link

semanticdiff-com bot commented Sep 24, 2024

Review changes with SemanticDiff.

Analyzed 1 of 1 files.

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

Filename Status
✔️ crates/router/src/core/payments/transformers.rs 34.0% smaller

@prasunna09 prasunna09 linked an issue Sep 24, 2024 that may be closed by this pull request
2 tasks
jarnura
jarnura previously approved these changes Sep 24, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Sep 24, 2024
Merged via the queue into main with commit 2ce677f Sep 24, 2024
24 of 26 checks passed
@likhinbopanna likhinbopanna deleted the fix-pm-data-in-psync-resp branch September 24, 2024 12:29
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.

[BUG] [CORE] Payment method details are being none in Psync Response.
4 participants