Skip to content

fix(connector): [adyen] remove browser info for mit and [paypal] add refund key in headers #5225

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

Merged
merged 2 commits into from
Jul 7, 2024

Conversation

SamraatBansal
Copy link
Contributor

@SamraatBansal SamraatBansal commented Jul 5, 2024

Type of Change

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

Description

  • [adyen] remove browser info for MIT
  • [paypal] add refund key in headers for idempotency to support multiple partial refunds

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 CIT payment with Adyen

curl --location 'http://localhost:8080/payments' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_FdbwTgkrJgCahVeugTVGJ3KWbS0UiIADoLlJoMfP2gzxicfOqbJ3HXcjoP8fjr8I' \
--data-raw '{
    "amount": 1212,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "customer_id": "adyen_test",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "email": "[email protected]",
    "name": "Joseph Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment",
    "statement_descriptor_name": "Juspay",
    "statement_descriptor_suffix": "Router",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
			"card_number": "4111111145551142",
			"card_exp_month": "03",
			"card_exp_year": "2030",
			"card_holder_name": "joseph Doe",
			"card_cvc": "737"
		}
    },
    "billing": {
        "address": {
            "state": "CA",
            "first_name": "John",
            "city": "San Francisco",
            "zip": "44545",
            "country": "US",
            "line1": "52 Julianastraat",
            "line2": "52 Julianastraat",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "setup_future_usage": "off_session",
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "in sit",
            "user_agent": "amet irure esse"
        }
    },
    "browser_info": {
        "user_agent": "Mozilla\/5.0 (iPhone 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": "128.0.0.1"
    },
    "order_details": [
        {
            "product_name": "Apple iphone 15",
            "quantity": 1,
            "amount": 10,
            "account_name": "transaction_processing"
        },
        {
            "product_name": "Apple iphone 15",
            "quantity": 1,
            "amount": -100,
            "account_name": "transaction_processing"
        }
    ]
}'

Use the payment_method_id to make an MIT payment without browser_info

curl --location 'http://localhost:8080/payments' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_FdbwTgkrJgCahVeugTVGJ3KWbS0UiIADoLlJoMfP2gzxicfOqbJ3HXcjoP8fjr8I' \
--data-raw '{
    "amount": 1212,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "customer_id": "adyen_test",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "email": "[email protected]",
    "name": "Joseph Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment",
    "statement_descriptor_name": "Juspay",
    "statement_descriptor_suffix": "Router",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
			"card_number": "4111111145551142",
			"card_exp_month": "03",
			"card_exp_year": "2030",
			"card_holder_name": "joseph Doe",
			"card_cvc": "737"
		}
    },
    "billing": {
        "address": {
            "state": "CA",
            "first_name": "John",
            "city": "San Francisco",
            "zip": "44545",
            "country": "US",
            "line1": "52 Julianastraat",
            "line2": "52 Julianastraat",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "off_session": true,
    "recurring_details": {
        "type":"payment_method_id",
        "data":"pm_bfdcaUOMFmv3eWu8ZEr8"
    },
    "order_details": [
        {
            "product_name": "Apple iphone 15",
            "quantity": 1,
            "amount": 10,
            "account_name": "transaction_processing"
        },
        {
            "product_name": "Apple iphone 15",
            "quantity": 1,
            "amount": -100,
            "account_name": "transaction_processing"
        }
    ]
}'

[Paypal] Test multiple partial refunds

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

@SamraatBansal SamraatBansal added A-connector-integration Area: Connector integration C-bug Category: Bug P-high Priority: High S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Jul 5, 2024
@SamraatBansal SamraatBansal added this to the July 2024 Release milestone Jul 5, 2024
@SamraatBansal SamraatBansal self-assigned this Jul 5, 2024
@SamraatBansal SamraatBansal requested review from a team as code owners July 5, 2024 13:11
@SamraatBansal SamraatBansal changed the title fix(connector): [adyen] remove browser info for and [paypal] add refund key in headers fix(connector): [adyen] remove browser info for mit and [paypal] add refund key in headers Jul 5, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Jul 7, 2024
Merged via the queue into main with commit 5ea09c7 Jul 7, 2024
11 checks passed
@likhinbopanna likhinbopanna deleted the adyen-paypal-integ-bug branch July 7, 2024 16:12
@SanchithHegde SanchithHegde removed P-high Priority: High S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Jul 7, 2024
pixincreate added a commit that referenced this pull request Jul 8, 2024
…ify-cypress

* 'main' of github.com:juspay/hyperswitch:
  chore(version): 2024.07.08.0
  fix(connector): [adyen] remove browser info for mit and [paypal] add refund key in headers (#5225)
  chore(version): 2024.07.06.0
  feat(router): Pass the shipping email whenever the billing details are included in the session token response (#5228)
  fix(cypress): fix metadata missing while creating connector if not in auth (#5215)
  refactor: fix unit and documentation tests (#4754)
  feat(events): add hashed customer_email and feature_metadata (#5220)
  feat(events): Add payment metadata to hyperswitch-payment-intent-events (#5170)
  fix(analytics): using HashSet to represent the returned metrics (#5179)
  feat(core): billing_details inclusion in Payment Intent (#5090)
  feat(router): pass fields to indicate if the customer address details to be connector from wallets (#5210)
  fix(refunds): Add aliases on refund status for backwards compatibility (#5216)
  Feat(connector): [BRAINTREE] Implement Card Mandates (#5204)
Narayanbhat166 pushed a commit that referenced this pull request Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-integration Area: Connector integration C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants